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

#include <ProcessorTrace.h>

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

Classes

class  file_close
 
class  munmap_delete
 

Public Member Functions

Status ReadPerfTraceAux (llvm::MutableArrayRef< uint8_t > &buffer, size_t offset=0)
 
Status ReadPerfTraceData (llvm::MutableArrayRef< uint8_t > &buffer, size_t offset=0)
 
 ~ProcessorTraceMonitor ()=default
 
lldb::tid_t GetThreadID () const
 
lldb::user_id_t GetTraceID () const
 
Status GetTraceConfig (TraceOptions &config) const
 

Static Public Member Functions

static Status GetCPUType (TraceOptions &config)
 
static llvm::Expected< ProcessorTraceMonitorUPCreate (lldb::pid_t pid, lldb::tid_t tid, const TraceOptions &config, bool useProcessSettings)
 
static void ReadCyclicBuffer (llvm::MutableArrayRef< uint8_t > &dst, llvm::MutableArrayRef< uint8_t > src, size_t src_cyc_index, size_t offset)
 Read data from a cyclic buffer. More...
 

Private Member Functions

void SetTraceID (lldb::user_id_t traceid)
 
Status StartTrace (lldb::pid_t pid, lldb::tid_t tid, const TraceOptions &config)
 
llvm::MutableArrayRef< uint8_t > GetAuxBuffer ()
 
llvm::MutableArrayRef< uint8_t > GetDataBuffer ()
 
 ProcessorTraceMonitor ()
 
void SetThreadID (lldb::tid_t tid)
 

Private Attributes

std::unique_ptr< perf_event_mmap_page, munmap_deletem_mmap_meta
 
std::unique_ptr< uint8_t, munmap_deletem_mmap_aux
 
std::unique_ptr< int, file_closem_fd
 
lldb::user_id_t m_traceid
 
lldb::tid_t m_thread_id
 

Static Private Attributes

static lldb::user_id_t m_trace_num = 1
 

Detailed Description

Definition at line 42 of file ProcessorTrace.h.

Constructor & Destructor Documentation

◆ ProcessorTraceMonitor()

lldb_private::process_linux::ProcessorTraceMonitor::ProcessorTraceMonitor ( )
inlineprivate

Definition at line 88 of file ProcessorTrace.h.

◆ ~ProcessorTraceMonitor()

lldb_private::process_linux::ProcessorTraceMonitor::~ProcessorTraceMonitor ( )
default

Referenced by SetThreadID().

Member Function Documentation

◆ Create()

llvm::Expected< ProcessorTraceMonitorUP > ProcessorTraceMonitor::Create ( lldb::pid_t  pid,
lldb::tid_t  tid,
const TraceOptions config,
bool  useProcessSettings 
)
static

◆ GetAuxBuffer()

llvm::MutableArrayRef< uint8_t > ProcessorTraceMonitor::GetAuxBuffer ( )
private

Definition at line 161 of file ProcessorTrace.cpp.

Referenced by SetTraceID().

◆ GetCPUType()

Status ProcessorTraceMonitor::GetCPUType ( TraceOptions config)
static

◆ GetDataBuffer()

llvm::MutableArrayRef< uint8_t > ProcessorTraceMonitor::GetDataBuffer ( )
private

Definition at line 150 of file ProcessorTrace.cpp.

Referenced by SetTraceID().

◆ GetThreadID()

lldb::tid_t lldb_private::process_linux::ProcessorTraceMonitor::GetThreadID ( ) const
inline

Definition at line 110 of file ProcessorTrace.h.

References m_thread_id.

◆ GetTraceConfig()

Status ProcessorTraceMonitor::GetTraceConfig ( TraceOptions config) const

◆ GetTraceID()

lldb::user_id_t lldb_private::process_linux::ProcessorTraceMonitor::GetTraceID ( ) const
inline

Definition at line 112 of file ProcessorTrace.h.

References GetTraceConfig(), m_traceid, and ReadCyclicBuffer().

◆ ReadCyclicBuffer()

void ProcessorTraceMonitor::ReadCyclicBuffer ( llvm::MutableArrayRef< uint8_t > &  dst,
llvm::MutableArrayRef< uint8_t >  src,
size_t  src_cyc_index,
size_t  offset 
)
static

Read data from a cyclic buffer.

Parameters
[in][out]buf Destination buffer, the buffer will be truncated to written size.
[in]srcSource buffer which must be a cyclic buffer.
[in]src_cyc_indexThe index pointer (start of the valid data in the cyclic buffer).
[in]offsetThe offset to begin reading the data in the cyclic buffer.

Definition at line 348 of file ProcessorTrace.cpp.

References lldb_private::GetLogIfAllCategoriesSet(), LLDB_LOG, and POSIX_LOG_PTRACE.

Referenced by GetTraceID().

◆ ReadPerfTraceAux()

Status ProcessorTraceMonitor::ReadPerfTraceAux ( llvm::MutableArrayRef< uint8_t > &  buffer,
size_t  offset = 0 
)

Definition at line 271 of file ProcessorTrace.cpp.

References error(), lldb_private::GetLogIfAllCategoriesSet(), LLDB_LOG, and POSIX_LOG_PTRACE.

Referenced by SetThreadID().

◆ ReadPerfTraceData()

Status ProcessorTraceMonitor::ReadPerfTraceData ( llvm::MutableArrayRef< uint8_t > &  buffer,
size_t  offset = 0 
)

◆ SetThreadID()

void lldb_private::process_linux::ProcessorTraceMonitor::SetThreadID ( lldb::tid_t  tid)
inlineprivate

◆ SetTraceID()

void lldb_private::process_linux::ProcessorTraceMonitor::SetTraceID ( lldb::user_id_t  traceid)
inlineprivate

Definition at line 80 of file ProcessorTrace.h.

References GetAuxBuffer(), GetDataBuffer(), and StartTrace().

◆ StartTrace()

Status ProcessorTraceMonitor::StartTrace ( lldb::pid_t  pid,
lldb::tid_t  tid,
const TraceOptions config 
)
private

Member Data Documentation

◆ m_fd

std::unique_ptr<int, file_close> lldb_private::process_linux::ProcessorTraceMonitor::m_fd
private

Definition at line 71 of file ProcessorTrace.h.

◆ m_mmap_aux

std::unique_ptr<uint8_t, munmap_delete> lldb_private::process_linux::ProcessorTraceMonitor::m_mmap_aux
private

Definition at line 70 of file ProcessorTrace.h.

◆ m_mmap_meta

std::unique_ptr<perf_event_mmap_page, munmap_delete> lldb_private::process_linux::ProcessorTraceMonitor::m_mmap_meta
private

Definition at line 69 of file ProcessorTrace.h.

◆ m_thread_id

lldb::tid_t lldb_private::process_linux::ProcessorTraceMonitor::m_thread_id
private

Definition at line 75 of file ProcessorTrace.h.

Referenced by GetThreadID().

◆ m_trace_num

lldb::user_id_t ProcessorTraceMonitor::m_trace_num = 1
staticprivate

Definition at line 78 of file ProcessorTrace.h.

◆ m_traceid

lldb::user_id_t lldb_private::process_linux::ProcessorTraceMonitor::m_traceid
private

Definition at line 74 of file ProcessorTrace.h.

Referenced by GetTraceID().


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