LLDB mainline
|
Namespaces | |
namespace | ParsingUtils |
Classes | |
class | CommandObjectProcessTraceStartIntelPT |
class | CommandObjectThreadTraceStartIntelPT |
class | DecodedThread |
Class holding the instructions and function call hierarchy obtained from decoding a trace, as well as a position cursor used when reverse debugging the trace. More... | |
class | IntelPTError |
Class for representing a libipt decoding error. More... | |
struct | IntelPTThreadContinousExecution |
This struct represents a continuous execution of a thread in a cpu, delimited by a context switch in and out, and a list of Intel PT subtraces that belong to this execution. More... | |
struct | JSONCpu |
struct | JSONKernel |
struct | JSONModule |
struct | JSONProcess |
struct | JSONThread |
struct | JSONTraceBundleDescription |
struct | PSBBlock |
This struct represents a contiguous section of a trace that starts at a PSB and ends right before the next PSB or the end of the trace. More... | |
class | ScopedTaskTimer |
Class used to track the duration of long running tasks related to a single scope for reporting. More... | |
class | TaskTimer |
Class used to track the duration of long running tasks for reporting. More... | |
struct | ThreadContinuousExecution |
This class indicates the time interval in which a thread was running continuously on a cpu core. More... | |
class | ThreadDecoder |
Class that handles the decoding of a thread and caches the result. More... | |
class | TraceCursorIntelPT |
class | TraceIntelPT |
class | TraceIntelPTBundleLoader |
class | TraceIntelPTBundleSaver |
class | TraceIntelPTMultiCpuDecoder |
Class used to decode a multi-cpu Intel PT trace. More... | |
Typedefs | |
using | DecodedThreadSP = std::shared_ptr< DecodedThread > |
using | TraceIntelPTSP = std::shared_ptr< TraceIntelPT > |
Functions | |
llvm::Error | DecodeSingleTraceForThread (DecodedThread &decoded_thread, TraceIntelPT &trace_intel_pt, llvm::ArrayRef< uint8_t > buffer) |
Decode a raw Intel PT trace for a single thread given in buffer and append the decoded instructions and errors in decoded_thread . | |
llvm::Error | DecodeSystemWideTraceForThread (DecodedThread &decoded_thread, TraceIntelPT &trace_intel_pt, const llvm::DenseMap< lldb::cpu_id_t, llvm::ArrayRef< uint8_t > > &buffers, const std::vector< IntelPTThreadContinousExecution > &executions) |
Decode a raw Intel PT trace for a single thread that was collected in a per cpu core basis. | |
llvm::Expected< std::vector< PSBBlock > > | SplitTraceIntoPSBBlock (TraceIntelPT &trace_intel_pt, llvm::ArrayRef< uint8_t > buffer, bool expect_tscs) |
Given an intel pt trace, split it in chunks delimited by PSB packets. | |
llvm::Expected< std::optional< uint64_t > > | FindLowestTSCInTrace (TraceIntelPT &trace_intel_pt, llvm::ArrayRef< uint8_t > buffer) |
Find the lowest TSC in the given trace. | |
llvm::Expected< std::vector< ThreadContinuousExecution > > | DecodePerfContextSwitchTrace (llvm::ArrayRef< uint8_t > data, lldb::cpu_id_t cpu_id, const LinuxPerfZeroTscConversion &tsc_conversion) |
Decodes a context switch trace collected with perf_event_open. | |
llvm::Expected< std::vector< uint8_t > > | FilterProcessesFromContextSwitchTrace (llvm::ArrayRef< uint8_t > data, const std::set< lldb::pid_t > &pids) |
json::Value | toJSON (const JSONModule &module) |
bool | fromJSON (const json::Value &value, JSONModule &module, Path path) |
json::Value | toJSON (const JSONThread &thread) |
bool | fromJSON (const json::Value &value, JSONThread &thread, Path path) |
json::Value | toJSON (const JSONProcess &process) |
bool | fromJSON (const json::Value &value, JSONProcess &process, Path path) |
json::Value | toJSON (const JSONCpu &cpu) |
bool | fromJSON (const json::Value &value, JSONCpu &cpu, Path path) |
json::Value | toJSON (const pt_cpu &cpu_info) |
bool | fromJSON (const json::Value &value, pt_cpu &cpu_info, Path path) |
json::Value | toJSON (const JSONKernel &kernel) |
bool | fromJSON (const json::Value &value, JSONKernel &kernel, Path path) |
json::Value | toJSON (const JSONTraceBundleDescription &bundle_description) |
bool | fromJSON (const json::Value &value, JSONTraceBundleDescription &bundle_description, Path path) |
bool | fromJSON (const llvm::json::Value &value, JSONModule &module, llvm::json::Path path) |
bool | fromJSON (const llvm::json::Value &value, JSONThread &thread, llvm::json::Path path) |
bool | fromJSON (const llvm::json::Value &value, JSONProcess &process, llvm::json::Path path) |
bool | fromJSON (const llvm::json::Value &value, JSONCpu &cpu, llvm::json::Path path) |
bool | fromJSON (const llvm::json::Value &value, pt_cpu &cpu_info, llvm::json::Path path) |
bool | fromJSON (const llvm::json::Value &value, JSONTraceBundleDescription &bundle_description, llvm::json::Path path) |
Variables | |
const size_t | kDefaultIptTraceSize = 4 * 1024 |
const size_t | kDefaultProcessBufferSizeLimit = 5 * 1024 * 1024 |
const bool | kDefaultEnableTscValue = false |
const std::optional< size_t > | kDefaultPsbPeriod |
const bool | kDefaultPerCpuTracing = false |
const bool | kDefaultDisableCgroupFiltering = false |
const lldb::addr_t | kDefaultKernelLoadAddress = 0xffffffff81000000 |
const lldb::pid_t | kDefaultKernelProcessID = 1 |
using lldb_private::trace_intel_pt::DecodedThreadSP = typedef std::shared_ptr<DecodedThread> |
Definition at line 325 of file DecodedThread.h.
using lldb_private::trace_intel_pt::TraceIntelPTSP = typedef std::shared_ptr<TraceIntelPT> |
Definition at line 20 of file forward-declarations.h.
llvm::Expected< std::vector< ThreadContinuousExecution > > lldb_private::trace_intel_pt::DecodePerfContextSwitchTrace | ( | llvm::ArrayRef< uint8_t > | data, |
lldb::cpu_id_t | cpu_id, | ||
const LinuxPerfZeroTscConversion & | tsc_conversion | ||
) |
Decodes a context switch trace collected with perf_event_open.
[in] | data | The context switch trace in binary format. |
[i] | cpu_id The cpu_id where the trace were gotten from. | |
[in] | tsc_conversion | The conversion values used to confert nanoseconds to TSC. |
Referenced by lldb_private::trace_intel_pt::TraceIntelPTMultiCpuDecoder::DoCorrelateContextSwitchesAndIntelPtTraces().
llvm::Error lldb_private::trace_intel_pt::DecodeSingleTraceForThread | ( | DecodedThread & | decoded_thread, |
TraceIntelPT & | trace_intel_pt, | ||
llvm::ArrayRef< uint8_t > | buffer | ||
) |
Decode a raw Intel PT trace for a single thread given in buffer
and append the decoded instructions and errors in decoded_thread
.
It uses the low level libipt library underneath.
llvm::Error lldb_private::trace_intel_pt::DecodeSystemWideTraceForThread | ( | DecodedThread & | decoded_thread, |
TraceIntelPT & | trace_intel_pt, | ||
const llvm::DenseMap< lldb::cpu_id_t, llvm::ArrayRef< uint8_t > > & | buffers, | ||
const std::vector< IntelPTThreadContinousExecution > & | executions | ||
) |
Decode a raw Intel PT trace for a single thread that was collected in a per cpu core basis.
[out] | decoded_thread | All decoded instructions, errors and events will be appended to this object. |
[in] | trace_intel_pt | The main Trace object that contains all the information related to the trace session. |
[in] | buffers | A map from cpu core id to raw intel pt buffers. |
[in] | executions | A list of chunks of timed executions of the same given thread. It is used to identify if some executions have missing intel pt data and also to determine in which core a certain part of the execution ocurred. |
llvm::Expected< std::vector< uint8_t > > lldb_private::trace_intel_pt::FilterProcessesFromContextSwitchTrace | ( | llvm::ArrayRef< uint8_t > | data, |
const std::set< lldb::pid_t > & | pids | ||
) |
Referenced by WriteContextSwitchTrace().
llvm::Expected< std::optional< uint64_t > > lldb_private::trace_intel_pt::FindLowestTSCInTrace | ( | TraceIntelPT & | trace_intel_pt, |
llvm::ArrayRef< uint8_t > | buffer | ||
) |
Find the lowest TSC in the given trace.
Referenced by lldb_private::trace_intel_pt::TraceIntelPTMultiCpuDecoder::FindLowestTSC().
bool lldb_private::trace_intel_pt::fromJSON | ( | const json::Value & | value, |
JSONCpu & | cpu, | ||
Path | path | ||
) |
Definition at line 87 of file TraceIntelPTJSONStructs.cpp.
References lldb_private::trace_intel_pt::JSONCpu::context_switch_trace, lldb_private::trace_intel_pt::JSONCpu::id, and lldb_private::trace_intel_pt::JSONCpu::ipt_trace.
bool lldb_private::trace_intel_pt::fromJSON | ( | const json::Value & | value, |
JSONKernel & | kernel, | ||
Path | path | ||
) |
Definition at line 128 of file TraceIntelPTJSONStructs.cpp.
References lldb_private::trace_intel_pt::JSONKernel::file, and lldb_private::trace_intel_pt::JSONKernel::load_address.
bool lldb_private::trace_intel_pt::fromJSON | ( | const json::Value & | value, |
JSONModule & | module, | ||
Path | path | ||
) |
Definition at line 44 of file TraceIntelPTJSONStructs.cpp.
References lldb_private::trace_intel_pt::JSONModule::file, lldb_private::trace_intel_pt::JSONModule::load_address, lldb_private::trace_intel_pt::JSONModule::system_path, and lldb_private::trace_intel_pt::JSONModule::uuid.
Referenced by fromJSON(), and lldb_private::trace_intel_pt::TraceIntelPTBundleLoader::Load().
bool lldb_private::trace_intel_pt::fromJSON | ( | const json::Value & | value, |
JSONProcess & | process, | ||
Path | path | ||
) |
bool lldb_private::trace_intel_pt::fromJSON | ( | const json::Value & | value, |
JSONThread & | thread, | ||
Path | path | ||
) |
Definition at line 59 of file TraceIntelPTJSONStructs.cpp.
References lldb_private::trace_intel_pt::JSONThread::ipt_trace, and lldb_private::trace_intel_pt::JSONThread::tid.
bool lldb_private::trace_intel_pt::fromJSON | ( | const json::Value & | value, |
JSONTraceBundleDescription & | bundle_description, | ||
Path | path | ||
) |
Definition at line 146 of file TraceIntelPTJSONStructs.cpp.
References lldb_private::trace_intel_pt::JSONTraceBundleDescription::cpu_info, lldb_private::trace_intel_pt::JSONTraceBundleDescription::cpus, fromJSON(), lldb_private::trace_intel_pt::JSONTraceBundleDescription::kernel, lldb_private::trace_intel_pt::JSONTraceBundleDescription::processes, lldb_private::trace_intel_pt::JSONTraceBundleDescription::tsc_perf_zero_conversion, and lldb_private::trace_intel_pt::JSONTraceBundleDescription::type.
bool lldb_private::trace_intel_pt::fromJSON | ( | const json::Value & | value, |
pt_cpu & | cpu_info, | ||
Path | path | ||
) |
Definition at line 106 of file TraceIntelPTJSONStructs.cpp.
bool lldb_private::trace_intel_pt::fromJSON | ( | const llvm::json::Value & | value, |
JSONCpu & | cpu, | ||
llvm::json::Path | path | ||
) |
bool lldb_private::trace_intel_pt::fromJSON | ( | const llvm::json::Value & | value, |
JSONModule & | module, | ||
llvm::json::Path | path | ||
) |
bool lldb_private::trace_intel_pt::fromJSON | ( | const llvm::json::Value & | value, |
JSONProcess & | process, | ||
llvm::json::Path | path | ||
) |
bool lldb_private::trace_intel_pt::fromJSON | ( | const llvm::json::Value & | value, |
JSONThread & | thread, | ||
llvm::json::Path | path | ||
) |
bool lldb_private::trace_intel_pt::fromJSON | ( | const llvm::json::Value & | value, |
JSONTraceBundleDescription & | bundle_description, | ||
llvm::json::Path | path | ||
) |
bool lldb_private::trace_intel_pt::fromJSON | ( | const llvm::json::Value & | value, |
pt_cpu & | cpu_info, | ||
llvm::json::Path | path | ||
) |
Expected< std::vector< PSBBlock > > lldb_private::trace_intel_pt::SplitTraceIntoPSBBlock | ( | TraceIntelPT & | trace_intel_pt, |
llvm::ArrayRef< uint8_t > | buffer, | ||
bool | expect_tscs | ||
) |
Given an intel pt trace, split it in chunks delimited by PSB packets.
Each of these chunks is guaranteed to have been executed continuously.
[in] | trace_intel_pt | The main Trace object that contains all the information related to the trace session. |
[in] | buffer | The intel pt buffer that belongs to a single thread or to a single cpu core. |
[in] | expect_tscs | If true, an error is return if a packet without TSC is found. |
Definition at line 686 of file LibiptDecoder.cpp.
References CreateQueryDecoder(), HasEvents(), IsLibiptError(), and LLDB_INVALID_ADDRESS.
Referenced by GetPSBBlocksForCPU().
llvm::json::Value lldb_private::trace_intel_pt::toJSON | ( | const JSONCpu & | cpu | ) |
Definition at line 79 of file TraceIntelPTJSONStructs.cpp.
References lldb_private::trace_intel_pt::JSONCpu::context_switch_trace, lldb_private::trace_intel_pt::JSONCpu::id, lldb_private::trace_intel_pt::JSONCpu::ipt_trace, and lldb_private::Object.
llvm::json::Value lldb_private::trace_intel_pt::toJSON | ( | const JSONKernel & | kernel | ) |
Definition at line 120 of file TraceIntelPTJSONStructs.cpp.
References lldb_private::trace_intel_pt::JSONKernel::file, lldb_private::trace_intel_pt::JSONKernel::load_address, and toJSON().
llvm::json::Value lldb_private::trace_intel_pt::toJSON | ( | const JSONModule & | module | ) |
Definition at line 33 of file TraceIntelPTJSONStructs.cpp.
References lldb_private::trace_intel_pt::JSONModule::file, lldb_private::trace_intel_pt::JSONModule::load_address, lldb_private::trace_intel_pt::JSONModule::system_path, toJSON(), and lldb_private::trace_intel_pt::JSONModule::uuid.
Referenced by lldb_private::trace_intel_pt::TraceIntelPTBundleSaver::SaveToDisk(), lldb_private::trace_intel_pt::TraceIntelPT::Start(), and toJSON().
llvm::json::Value lldb_private::trace_intel_pt::toJSON | ( | const JSONProcess & | process | ) |
llvm::json::Value lldb_private::trace_intel_pt::toJSON | ( | const JSONThread & | thread | ) |
Definition at line 52 of file TraceIntelPTJSONStructs.cpp.
References lldb_private::trace_intel_pt::JSONThread::ipt_trace, and lldb_private::trace_intel_pt::JSONThread::tid.
llvm::json::Value lldb_private::trace_intel_pt::toJSON | ( | const JSONTraceBundleDescription & | bundle_description | ) |
Definition at line 134 of file TraceIntelPTJSONStructs.cpp.
References lldb_private::trace_intel_pt::JSONTraceBundleDescription::cpu_info, lldb_private::trace_intel_pt::JSONTraceBundleDescription::cpus, lldb_private::trace_intel_pt::JSONTraceBundleDescription::kernel, lldb_private::Object, lldb_private::trace_intel_pt::JSONTraceBundleDescription::processes, toJSON(), lldb_private::trace_intel_pt::JSONTraceBundleDescription::tsc_perf_zero_conversion, and lldb_private::trace_intel_pt::JSONTraceBundleDescription::type.
llvm::json::Value lldb_private::trace_intel_pt::toJSON | ( | const pt_cpu & | cpu_info | ) |
Definition at line 97 of file TraceIntelPTJSONStructs.cpp.
References lldb_private::Object.
const bool lldb_private::trace_intel_pt::kDefaultDisableCgroupFiltering = false |
Definition at line 24 of file TraceIntelPTConstants.h.
Referenced by lldb_private::trace_intel_pt::TraceIntelPT::GetStartConfigurationHelp(), lldb_private::trace_intel_pt::CommandObjectProcessTraceStartIntelPT::CommandOptions::OptionParsingStarting(), and lldb_private::trace_intel_pt::TraceIntelPT::Start().
const bool lldb_private::trace_intel_pt::kDefaultEnableTscValue = false |
Definition at line 21 of file TraceIntelPTConstants.h.
Referenced by lldb_private::trace_intel_pt::TraceIntelPT::GetStartConfigurationHelp(), lldb_private::trace_intel_pt::CommandObjectThreadTraceStartIntelPT::CommandOptions::OptionParsingStarting(), lldb_private::trace_intel_pt::CommandObjectProcessTraceStartIntelPT::CommandOptions::OptionParsingStarting(), and lldb_private::trace_intel_pt::TraceIntelPT::Start().
const size_t lldb_private::trace_intel_pt::kDefaultIptTraceSize = 4 * 1024 |
Definition at line 19 of file TraceIntelPTConstants.h.
Referenced by lldb_private::trace_intel_pt::TraceIntelPT::GetStartConfigurationHelp(), lldb_private::trace_intel_pt::CommandObjectThreadTraceStartIntelPT::CommandOptions::OptionParsingStarting(), lldb_private::trace_intel_pt::CommandObjectProcessTraceStartIntelPT::CommandOptions::OptionParsingStarting(), and lldb_private::trace_intel_pt::TraceIntelPT::Start().
const lldb::addr_t lldb_private::trace_intel_pt::kDefaultKernelLoadAddress = 0xffffffff81000000 |
Definition at line 30 of file TraceIntelPTConstants.h.
Referenced by lldb_private::trace_intel_pt::TraceIntelPTBundleLoader::ParseKernel().
const lldb::pid_t lldb_private::trace_intel_pt::kDefaultKernelProcessID = 1 |
Definition at line 31 of file TraceIntelPTConstants.h.
Referenced by BuildKernelSection(), and lldb_private::trace_intel_pt::TraceIntelPTBundleLoader::ParseKernel().
const bool lldb_private::trace_intel_pt::kDefaultPerCpuTracing = false |
Definition at line 23 of file TraceIntelPTConstants.h.
Referenced by lldb_private::trace_intel_pt::TraceIntelPT::GetStartConfigurationHelp(), lldb_private::trace_intel_pt::CommandObjectProcessTraceStartIntelPT::CommandOptions::OptionParsingStarting(), and lldb_private::trace_intel_pt::TraceIntelPT::Start().
const size_t lldb_private::trace_intel_pt::kDefaultProcessBufferSizeLimit = 5 * 1024 * 1024 |
Definition at line 20 of file TraceIntelPTConstants.h.
Referenced by lldb_private::trace_intel_pt::TraceIntelPT::GetStartConfigurationHelp(), lldb_private::trace_intel_pt::CommandObjectProcessTraceStartIntelPT::CommandOptions::OptionParsingStarting(), and lldb_private::trace_intel_pt::TraceIntelPT::Start().
const std::optional<size_t> lldb_private::trace_intel_pt::kDefaultPsbPeriod |
Definition at line 22 of file TraceIntelPTConstants.h.
Referenced by lldb_private::trace_intel_pt::TraceIntelPT::GetStartConfigurationHelp(), lldb_private::trace_intel_pt::CommandObjectThreadTraceStartIntelPT::CommandOptions::OptionParsingStarting(), lldb_private::trace_intel_pt::CommandObjectProcessTraceStartIntelPT::CommandOptions::OptionParsingStarting(), and lldb_private::trace_intel_pt::TraceIntelPT::Start().