9#ifndef LLDB_SOURCE_PLUGINS_TRACE_LIBIPT_DECODER_H
10#define LLDB_SOURCE_PLUGINS_TRACE_LIBIPT_DECODER_H
19namespace trace_intel_pt {
29 std::optional<uint64_t>
tsc;
62 llvm::ArrayRef<uint8_t> buffer);
88 const llvm::DenseMap<
lldb::cpu_id_t, llvm::ArrayRef<uint8_t>> &buffers,
89 const std::vector<IntelPTThreadContinousExecution> &executions);
108llvm::Expected<std::vector<PSBBlock>>
110 llvm::ArrayRef<uint8_t> buffer,
bool expect_tscs);
118llvm::Expected<std::optional<uint64_t>>
120 llvm::ArrayRef<uint8_t> buffer);
Class holding the instructions and function call hierarchy obtained from decoding a trace,...
llvm::Expected< std::vector< PSBBlock > > SplitTraceIntoPSBBlock(TraceIntelPT &trace_intel_pt, llvm::ArrayRef< uint8_t > buffer, bool expect_tscs)
Given an intel pt trace, split it in chunks delimited by PSB packets.
llvm::Error DecodeSingleTraceForThread(DecodedThread &decoded_thread, TraceIntelPT &trace_intel_pt, llvm::ArrayRef< uint8_t > buffer)
Decode a raw Intel PT trace for a single thread given in buffer and append the decoded instructions a...
llvm::Error DecodeSystemWideTraceForThread(DecodedThread &decoded_thread, TraceIntelPT &trace_intel_pt, const llvm::DenseMap< lldb::cpu_id_t, llvm::ArrayRef< uint8_t > > &buffers, const std::vector< IntelPTThreadContinousExecution > &executions)
Decode a raw Intel PT trace for a single thread that was collected in a per cpu core basis.
llvm::Expected< std::optional< uint64_t > > FindLowestTSCInTrace(TraceIntelPT &trace_intel_pt, llvm::ArrayRef< uint8_t > buffer)
Find the lowest TSC in the given trace.
A class that represents a running process on the host machine.
This struct represents a continuous execution of a thread in a cpu, delimited by a context switch in ...
ThreadContinuousExecution thread_execution
IntelPTThreadContinousExecution(const ThreadContinuousExecution &thread_execution)
std::vector< PSBBlock > psb_blocks
bool operator<(const IntelPTThreadContinousExecution &o) const
Comparator by time.
This struct represents a contiguous section of a trace that starts at a PSB and ends right before the...
std::optional< uint64_t > tsc
The timestamp associated with the PSB packet above.
std::optional< lldb::addr_t > starting_ip
The first ip for this PSB block.
uint64_t psb_offset
The memory offset of a PSB packet that is a synchronization point for the decoder.
uint64_t size
Size in bytes of this block.
This class indicates the time interval in which a thread was running continuously on a cpu core.