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>

Collaboration diagram for lldb_private::process_linux::IntelPTCollector:
Collaboration graph
[legend]

Public Member Functions

 IntelPTCollector (NativeProcessProtocol &process)
 
void ProcessDidStop ()
 To be invoked as soon as we know the process stopped. More...
 
void ProcessWillResume ()
 To be invoked before the process will resume, so that we can capture the first instructions after the resume. More...
 
llvm::Error OnThreadCreated (lldb::tid_t tid)
 If "process tracing" is enabled, then trace the given thread. More...
 
llvm::Error OnThreadDestroyed (lldb::tid_t tid)
 Stops tracing a tracing upon a destroy event. More...
 
llvm::Error TraceStop (const TraceStopRequest &request)
 Implementation of the jLLDBTraceStop packet. More...
 
llvm::Error TraceStart (const TraceIntelPTStartRequest &request)
 Implementation of the jLLDBTraceStart packet. More...
 
llvm::Expected< llvm::json::Value > GetState ()
 Implementation of the jLLDBTraceGetState packet. More...
 
llvm::Expected< std::vector< uint8_t > > GetBinaryData (const TraceGetBinaryDataRequest &request)
 Implementation of the jLLDBTraceGetBinaryData packet. More...
 
void Clear ()
 Dispose of all traces. More...
 

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. More...
 
llvm::Expected< LinuxPerfZeroTscConversion & > FetchPerfTscConversionParameters ()
 

Private Attributes

NativeProcessProtocolm_process
 The target process. More...
 
IntelPTThreadTraceCollection m_thread_traces
 Threads traced due to "thread tracing". More...
 
IntelPTProcessTraceUP m_process_trace_up
 Only one instance of "process trace" can be active at a given time. More...
 

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 32 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 36 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 179 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 174 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 169 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: