| LLDB mainline
    | 
Main class that manages intel-pt process and thread tracing. More...
#include <IntelPTCollector.h>
| Public Member Functions | |
| IntelPTCollector (NativeProcessProtocol &process) | |
| void | ProcessDidStop () | 
| To be invoked as soon as we know the process stopped. | |
| void | ProcessWillResume () | 
| To be invoked before the process will resume, so that we can capture the first instructions after the resume. | |
| llvm::Error | OnThreadCreated (lldb::tid_t tid) | 
| If "process tracing" is enabled, then trace the given thread. | |
| llvm::Error | OnThreadDestroyed (lldb::tid_t tid) | 
| Stops tracing a tracing upon a destroy event. | |
| llvm::Error | TraceStop (const TraceStopRequest &request) | 
| Implementation of the jLLDBTraceStop packet. | |
| llvm::Error | TraceStart (const TraceIntelPTStartRequest &request) | 
| Implementation of the jLLDBTraceStart packet. | |
| llvm::Expected< llvm::json::Value > | GetState () | 
| Implementation of the jLLDBTraceGetState packet. | |
| llvm::Expected< std::vector< uint8_t > > | GetBinaryData (const TraceGetBinaryDataRequest &request) | 
| Implementation of the jLLDBTraceGetBinaryData packet. | |
| void | Clear () | 
| Dispose of all traces. | |
| Static Public Member Functions | |
| static bool | IsSupported () | 
| Private Member Functions | |
| llvm::Error | TraceStop (lldb::tid_t tid) | 
| llvm::Error | TraceStart (lldb::tid_t tid, const TraceIntelPTStartRequest &request) | 
| Start tracing a specific thread. | |
| llvm::Expected< LinuxPerfZeroTscConversion & > | FetchPerfTscConversionParameters () | 
| Private Attributes | |
| NativeProcessProtocol & | m_process | 
| The target process. | |
| IntelPTThreadTraceCollection | m_thread_traces | 
| Threads traced due to "thread tracing". | |
| IntelPTProcessTraceUP | m_process_trace_up | 
| Only one instance of "process trace" can be active at a given time. | |
Main class that manages intel-pt process and thread tracing.
Definition at line 29 of file IntelPTCollector.h.
| IntelPTCollector::IntelPTCollector | ( | NativeProcessProtocol & | process | ) | 
| [in] | process | Process to be traced. | 
Definition at line 32 of file IntelPTCollector.cpp.
References m_process.
| void IntelPTCollector::Clear | ( | ) | 
Dispose of all traces.
Definition at line 261 of file IntelPTCollector.cpp.
References m_process_trace_up, and m_thread_traces.
Referenced by TraceStop().
| 
 | private | 
Definition at line 36 of file IntelPTCollector.cpp.
References createStringError(), lldb_private::process_linux::LoadPerfTscConversionParameters(), and lldb_private::toString().
Referenced by GetState(), and TraceStart().
| Expected< std::vector< uint8_t > > IntelPTCollector::GetBinaryData | ( | const TraceGetBinaryDataRequest & | request | ) | 
Implementation of the jLLDBTraceGetBinaryData packet.
Definition at line 222 of file IntelPTCollector.cpp.
References lldb_private::TraceGetBinaryDataRequest::cpu_id, createStringError(), lldb_private::process_linux::GetProcfsCpuInfo(), lldb_private::TraceGetBinaryDataRequest::kind, lldb_private::IntelPTDataKinds::kProcFsCpuInfo, m_process_trace_up, m_thread_traces, and lldb_private::TraceGetBinaryDataRequest::tid.
| Expected< json::Value > IntelPTCollector::GetState | ( | ) | 
Implementation of the jLLDBTraceGetState packet.
Definition at line 194 of file IntelPTCollector.cpp.
References lldb_private::TraceGetStateResponse::AddWarning(), FetchPerfTscConversionParameters(), lldb_private::process_linux::IntelPTSingleBufferTrace::GetIptTraceSize(), lldb_private::process_linux::GetProcfsCpuInfo(), lldb_private::IntelPTDataKinds::kIptTrace, lldb_private::IntelPTDataKinds::kProcFsCpuInfo, m_process_trace_up, m_thread_traces, lldb_private::TraceGetStateResponse::process_binary_data, lldb_private::toJSON(), lldb_private::toString(), lldb_private::TraceGetStateResponse::traced_threads, and lldb_private::TraceIntelPTGetStateResponse::tsc_perf_zero_conversion.
| 
 | static | 
Definition at line 252 of file IntelPTCollector.cpp.
References lldb_private::process_linux::GetIntelPTOSEventType().
Referenced by lldb_private::process_linux::NativeProcessLinux::TraceSupported().
| Error IntelPTCollector::OnThreadCreated | ( | lldb::tid_t | tid | ) | 
If "process tracing" is enabled, then trace the given thread.
Definition at line 179 of file IntelPTCollector.cpp.
References m_process_trace_up.
| Error IntelPTCollector::OnThreadDestroyed | ( | lldb::tid_t | tid | ) | 
Stops tracing a tracing upon a destroy event.
Definition at line 186 of file IntelPTCollector.cpp.
References m_process_trace_up, and m_thread_traces.
| void IntelPTCollector::ProcessDidStop | ( | ) | 
To be invoked as soon as we know the process stopped.
Definition at line 174 of file IntelPTCollector.cpp.
References m_process_trace_up.
| void IntelPTCollector::ProcessWillResume | ( | ) | 
To be invoked before the process will resume, so that we can capture the first instructions after the resume.
Definition at line 169 of file IntelPTCollector.cpp.
References m_process_trace_up.
| Error IntelPTCollector::TraceStart | ( | const TraceIntelPTStartRequest & | request | ) | 
Implementation of the jLLDBTraceStart packet.
Definition at line 98 of file IntelPTCollector.cpp.
References createStringError(), lldb_private::TraceIntelPTStartRequest::disable_cgroup_filtering, lldb_private::TraceIntelPTStartRequest::enable_tsc, error(), FetchPerfTscConversionParameters(), GetCGroupFileDescriptor(), lldb_private::TraceIntelPTStartRequest::IsPerCpuTracing(), lldb_private::TraceStartRequest::IsProcessTracing(), m_process, m_process_trace_up, m_thread_traces, lldb_private::process_linux::IntelPTPerThreadProcessTrace::Start(), lldb_private::process_linux::IntelPTMultiCoreTrace::StartOnAllCores(), and lldb_private::TraceStartRequest::tids.
| 
 | private | 
Start tracing a specific thread.
| Error IntelPTCollector::TraceStop | ( | const TraceStopRequest & | request | ) | 
Implementation of the jLLDBTraceStop packet.
Definition at line 52 of file IntelPTCollector.cpp.
References Clear(), error(), lldb_private::TraceStopRequest::IsProcessTracing(), lldb_private::TraceStopRequest::tids, and TraceStop().
Referenced by TraceStop().
| 
 | private | 
Definition at line 46 of file IntelPTCollector.cpp.
References m_process_trace_up, and m_thread_traces.
| 
 | private | 
The target process.
Definition at line 79 of file IntelPTCollector.h.
Referenced by IntelPTCollector(), and TraceStart().
| 
 | private | 
Only one instance of "process trace" can be active at a given time.
It might be nullptr.
Definition at line 85 of file IntelPTCollector.h.
Referenced by Clear(), GetBinaryData(), GetState(), OnThreadCreated(), OnThreadDestroyed(), ProcessDidStop(), ProcessWillResume(), TraceStart(), and TraceStop().
| 
 | private | 
Threads traced due to "thread tracing".
Definition at line 81 of file IntelPTCollector.h.
Referenced by Clear(), GetBinaryData(), GetState(), OnThreadDestroyed(), TraceStart(), and TraceStop().