LLDB mainline
lldb_private::process_linux Namespace Reference

Namespaces

namespace  arm64
namespace  resource_handle

Classes

class  IntelPTCollector
 Main class that manages intel-pt process and thread tracing. More...
class  IntelPTMultiCoreTrace
class  IntelPTPerThreadProcessTrace
 Manages a "process trace" instance by tracing each thread individually. More...
class  IntelPTProcessTrace
 Interface to be implemented by each 'process trace' strategy (per cpu, per thread, etc). More...
class  IntelPTSingleBufferTrace
 This class wraps a single perf event collecting intel pt data in a single buffer. More...
class  IntelPTThreadTraceCollection
 Manages a list of thread traces. More...
class  NativeProcessLinux
 Manages communication with the inferior (debugee) process. More...
class  NativeRegisterContextLinux
class  NativeThreadLinux
class  PerfEvent
 Thin wrapper of the perf_event_open API. More...
class  SingleStepWorkaround

Typedefs

using IntelPTProcessTraceUP = std::unique_ptr<IntelPTProcessTrace>

Functions

llvm::Expected< uint32_t > GetIntelPTOSEventType ()
 Return the Linux perf event type for Intel PT.
llvm::Expected< PerfEventCreateContextSwitchTracePerfEvent (lldb::cpu_id_t cpu_id, const PerfEvent *parent_perf_event=nullptr)
 Create a perf event that tracks context switches on a cpu.
llvm::Expected< LinuxPerfZeroTscConversionLoadPerfTscConversionParameters ()
 Load PerfTscConversionParameters from perf_event_mmap_page, if available.
llvm::Expected< llvm::ArrayRef< uint8_t > > GetProcfsCpuInfo ()
llvm::Expected< std::vector< lldb::cpu_id_t > > GetAvailableLogicalCoreIDs (llvm::StringRef cpuinfo)
llvm::Expected< llvm::ArrayRef< lldb::cpu_id_t > > GetAvailableLogicalCoreIDs ()
llvm::Expected< int > GetPtraceScope ()

Typedef Documentation

◆ IntelPTProcessTraceUP

Function Documentation

◆ CreateContextSwitchTracePerfEvent()

Expected< PerfEvent > lldb_private::process_linux::CreateContextSwitchTracePerfEvent ( lldb::cpu_id_t cpu_id,
const PerfEvent * parent_perf_event = nullptr )

Create a perf event that tracks context switches on a cpu.

Parameters
[in]cpu_idThe core to trace.
[in]parent_perf_eventAn optional perf event that will be grouped with the new perf event.

Definition at line 332 of file Perf.cpp.

References createStringError(), lldb_private::process_linux::PerfEvent::GetFd(), lldb_private::GetLog(), lldb_private::process_linux::PerfEvent::Init(), lldb_private::process_linux::PerfEvent::IsEnabled(), LLDB_LOG, and lldb_private::Trace.

Referenced by lldb_private::process_linux::IntelPTMultiCoreTrace::StartOnAllCores().

◆ GetAvailableLogicalCoreIDs() [1/2]

llvm::Expected< llvm::ArrayRef< cpu_id_t > > lldb_private::process_linux::GetAvailableLogicalCoreIDs ( )
Returns
A list with all the logical cores available in the system and cache it if errors didn't happen.

Definition at line 56 of file Procfs.cpp.

References GetAvailableLogicalCoreIDs(), and GetProcfsCpuInfo().

Referenced by GetAvailableLogicalCoreIDs(), and lldb_private::process_linux::IntelPTMultiCoreTrace::StartOnAllCores().

◆ GetAvailableLogicalCoreIDs() [2/2]

llvm::Expected< std::vector< lldb::cpu_id_t > > lldb_private::process_linux::GetAvailableLogicalCoreIDs ( llvm::StringRef cpuinfo)
Returns
A list of available logical core ids given the contents of /proc/cpuinfo.

◆ GetIntelPTOSEventType()

Expected< uint32_t > lldb_private::process_linux::GetIntelPTOSEventType ( )

Return the Linux perf event type for Intel PT.

Definition at line 107 of file IntelPTSingleBufferTrace.cpp.

References Decimal, kOSEventIntelPTTypeFile, and ReadIntelPTConfigFile().

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

◆ GetProcfsCpuInfo()

Expected< ArrayRef< uint8_t > > lldb_private::process_linux::GetProcfsCpuInfo ( )
Returns
The content of /proc/cpuinfo and cache it if errors didn't happen.

Definition at line 22 of file Procfs.cpp.

References lldb_private::getProcFile().

Referenced by GetAvailableLogicalCoreIDs(), lldb_private::process_linux::IntelPTCollector::GetBinaryData(), and lldb_private::process_linux::IntelPTCollector::GetState().

◆ GetPtraceScope()

llvm::Expected< int > lldb_private::process_linux::GetPtraceScope ( )
Returns
The current value of /proc/sys/kernel/yama/ptrace_scope, parsed as an integer, or an error if the proc file cannot be read or has non-integer contents.

Definition at line 74 of file Procfs.cpp.

References createStringError(), and lldb_private::getProcFile().

Referenced by AddPtraceScopeNote().

◆ LoadPerfTscConversionParameters()

Expected< LinuxPerfZeroTscConversion > lldb_private::process_linux::LoadPerfTscConversionParameters ( )

Load PerfTscConversionParameters from perf_event_mmap_page, if available.

Definition at line 26 of file Perf.cpp.

References lldb_private::process_linux::PerfEvent::Init().

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