LLDB mainline
|
Manages a list of thread traces. More...
#include <IntelPTThreadTraceCollection.h>
Public Member Functions | |
IntelPTThreadTraceCollection () | |
void | Clear () |
Dispose of all traces. | |
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. | |
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 . | |
llvm::Error | TraceStop (lldb::tid_t tid) |
Stop tracing the thread given by its tid . | |
size_t | GetTracedThreadsCount () const |
llvm::Expected< std::optional< std::vector< uint8_t > > > | TryGetBinaryData (const TraceGetBinaryDataRequest &request) |
Private Attributes | |
llvm::DenseMap< lldb::tid_t, IntelPTSingleBufferTrace > | m_thread_traces |
size_t | m_total_buffer_size = 0 |
Total actual thread buffer size in bytes. | |
Manages a list of thread traces.
Definition at line 19 of file IntelPTThreadTraceCollection.h.
|
inline |
Definition at line 21 of file IntelPTThreadTraceCollection.h.
void IntelPTThreadTraceCollection::Clear | ( | ) |
Dispose of all traces.
Definition at line 67 of file IntelPTThreadTraceCollection.cpp.
References m_thread_traces, and m_total_buffer_size.
Referenced by lldb_private::process_linux::IntelPTCollector::Clear().
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.
[in] | callback.tid | The id of the thread that is being traced. |
[in] | callback.core_trace | The single-buffer trace instance for the given core. |
Definition at line 51 of file IntelPTThreadTraceCollection.cpp.
References m_thread_traces.
Referenced by lldb_private::process_linux::IntelPTCollector::GetState(), and lldb_private::process_linux::IntelPTPerThreadProcessTrace::GetState().
size_t IntelPTThreadTraceCollection::GetTotalBufferSize | ( | ) | const |
Definition at line 47 of file IntelPTThreadTraceCollection.cpp.
References m_total_buffer_size.
Referenced by lldb_private::process_linux::IntelPTPerThreadProcessTrace::TraceStart().
Expected< IntelPTSingleBufferTrace & > IntelPTThreadTraceCollection::GetTracedThread | ( | lldb::tid_t | tid | ) |
Definition at line 59 of file IntelPTThreadTraceCollection.cpp.
References m_thread_traces.
Referenced by TryGetBinaryData().
size_t IntelPTThreadTraceCollection::GetTracedThreadsCount | ( | ) | const |
Definition at line 72 of file IntelPTThreadTraceCollection.cpp.
References m_thread_traces.
Referenced by lldb_private::process_linux::IntelPTCollector::TraceStart().
Error IntelPTThreadTraceCollection::TraceStart | ( | lldb::tid_t | tid, |
const TraceIntelPTStartRequest & | request | ||
) |
Start tracing the thread given by its tid
.
Definition at line 31 of file IntelPTThreadTraceCollection.cpp.
References m_thread_traces, m_total_buffer_size, lldb_private::process_linux::IntelPTSingleBufferTrace::Start(), and TracesThread().
Referenced by lldb_private::process_linux::IntelPTCollector::TraceStart(), and lldb_private::process_linux::IntelPTPerThreadProcessTrace::TraceStart().
bool IntelPTThreadTraceCollection::TracesThread | ( | lldb::tid_t | tid | ) | const |
tid
. Definition at line 17 of file IntelPTThreadTraceCollection.cpp.
References m_thread_traces.
Referenced by lldb_private::process_linux::IntelPTCollector::OnThreadDestroyed(), TraceStart(), lldb_private::process_linux::IntelPTPerThreadProcessTrace::TracesThread(), and TryGetBinaryData().
Error IntelPTThreadTraceCollection::TraceStop | ( | lldb::tid_t | tid | ) |
Stop tracing the thread given by its tid
.
Definition at line 21 of file IntelPTThreadTraceCollection.cpp.
References m_thread_traces, and m_total_buffer_size.
Referenced by lldb_private::process_linux::IntelPTCollector::OnThreadDestroyed(), lldb_private::process_linux::IntelPTCollector::TraceStop(), and lldb_private::process_linux::IntelPTPerThreadProcessTrace::TraceStop().
llvm::Expected< std::optional< std::vector< uint8_t > > > IntelPTThreadTraceCollection::TryGetBinaryData | ( | const TraceGetBinaryDataRequest & | request | ) |
Definition at line 77 of file IntelPTThreadTraceCollection.cpp.
References GetTracedThread(), lldb_private::TraceGetBinaryDataRequest::kind, lldb_private::IntelPTDataKinds::kIptTrace, lldb_private::TraceGetBinaryDataRequest::tid, and TracesThread().
Referenced by lldb_private::process_linux::IntelPTCollector::GetBinaryData(), and lldb_private::process_linux::IntelPTPerThreadProcessTrace::TryGetBinaryData().
|
private |
Definition at line 69 of file IntelPTThreadTraceCollection.h.
Referenced by Clear(), ForEachThread(), GetTracedThread(), GetTracedThreadsCount(), TraceStart(), TracesThread(), and TraceStop().
|
private |
Total actual thread buffer size in bytes.
Definition at line 71 of file IntelPTThreadTraceCollection.h.
Referenced by Clear(), GetTotalBufferSize(), TraceStart(), and TraceStop().