LLDB mainline
lldb_private::process_linux::IntelPTPerThreadProcessTrace Class Reference

Manages a "process trace" instance by tracing each thread individually. More...

#include <IntelPTPerThreadProcessTrace.h>

Inheritance diagram for lldb_private::process_linux::IntelPTPerThreadProcessTrace:
[legend]

Public Member Functions

bool TracesThread (lldb::tid_t tid) const override
llvm::Error TraceStart (lldb::tid_t tid) override
 Start tracing the thread given by its tid.
llvm::Error TraceStop (lldb::tid_t tid) override
 Stop tracing the thread given by its tid.
TraceIntelPTGetStateResponse GetState () override
 Construct a minimal jLLDBTraceGetState response for this process trace.
llvm::Expected< std::optional< std::vector< uint8_t > > > TryGetBinaryData (const TraceGetBinaryDataRequest &request) override
Public Member Functions inherited from lldb_private::process_linux::IntelPTProcessTrace
virtual ~IntelPTProcessTrace ()=default
virtual void ProcessDidStop ()
virtual void ProcessWillResume ()

Static Public Member Functions

static llvm::Expected< std::unique_ptr< IntelPTPerThreadProcessTrace > > Start (const TraceIntelPTStartRequest &request, llvm::ArrayRef< lldb::tid_t > current_tids)
 Start tracing the current process by tracing each of its tids individually.

Private Member Functions

 IntelPTPerThreadProcessTrace (const TraceIntelPTStartRequest &request)

Private Attributes

IntelPTThreadTraceCollection m_thread_traces
TraceIntelPTStartRequest m_tracing_params
 Params used to trace threads when the user started "process tracing".

Detailed Description

Manages a "process trace" instance by tracing each thread individually.

Definition at line 21 of file IntelPTPerThreadProcessTrace.h.

Constructor & Destructor Documentation

◆ IntelPTPerThreadProcessTrace()

lldb_private::process_linux::IntelPTPerThreadProcessTrace::IntelPTPerThreadProcessTrace ( const TraceIntelPTStartRequest & request)
inlineprivate

Definition at line 52 of file IntelPTPerThreadProcessTrace.h.

References m_tracing_params.

Referenced by Start().

Member Function Documentation

◆ GetState()

TraceIntelPTGetStateResponse IntelPTPerThreadProcessTrace::GetState ( )
overridevirtual

◆ Start()

Expected< std::unique_ptr< IntelPTPerThreadProcessTrace > > IntelPTPerThreadProcessTrace::Start ( const TraceIntelPTStartRequest & request,
llvm::ArrayRef< lldb::tid_t > current_tids )
static

Start tracing the current process by tracing each of its tids individually.

Parameters
[in]requestIntel PT configuration parameters.
[in]current_tidsList of tids currently alive. In the future, whenever a new thread is spawned, they should be traced by calling the TraceStart(tid) method.
Returns
An IntelPTMultiCoreTrace instance if tracing was successful, or an llvm::Error otherwise.

Definition at line 56 of file IntelPTPerThreadProcessTrace.cpp.

References error(), and IntelPTPerThreadProcessTrace().

Referenced by lldb_private::process_linux::IntelPTCollector::TraceStart().

◆ TraceStart()

Error IntelPTPerThreadProcessTrace::TraceStart ( lldb::tid_t tid)
overridevirtual

Start tracing the thread given by its tid.

Returns
An error if the operation failed.

Implements lldb_private::process_linux::IntelPTProcessTrace.

Definition at line 25 of file IntelPTPerThreadProcessTrace.cpp.

References createStringError(), m_thread_traces, and m_tracing_params.

◆ TracesThread()

bool IntelPTPerThreadProcessTrace::TracesThread ( lldb::tid_t tid) const
overridevirtual

◆ TraceStop()

Error IntelPTPerThreadProcessTrace::TraceStop ( lldb::tid_t tid)
overridevirtual

Stop tracing the thread given by its tid.

Returns
An error if the given thread is not being traced or tracing couldn't be stopped.

Implements lldb_private::process_linux::IntelPTProcessTrace.

Definition at line 21 of file IntelPTPerThreadProcessTrace.cpp.

References m_thread_traces.

◆ TryGetBinaryData()

Expected< std::optional< std::vector< uint8_t > > > IntelPTPerThreadProcessTrace::TryGetBinaryData ( const TraceGetBinaryDataRequest & request)
overridevirtual
Returns
std::nullopt if this instance doesn't support the requested data, an llvm::Error if this isntance supports it but fails at fetching it, and Error::success() otherwise.

Implements lldb_private::process_linux::IntelPTProcessTrace.

Definition at line 50 of file IntelPTPerThreadProcessTrace.cpp.

References m_thread_traces.

Member Data Documentation

◆ m_thread_traces

IntelPTThreadTraceCollection lldb_private::process_linux::IntelPTPerThreadProcessTrace::m_thread_traces
private

◆ m_tracing_params

TraceIntelPTStartRequest lldb_private::process_linux::IntelPTPerThreadProcessTrace::m_tracing_params
private

Params used to trace threads when the user started "process tracing".

Definition at line 57 of file IntelPTPerThreadProcessTrace.h.

Referenced by IntelPTPerThreadProcessTrace(), and TraceStart().


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