9#ifndef liblldb_IntelPTMultiCoreTrace_H_
10#define liblldb_IntelPTMultiCoreTrace_H_
17#include "llvm/Support/Error.h"
22namespace process_linux {
44 static llvm::Expected<std::unique_ptr<IntelPTMultiCoreTrace>>
47 std::optional<int> cgroup_fd = std::nullopt);
87 llvm::Expected<std::optional<std::vector<uint8_t>>>
95 std::pair<IntelPTSingleBufferTrace, ContextSwitchTrace>>
102 std::pair<IntelPTSingleBufferTrace, ContextSwitchTrace>>
void ForEachCore(std::function< void(lldb::cpu_id_t cpu_id, IntelPTSingleBufferTrace &intelpt_trace, ContextSwitchTrace &context_switch_trace)> callback)
Execute the provided callback on each core that is being traced.
bool m_using_cgroup_filtering
IntelPTMultiCoreTrace(llvm::DenseMap< lldb::cpu_id_t, std::pair< IntelPTSingleBufferTrace, ContextSwitchTrace > > &&traces_per_core, NativeProcessProtocol &process, bool using_cgroup_filtering)
This assumes that all underlying perf_events for each core are part of the same perf event group.
bool TracesThread(lldb::tid_t tid) const override
TraceIntelPTGetStateResponse GetState() override
Construct a minimal jLLDBTraceGetState response for this process trace.
void ProcessWillResume() override
void ProcessDidStop() override
void ForEachCore(std::function< void(lldb::cpu_id_t cpu_id, IntelPTSingleBufferTrace &core_trace)> callback)
Execute the provided callback on each core that is being traced.
static llvm::Expected< std::unique_ptr< IntelPTMultiCoreTrace > > StartOnAllCores(const TraceIntelPTStartRequest &request, NativeProcessProtocol &process, std::optional< int > cgroup_fd=std::nullopt)
Start tracing all CPU cores.
llvm::Error TraceStart(lldb::tid_t tid) override
Start tracing the thread given by its tid.
NativeProcessProtocol & m_process
The target process.
llvm::DenseMap< lldb::cpu_id_t, std::pair< IntelPTSingleBufferTrace, ContextSwitchTrace > > m_traces_per_core
llvm::Expected< std::optional< std::vector< uint8_t > > > TryGetBinaryData(const TraceGetBinaryDataRequest &request) override
llvm::Error TraceStop(lldb::tid_t tid) override
Stop tracing the thread given by its tid.
Interface to be implemented by each 'process trace' strategy (per cpu, per thread,...
This class wraps a single perf event collecting intel pt data in a single buffer.
Thin wrapper of the perf_event_open API.
A class that represents a running process on the host machine.
jLLDBTraceGetBinaryData gdb-remote packet
jLLDBTraceStart gdb-remote packet