LLDB mainline
|
A plug-in interface definition class for trace information. More...
#include "lldb/Target/Trace.h"
Classes | |
struct | Storage |
We package all the data that can change upon process stops to make sure this contract is very visible. More... | |
Public Types | |
using | OnBinaryDataReadCallback = std::function< llvm::Error(llvm::ArrayRef< uint8_t > data)> |
using | OnCpusBinaryDataReadCallback = std::function< llvm::Error(const llvm::DenseMap< lldb::cpu_id_t, llvm::ArrayRef< uint8_t > > &cpu_to_data)> |
Public Member Functions | |
virtual void | Dump (Stream *s) const =0 |
Dump the trace data that this plug-in has access to. | |
virtual llvm::Expected< FileSpec > | SaveToDisk (FileSpec directory, bool compact)=0 |
Save the trace to the specified directory, which will be created if needed. | |
virtual lldb::CommandObjectSP | GetProcessTraceStartCommand (CommandInterpreter &interpreter)=0 |
Get the command handle for the "process trace start" command. | |
virtual lldb::CommandObjectSP | GetThreadTraceStartCommand (CommandInterpreter &interpreter)=0 |
Get the command handle for the "thread trace start" command. | |
virtual llvm::StringRef | GetSchema ()=0 |
virtual llvm::Expected< lldb::TraceCursorSP > | CreateNewCursor (Thread &thread)=0 |
Get a TraceCursor for the given thread's trace. | |
virtual void | DumpTraceInfo (Thread &thread, Stream &s, bool verbose, bool json)=0 |
Dump general info about a given thread's trace. | |
virtual bool | IsTraced (lldb::tid_t tid)=0 |
Check if a thread is currently traced by this object. | |
virtual const char * | GetStartConfigurationHelp ()=0 |
virtual llvm::Error | Start (StructuredData::ObjectSP configuration=StructuredData::ObjectSP())=0 |
Start tracing a live process. | |
virtual llvm::Error | Start (llvm::ArrayRef< lldb::tid_t > tids, StructuredData::ObjectSP configuration=StructuredData::ObjectSP())=0 |
Start tracing live threads. | |
llvm::Error | Stop (llvm::ArrayRef< lldb::tid_t > tids) |
Stop tracing live threads. | |
llvm::Error | Stop () |
Stop tracing all current and future threads of a live process. | |
uint32_t | GetStopID () |
llvm::Error | OnThreadBinaryDataRead (lldb::tid_t tid, llvm::StringRef kind, OnBinaryDataReadCallback callback) |
Fetch binary data associated with a thread, either live or postmortem, and pass it to the given callback. | |
llvm::Error | OnCpuBinaryDataRead (lldb::cpu_id_t cpu_id, llvm::StringRef kind, OnBinaryDataReadCallback callback) |
Fetch binary data associated with a cpu, either live or postmortem, and pass it to the given callback. | |
llvm::Error | OnAllCpusBinaryDataRead (llvm::StringRef kind, OnCpusBinaryDataReadCallback callback) |
Similar to OnCpuBinaryDataRead but this is able to fetch the same data from all cpus at once. | |
std::vector< Process * > | GetAllProcesses () |
llvm::ArrayRef< lldb::cpu_id_t > | GetTracedCpus () |
Public Member Functions inherited from lldb_private::PluginInterface | |
PluginInterface ()=default | |
virtual | ~PluginInterface ()=default |
virtual llvm::StringRef | GetPluginName ()=0 |
PluginInterface (const PluginInterface &)=delete | |
PluginInterface & | operator= (const PluginInterface &)=delete |
Static Public Member Functions | |
static llvm::Expected< lldb::TraceSP > | FindPluginForPostMortemProcess (Debugger &debugger, const llvm::json::Value &bundle_description, llvm::StringRef session_file_dir) |
Find a trace plug-in using JSON data. | |
static llvm::Expected< lldb::TraceSP > | FindPluginForLiveProcess (llvm::StringRef plugin_name, Process &process) |
Find a trace plug-in to trace a live process. | |
static llvm::Expected< llvm::StringRef > | FindPluginSchema (llvm::StringRef plugin_name) |
Get the schema of a Trace plug-in given its name. | |
static llvm::Expected< lldb::TraceSP > | LoadPostMortemTraceFromFile (Debugger &debugger, const FileSpec &trace_description_file) |
Load a trace from a trace description file and create Targets, Processes and Threads based on the contents of such file. | |
static llvm::Error | OnDataFileRead (FileSpec file, OnBinaryDataReadCallback callback) |
Helper method for reading a data file and passing its data to the given callback. | |
Protected Member Functions | |
Process * | GetLiveProcess () |
Get the currently traced live process. | |
llvm::ArrayRef< Process * > | GetPostMortemProcesses () |
Get the currently traced postmortem processes. | |
llvm::Expected< std::vector< uint8_t > > | GetLiveTraceBinaryData (const TraceGetBinaryDataRequest &request, uint64_t expected_size) |
Dispatcher for live trace data requests with some additional error checking. | |
llvm::Error | OnLiveThreadBinaryDataRead (lldb::tid_t tid, llvm::StringRef kind, OnBinaryDataReadCallback callback) |
Implementation of OnThreadBinaryDataRead() for live threads. | |
llvm::Error | OnLiveCpuBinaryDataRead (lldb::cpu_id_t cpu, llvm::StringRef kind, OnBinaryDataReadCallback callback) |
Implementation of OnLiveBinaryDataRead() for live cpus. | |
llvm::Error | OnPostMortemThreadBinaryDataRead (lldb::tid_t tid, llvm::StringRef kind, OnBinaryDataReadCallback callback) |
Implementation of OnThreadBinaryDataRead() for post mortem threads. | |
llvm::Error | OnPostMortemCpuBinaryDataRead (lldb::cpu_id_t cpu_id, llvm::StringRef kind, OnBinaryDataReadCallback callback) |
Implementation of OnCpuBinaryDataRead() for post mortem cpus. | |
llvm::Expected< FileSpec > | GetPostMortemThreadDataFile (lldb::tid_t tid, llvm::StringRef kind) |
Get the file path containing data of a postmortem thread given a data identifier. | |
llvm::Expected< FileSpec > | GetPostMortemCpuDataFile (lldb::cpu_id_t cpu_id, llvm::StringRef kind) |
Get the file path containing data of a postmortem cpu given a data identifier. | |
void | SetPostMortemThreadDataFile (lldb::tid_t tid, llvm::StringRef kind, FileSpec file_spec) |
Associate a given thread with a data file using a data identifier. | |
void | SetPostMortemCpuDataFile (lldb::cpu_id_t cpu_id, llvm::StringRef kind, FileSpec file_spec) |
Associate a given cpu with a data file using a data identifier. | |
llvm::Expected< std::vector< uint8_t > > | GetLiveThreadBinaryData (lldb::tid_t tid, llvm::StringRef kind) |
Get binary data of a live thread given a data identifier. | |
llvm::Expected< std::vector< uint8_t > > | GetLiveCpuBinaryData (lldb::cpu_id_t cpu_id, llvm::StringRef kind) |
Get binary data of a live cpu given a data identifier. | |
llvm::Expected< std::vector< uint8_t > > | GetLiveProcessBinaryData (llvm::StringRef kind) |
Get binary data of the current process given a data identifier. | |
std::optional< uint64_t > | GetLiveThreadBinaryDataSize (lldb::tid_t tid, llvm::StringRef kind) |
Get the size of the data returned by GetLiveThreadBinaryData. | |
std::optional< uint64_t > | GetLiveCpuBinaryDataSize (lldb::cpu_id_t cpu_id, llvm::StringRef kind) |
Get the size of the data returned by GetLiveCpuBinaryData. | |
std::optional< uint64_t > | GetLiveProcessBinaryDataSize (llvm::StringRef kind) |
Get the size of the data returned by GetLiveProcessBinaryData. | |
Trace (llvm::ArrayRef< lldb::ProcessSP > postmortem_processes, std::optional< std::vector< lldb::cpu_id_t > > postmortem_cpus) | |
Constructor for post mortem processes. | |
Trace (Process &live_process) | |
Constructor for a live process. | |
llvm::Error | Start (const llvm::json::Value &request) |
Start tracing a live process or its threads. | |
llvm::Expected< std::string > | GetLiveProcessState () |
Get the current tracing state of a live process and its threads. | |
virtual llvm::Error | DoRefreshLiveProcessState (TraceGetStateResponse state, llvm::StringRef json_response)=0 |
Method to be overriden by the plug-in to refresh its own state. | |
std::vector< Process * > | GetTracedProcesses () |
Return the list of processes traced by this instance. | |
const char * | RefreshLiveProcessState () |
Method to be invoked by the plug-in to refresh the live process state. | |
Private Member Functions | |
Storage & | GetUpdatedStorage () |
Get the storage after refreshing the data in the case of a live process. | |
Private Attributes | |
uint32_t | m_stop_id = LLDB_INVALID_STOP_ID |
Process * | m_live_process = nullptr |
Process traced by this object if doing live tracing. Otherwise it's null. | |
struct lldb_private::Trace::Storage | m_storage |
A plug-in interface definition class for trace information.
Trace plug-ins allow processor trace information to be loaded into LLDB so that the data can be dumped, used for reverse and forward stepping to allow introspection into the reason your process crashed or found its way to its current state.
Trace information can be loaded into a target without a process to allow introspection of the trace information during post mortem analysis, such as when loading core files.
Processor trace information can also be fetched through the process interfaces during a live debug session if your process supports gathering this information.
In order to support live tracing, the name of the plug-in should match the name of the tracing type returned by the gdb-remote packet jLLDBTraceSupported.
using lldb_private::Trace::OnBinaryDataReadCallback = std::function<llvm::Error(llvm::ArrayRef<uint8_t> data)> |
using lldb_private::Trace::OnCpusBinaryDataReadCallback = std::function<llvm::Error( const llvm::DenseMap<lldb::cpu_id_t, llvm::ArrayRef<uint8_t> > &cpu_to_data)> |
|
protected |
Constructor for post mortem processes.
|
inlineprotected |
|
pure virtual |
Get a TraceCursor for the given thread's trace.
Implemented in lldb_private::trace_intel_pt::TraceIntelPT.
|
protectedpure virtual |
Method to be overriden by the plug-in to refresh its own state.
This is invoked by RefreshLiveProcessState when a new state is found.
[in] | state | The jLLDBTraceGetState response. |
[in] | json_response | The original JSON response as a string. It might be useful to redecode it if it contains custom data for a specific trace plug-in. |
Implemented in lldb_private::trace_intel_pt::TraceIntelPT.
Referenced by RefreshLiveProcessState().
|
pure virtual |
Dump the trace data that this plug-in has access to.
This function will dump all of the trace data for all threads in a user readable format. Options for dumping can be added as this API is iterated on.
[in] | s | A stream object to dump the information to. |
Implemented in lldb_private::trace_intel_pt::TraceIntelPT.
|
pure virtual |
Dump general info about a given thread's trace.
Each Trace plug-in decides which data to show.
[in] | thread | The thread that owns the trace in question. |
[in] | s | The stream object where the info will be printed printed. |
[in] | verbose | If true, print detailed info If false, print compact info |
Implemented in lldb_private::trace_intel_pt::TraceIntelPT.
|
static |
Find a trace plug-in to trace a live process.
[in] | plugin_name | Plug-in name to search. |
[in] | process | Live process to trace. |
Definition at line 134 of file Trace.cpp.
References createInvalidPlugInError(), lldb_private::PluginManager::GetTraceCreateCallbackForLiveProcess(), and lldb_private::Process::IsLiveDebugSession().
Referenced by lldb_private::Target::CreateTrace().
|
static |
Find a trace plug-in using JSON data.
When loading trace data from disk, the information for the trace data can be contained in multiple files and require plug-in specific information about the CPU. Using data like JSON provides an easy way to specify all of the settings and information that we will need to load trace data into LLDB. This structured data can include:
[in] | debugger | The debugger instance where new Targets will be created as part of the JSON data parsing. |
[in] | bundle_description | The trace bundle description object describing the trace session. |
[in] | bundle_dir | The path to the directory that contains the trace bundle. |
Definition at line 119 of file Trace.cpp.
References createInvalidPlugInError(), llvm::json::fromJSON(), lldb_private::PluginManager::GetTraceCreateCallback(), and JSONSimpleTraceBundleDescription::type.
Referenced by LoadPostMortemTraceFromFile().
|
static |
Get the schema of a Trace plug-in given its name.
[in] | plugin_name | Name of the trace plugin. |
Definition at line 147 of file Trace.cpp.
References createInvalidPlugInError(), and lldb_private::PluginManager::GetTraceSchema().
Referenced by CommandObjectTraceSchema::DoExecute().
std::vector< Process * > Trace::GetAllProcesses | ( | ) |
Definition at line 363 of file Trace.cpp.
References GetLiveProcess(), and GetPostMortemProcesses().
Referenced by BuildKernelSection(), BuildProcessesSection(), and WriteContextSwitchTrace().
|
protected |
Get binary data of a live cpu given a data identifier.
[in] | cpu_id | The cpu whose data is requested. |
[in] | kind | The kind of data requested. |
Definition at line 247 of file Trace.cpp.
References GetLiveCpuBinaryDataSize(), lldb_private::PluginInterface::GetPluginName(), m_live_process, and lldb_private::Process::TraceGetBinaryData().
Referenced by OnLiveCpuBinaryDataRead().
|
protected |
Get the size of the data returned by GetLiveCpuBinaryData.
Definition at line 193 of file Trace.cpp.
References GetUpdatedStorage(), lldb_private::Trace::Storage::live_cpu_data_sizes, and Lookup().
Referenced by GetLiveCpuBinaryData().
|
protected |
Get the currently traced live process.
Definition at line 357 of file Trace.cpp.
References m_live_process.
Referenced by lldb_private::trace_intel_pt::TraceIntelPT::DoRefreshLiveProcessState(), GetAllProcesses(), and lldb_private::trace_intel_pt::TraceIntelPT::GetRawTraceSize().
|
protected |
Get binary data of the current process given a data identifier.
[in] | kind | The kind of data requested. |
Definition at line 265 of file Trace.cpp.
References GetLiveProcessBinaryDataSize(), GetLiveTraceBinaryData(), and lldb_private::PluginInterface::GetPluginName().
Referenced by lldb_private::trace_intel_pt::TraceIntelPT::GetCPUInfoForLiveProcess().
|
protected |
Get the size of the data returned by GetLiveProcessBinaryData.
Definition at line 200 of file Trace.cpp.
References GetUpdatedStorage(), lldb_private::Trace::Storage::live_process_data, and Lookup().
Referenced by GetLiveProcessBinaryData().
|
protected |
Get the current tracing state of a live process and its threads.
Definition at line 179 of file Trace.cpp.
References lldb_private::PluginInterface::GetPluginName(), m_live_process, and lldb_private::Process::TraceGetState().
Referenced by RefreshLiveProcessState().
|
protected |
Get binary data of a live thread given a data identifier.
[in] | tid | The thread whose data is requested. |
[in] | kind | The kind of data requested. |
Definition at line 233 of file Trace.cpp.
References GetLiveThreadBinaryDataSize(), GetLiveTraceBinaryData(), and lldb_private::PluginInterface::GetPluginName().
Referenced by OnLiveThreadBinaryDataRead().
|
protected |
Get the size of the data returned by GetLiveThreadBinaryData.
Definition at line 188 of file Trace.cpp.
References GetUpdatedStorage(), lldb_private::Trace::Storage::live_thread_data, and Lookup().
Referenced by GetLiveThreadBinaryData(), and lldb_private::trace_intel_pt::TraceIntelPT::GetRawTraceSize().
|
protected |
Dispatcher for live trace data requests with some additional error checking.
Definition at line 206 of file Trace.cpp.
References lldb_private::TraceGetBinaryDataRequest::cpu_id, lldb_private::TraceGetBinaryDataRequest::kind, m_live_process, lldb_private::TraceGetBinaryDataRequest::tid, and lldb_private::Process::TraceGetBinaryData().
Referenced by GetLiveProcessBinaryData(), and GetLiveThreadBinaryData().
|
protected |
Get the file path containing data of a postmortem cpu given a data identifier.
[in] | cpu_id | The cpu whose data is requested. |
[in] | kind | The kind of data requested. |
Definition at line 387 of file Trace.cpp.
References GetUpdatedStorage(), Lookup(), and lldb_private::Trace::Storage::postmortem_cpu_data.
Referenced by OnPostMortemCpuBinaryDataRead().
|
protected |
Get the currently traced postmortem processes.
Definition at line 359 of file Trace.cpp.
References m_storage, and lldb_private::Trace::Storage::postmortem_processes.
Referenced by GetAllProcesses().
|
protected |
Get the file path containing data of a postmortem thread given a data identifier.
[in] | tid | The thread whose data is requested. |
[in] | kind | The kind of data requested. |
Definition at line 375 of file Trace.cpp.
References GetUpdatedStorage(), Lookup(), and lldb_private::Trace::Storage::postmortem_thread_data.
Referenced by OnPostMortemThreadBinaryDataRead().
|
pure virtual |
Get the command handle for the "process trace start" command.
Implemented in lldb_private::trace_intel_pt::TraceIntelPT.
Referenced by CommandObjectProcessTraceStart::GetDelegateCommand().
|
pure virtual |
Implemented in lldb_private::trace_intel_pt::TraceIntelPT.
|
pure virtual |
Implemented in lldb_private::trace_intel_pt::TraceIntelPT.
uint32_t Trace::GetStopID | ( | ) |
Definition at line 369 of file Trace.cpp.
References m_stop_id, and RefreshLiveProcessState().
|
pure virtual |
Get the command handle for the "thread trace start" command.
Implemented in lldb_private::trace_intel_pt::TraceIntelPT.
Referenced by CommandObjectTraceStart::GetDelegateCommand().
ArrayRef< lldb::cpu_id_t > Trace::GetTracedCpus | ( | ) |
Definition at line 513 of file Trace.cpp.
References lldb_private::Trace::Storage::cpus, and GetUpdatedStorage().
Referenced by BuildCpusSection().
|
protected |
Return the list of processes traced by this instance.
None of the returned pointers are invalid.
Definition at line 520 of file Trace.cpp.
References GetUpdatedStorage(), m_live_process, and lldb_private::Trace::Storage::postmortem_processes.
|
private |
Get the storage after refreshing the data in the case of a live process.
Definition at line 278 of file Trace.cpp.
References m_storage, and RefreshLiveProcessState().
Referenced by GetLiveCpuBinaryDataSize(), GetLiveProcessBinaryDataSize(), GetLiveThreadBinaryDataSize(), GetPostMortemCpuDataFile(), GetPostMortemThreadDataFile(), GetTracedCpus(), GetTracedProcesses(), OnAllCpusBinaryDataRead(), OnLiveCpuBinaryDataRead(), SetPostMortemCpuDataFile(), and SetPostMortemThreadDataFile().
|
pure virtual |
Check if a thread is currently traced by this object.
[in] | tid | The id of the thread in question. |
Implemented in lldb_private::trace_intel_pt::TraceIntelPT.
|
static |
Load a trace from a trace description file and create Targets, Processes and Threads based on the contents of such file.
[in] | debugger | The debugger instance where new Targets will be created as part of the JSON data parsing. |
[in] | trace_description_file | The file containing the necessary information to load the trace. |
Definition at line 96 of file Trace.cpp.
References lldb_private::ConstString::AsCString(), FindPluginForPostMortemProcess(), lldb_private::FileSpec::GetDirectory(), and lldb_private::FileSpec::GetPath().
Referenced by CommandObjectTraceLoad::DoExecute(), and lldb::SBTrace::LoadTraceFromFile().
llvm::Error Trace::OnAllCpusBinaryDataRead | ( | llvm::StringRef | kind, |
OnCpusBinaryDataReadCallback | callback | ||
) |
Similar to OnCpuBinaryDataRead but this is able to fetch the same data from all cpus at once.
Definition at line 481 of file Trace.cpp.
References lldb_private::Trace::Storage::cpus, GetUpdatedStorage(), and OnCpuBinaryDataRead().
llvm::Error Trace::OnCpuBinaryDataRead | ( | lldb::cpu_id_t | cpu_id, |
llvm::StringRef | kind, | ||
OnBinaryDataReadCallback | callback | ||
) |
Fetch binary data associated with a cpu, either live or postmortem, and pass it to the given callback.
The reason of having a callback is to free the caller from having to manage the life cycle of the data and to hide the different data fetching procedures that exist for live and post mortem cpus.
The fetched data is not persisted after the callback is invoked.
[in] | cpu_id | The cpu who owns the data. |
[in] | kind | The kind of data to read. |
[in] | callback | The callback to be invoked once the data was successfully read. Its return value, which is an llvm::Error, is returned by this function. |
Definition at line 504 of file Trace.cpp.
References m_live_process, OnLiveCpuBinaryDataRead(), and OnPostMortemCpuBinaryDataRead().
Referenced by GetPSBBlocksForCPU(), OnAllCpusBinaryDataRead(), WriteContextSwitchTrace(), and WriteIntelPTTrace().
|
static |
Helper method for reading a data file and passing its data to the given callback.
Definition at line 437 of file Trace.cpp.
References lldb_private::FileSpec::GetPath(), and lldb_private::toString().
Referenced by lldb_private::trace_intel_pt::TraceIntelPTBundleLoader::AugmentThreadsFromContextSwitches(), OnPostMortemCpuBinaryDataRead(), and OnPostMortemThreadBinaryDataRead().
|
protected |
Implementation of OnLiveBinaryDataRead() for live cpus.
Definition at line 421 of file Trace.cpp.
References GetLiveCpuBinaryData(), GetUpdatedStorage(), lldb_private::Trace::Storage::live_cpu_data, and LookupAsPtr().
Referenced by OnCpuBinaryDataRead().
|
protected |
Implementation of OnThreadBinaryDataRead() for live threads.
Definition at line 413 of file Trace.cpp.
References GetLiveThreadBinaryData().
Referenced by OnThreadBinaryDataRead().
|
protected |
Implementation of OnCpuBinaryDataRead() for post mortem cpus.
Definition at line 463 of file Trace.cpp.
References GetPostMortemCpuDataFile(), and OnDataFileRead().
Referenced by OnCpuBinaryDataRead().
|
protected |
Implementation of OnThreadBinaryDataRead() for post mortem threads.
Definition at line 454 of file Trace.cpp.
References GetPostMortemThreadDataFile(), and OnDataFileRead().
Referenced by OnThreadBinaryDataRead().
llvm::Error Trace::OnThreadBinaryDataRead | ( | lldb::tid_t | tid, |
llvm::StringRef | kind, | ||
OnBinaryDataReadCallback | callback | ||
) |
Fetch binary data associated with a thread, either live or postmortem, and pass it to the given callback.
The reason of having a callback is to free the caller from having to manage the life cycle of the data and to hide the different data fetching procedures that exist for live and post mortem threads.
The fetched data is not persisted after the callback is invoked.
[in] | tid | The tid who owns the data. |
[in] | kind | The kind of data to read. |
[in] | callback | The callback to be invoked once the data was successfully read. Its return value, which is an llvm::Error, is returned by this function. |
Definition at line 472 of file Trace.cpp.
References m_live_process, OnLiveThreadBinaryDataRead(), and OnPostMortemThreadBinaryDataRead().
Referenced by lldb_private::trace_intel_pt::TraceIntelPT::OnThreadBufferRead().
|
protected |
Method to be invoked by the plug-in to refresh the live process state.
It will invoked DoRefreshLiveProcessState at some point, which should be implemented by the plug-in for custom state handling.
The result is cached through the same process stop. Even in the case of errors, it caches the error.
Definition at line 283 of file Trace.cpp.
References lldb_private::TraceThreadState::binary_data, lldb_private::TraceCpuState::binary_data, lldb_private::Trace::Storage::cpus, DoRefreshLiveProcessState(), GetLiveProcessState(), lldb_private::GetLog(), lldb_private::Process::GetStopID(), lldb_private::TraceCpuState::id, lldb_private::TraceBinaryData::kind, lldb_private::Trace::Storage::live_cpu_data_sizes, lldb_private::Trace::Storage::live_process_data, lldb_private::Trace::Storage::live_refresh_error, lldb_private::Trace::Storage::live_thread_data, LLDB_LOG, m_live_process, m_stop_id, m_storage, lldb_private::TraceBinaryData::size, lldb_private::Target, lldb_private::TraceThreadState::tid, lldb_private::toString(), and warning().
Referenced by lldb_private::trace_intel_pt::TraceIntelPT::Decode(), GetStopID(), GetUpdatedStorage(), lldb_private::trace_intel_pt::TraceIntelPT::GetUpdatedStorage(), and lldb_private::trace_intel_pt::TraceIntelPT::SaveToDisk().
|
pure virtual |
Save the trace to the specified directory, which will be created if needed.
This will also create a file <directory>/trace.json with the main properties of the trace session, along with others files which contain the actual trace data. The trace.json file can be used later as input for the "trace load" command to load the trace in LLDB.
[in] | directory | The directory where the trace files will be saved. |
[in] | compact | Try not to save to disk information irrelevant to the traced processes. Each trace plug-in implements this in a different fashion. |
Implemented in lldb_private::trace_intel_pt::TraceIntelPT.
|
protected |
Associate a given cpu with a data file using a data identifier.
[in] | cpu_id | The cpu associated with the data file. |
[in] | kind | The kind of data being registered. |
[in] | file_spec | The path of the data file. |
Definition at line 406 of file Trace.cpp.
References GetUpdatedStorage(), and lldb_private::Trace::Storage::postmortem_cpu_data.
|
protected |
Associate a given thread with a data file using a data identifier.
[in] | tid | The thread associated with the data file. |
[in] | kind | The kind of data being registered. |
[in] | file_spec | The path of the data file. |
Definition at line 400 of file Trace.cpp.
References GetUpdatedStorage(), and lldb_private::Trace::Storage::postmortem_thread_data.
|
protected |
Start tracing a live process or its threads.
[in] | request | JSON object with the information necessary to start tracing. In the case of gdb-remote processes, this JSON object should conform to the jLLDBTraceStart packet. |
Definition at line 155 of file Trace.cpp.
References m_live_process, and lldb_private::Process::TraceStart().
|
pure virtual |
Start tracing live threads.
[in] | tids | Threads to trace. This method tries to trace as many threads as possible. |
[in] | configuration | See SBTrace::Start(const lldb::SBThread &, const lldb::SBStructuredData &) for more information. |
Implemented in lldb_private::trace_intel_pt::TraceIntelPT.
|
pure virtual |
Start tracing a live process.
[in] | configuration | See SBTrace::Start(const lldb::SBStructuredData &) for more information. |
Implemented in lldb_private::trace_intel_pt::TraceIntelPT.
Referenced by lldb_private::trace_intel_pt::TraceIntelPT::Start().
Error Trace::Stop | ( | ) |
Stop tracing all current and future threads of a live process.
[in] | request | The information determining which threads or process to stop tracing. |
Definition at line 163 of file Trace.cpp.
References lldb_private::PluginInterface::GetPluginName(), m_live_process, and lldb_private::Process::TraceStop().
Error Trace::Stop | ( | llvm::ArrayRef< lldb::tid_t > | tids | ) |
Stop tracing live threads.
[in] | tids | The threads to stop tracing on. |
Definition at line 171 of file Trace.cpp.
References lldb_private::PluginInterface::GetPluginName(), m_live_process, and lldb_private::Process::TraceStop().
|
private |
Process traced by this object if doing live tracing. Otherwise it's null.
Definition at line 541 of file Trace.h.
Referenced by GetLiveCpuBinaryData(), GetLiveProcess(), GetLiveProcessState(), GetLiveTraceBinaryData(), GetTracedProcesses(), OnCpuBinaryDataRead(), OnThreadBinaryDataRead(), RefreshLiveProcessState(), Start(), and Stop().
|
private |
Definition at line 538 of file Trace.h.
Referenced by GetStopID(), and RefreshLiveProcessState().
|
private |
Referenced by GetPostMortemProcesses(), GetUpdatedStorage(), and RefreshLiveProcessState().