LLDB mainline
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
lldb_private::process_linux::IntelPTCollector Class Reference

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

NativeProcessProtocolm_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.
 

Detailed Description

Main class that manages intel-pt process and thread tracing.

Definition at line 29 of file IntelPTCollector.h.

Constructor & Destructor Documentation

◆ IntelPTCollector()

IntelPTCollector::IntelPTCollector ( NativeProcessProtocol process)
Parameters
[in]processProcess to be traced.

Definition at line 33 of file IntelPTCollector.cpp.

Member Function Documentation

◆ Clear()

void IntelPTCollector::Clear ( )

◆ FetchPerfTscConversionParameters()

llvm::Expected< LinuxPerfZeroTscConversion & > IntelPTCollector::FetchPerfTscConversionParameters ( )
private
Returns
The conversion object between TSC and wall time.

Definition at line 37 of file IntelPTCollector.cpp.

References lldb_private::process_linux::LoadPerfTscConversionParameters(), and lldb_private::toString().

Referenced by GetState(), and TraceStart().

◆ GetBinaryData()

Expected< std::vector< uint8_t > > IntelPTCollector::GetBinaryData ( const TraceGetBinaryDataRequest request)

◆ GetState()

Expected< json::Value > IntelPTCollector::GetState ( )

◆ IsSupported()

bool IntelPTCollector::IsSupported ( )
static

◆ OnThreadCreated()

Error IntelPTCollector::OnThreadCreated ( lldb::tid_t  tid)

If "process tracing" is enabled, then trace the given thread.

Definition at line 180 of file IntelPTCollector.cpp.

References m_process_trace_up.

Referenced by lldb_private::process_linux::NativeProcessLinux::NotifyTracersOfNewThread().

◆ OnThreadDestroyed()

Error IntelPTCollector::OnThreadDestroyed ( lldb::tid_t  tid)

◆ ProcessDidStop()

void IntelPTCollector::ProcessDidStop ( )

To be invoked as soon as we know the process stopped.

Definition at line 175 of file IntelPTCollector.cpp.

References m_process_trace_up.

Referenced by lldb_private::process_linux::NativeProcessLinux::NotifyTracersProcessDidStop().

◆ ProcessWillResume()

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 170 of file IntelPTCollector.cpp.

References m_process_trace_up.

Referenced by lldb_private::process_linux::NativeProcessLinux::NotifyTracersProcessWillResume().

◆ TraceStart() [1/2]

Error IntelPTCollector::TraceStart ( const TraceIntelPTStartRequest request)

◆ TraceStart() [2/2]

llvm::Error lldb_private::process_linux::IntelPTCollector::TraceStart ( lldb::tid_t  tid,
const TraceIntelPTStartRequest request 
)
private

Start tracing a specific thread.

◆ TraceStop() [1/2]

Error IntelPTCollector::TraceStop ( const TraceStopRequest request)

◆ TraceStop() [2/2]

Error IntelPTCollector::TraceStop ( lldb::tid_t  tid)
private

Member Data Documentation

◆ m_process

NativeProcessProtocol& lldb_private::process_linux::IntelPTCollector::m_process
private

The target process.

Definition at line 79 of file IntelPTCollector.h.

Referenced by TraceStart().

◆ m_process_trace_up

IntelPTProcessTraceUP lldb_private::process_linux::IntelPTCollector::m_process_trace_up
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().

◆ m_thread_traces

IntelPTThreadTraceCollection lldb_private::process_linux::IntelPTCollector::m_thread_traces
private

Threads traced due to "thread tracing".

Definition at line 81 of file IntelPTCollector.h.

Referenced by Clear(), GetBinaryData(), GetState(), OnThreadDestroyed(), TraceStart(), and TraceStop().


The documentation for this class was generated from the following files: