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

Manages a list of thread traces. More...

#include <IntelPTThreadTraceCollection.h>

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

Public Member Functions

 IntelPTThreadTraceCollection ()
 
void Clear ()
 Dispose of all traces. More...
 
bool TracesThread (lldb::tid_t tid) const
 
size_t GetTotalBufferSize () const
 
void ForEachThread (std::function< void(lldb::tid_t tid, IntelPTSingleBufferTrace &thread_trace)> callback)
 Execute the provided callback on each thread that is being traced. More...
 
llvm::Expected< IntelPTSingleBufferTrace & > GetTracedThread (lldb::tid_t tid)
 
llvm::Error TraceStart (lldb::tid_t tid, const TraceIntelPTStartRequest &request)
 Start tracing the thread given by its tid. More...
 
llvm::Error TraceStop (lldb::tid_t tid)
 Stop tracing the thread given by its tid. More...
 
size_t GetTracedThreadsCount () const
 
llvm::Expected< llvm::Optional< std::vector< uint8_t > > > TryGetBinaryData (const TraceGetBinaryDataRequest &request)
 

Private Attributes

llvm::DenseMap< lldb::tid_t, IntelPTSingleBufferTracem_thread_traces
 
size_t m_total_buffer_size = 0
 Total actual thread buffer size in bytes. More...
 

Detailed Description

Manages a list of thread traces.

Definition at line 18 of file IntelPTThreadTraceCollection.h.

Constructor & Destructor Documentation

◆ IntelPTThreadTraceCollection()

lldb_private::process_linux::IntelPTThreadTraceCollection::IntelPTThreadTraceCollection ( )
inline

Definition at line 20 of file IntelPTThreadTraceCollection.h.

Member Function Documentation

◆ Clear()

void IntelPTThreadTraceCollection::Clear ( )

Dispose of all traces.

Definition at line 66 of file IntelPTThreadTraceCollection.cpp.

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

◆ ForEachThread()

void IntelPTThreadTraceCollection::ForEachThread ( std::function< void(lldb::tid_t tid, IntelPTSingleBufferTrace &thread_trace)>  callback)

Execute the provided callback on each thread that is being traced.

Parameters
[in]callback.tidThe id of the thread that is being traced.
[in]callback.core_traceThe single-buffer trace instance for the given core.

Definition at line 50 of file IntelPTThreadTraceCollection.cpp.

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

◆ GetTotalBufferSize()

size_t IntelPTThreadTraceCollection::GetTotalBufferSize ( ) const
Returns
The total sum of the intel pt trace buffer sizes used by this collection.

Definition at line 46 of file IntelPTThreadTraceCollection.cpp.

◆ GetTracedThread()

Expected< IntelPTSingleBufferTrace & > IntelPTThreadTraceCollection::GetTracedThread ( lldb::tid_t  tid)

Definition at line 58 of file IntelPTThreadTraceCollection.cpp.

◆ GetTracedThreadsCount()

size_t IntelPTThreadTraceCollection::GetTracedThreadsCount ( ) const

◆ TraceStart()

Error IntelPTThreadTraceCollection::TraceStart ( lldb::tid_t  tid,
const TraceIntelPTStartRequest request 
)

Start tracing the thread given by its tid.

Returns
An error if the operation failed.

Definition at line 30 of file IntelPTThreadTraceCollection.cpp.

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

◆ TracesThread()

bool IntelPTThreadTraceCollection::TracesThread ( lldb::tid_t  tid) const
Returns
true if and only if this instance of tracing the provided tid.

Definition at line 16 of file IntelPTThreadTraceCollection.cpp.

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

◆ TraceStop()

Error IntelPTThreadTraceCollection::TraceStop ( lldb::tid_t  tid)

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.

Definition at line 20 of file IntelPTThreadTraceCollection.cpp.

Referenced by lldb_private::process_linux::IntelPTCollector::OnThreadDestroyed(), and lldb_private::process_linux::IntelPTCollector::TraceStop().

◆ TryGetBinaryData()

llvm::Expected< llvm::Optional< std::vector< uint8_t > > > IntelPTThreadTraceCollection::TryGetBinaryData ( const TraceGetBinaryDataRequest request)

Returns
None 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.

Definition at line 76 of file IntelPTThreadTraceCollection.cpp.

References lldb_private::TraceGetBinaryDataRequest::kind, and lldb_private::TraceGetBinaryDataRequest::tid.

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

Member Data Documentation

◆ m_thread_traces

llvm::DenseMap<lldb::tid_t, IntelPTSingleBufferTrace> lldb_private::process_linux::IntelPTThreadTraceCollection::m_thread_traces
private

Definition at line 68 of file IntelPTThreadTraceCollection.h.

◆ m_total_buffer_size

size_t lldb_private::process_linux::IntelPTThreadTraceCollection::m_total_buffer_size = 0
private

Total actual thread buffer size in bytes.

Definition at line 70 of file IntelPTThreadTraceCollection.h.


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