LLDB mainline
|
#include "LibiptDecoder.h"
#include "TraceIntelPT.h"
#include "lldb/Target/Process.h"
#include <optional>
Go to the source code of this file.
Classes | |
class | PSBBlockAnomalyDetector |
Class used to identify anomalies in traces, which should often indicate a fatal error in the trace. More... | |
class | PSBBlockDecoder |
Class that decodes a raw buffer for a single PSB block using the low level libipt library. More... | |
Typedefs | |
using | PtInsnDecoderUP = std::unique_ptr< pt_insn_decoder, decltype(InsnDecoderDeleter)> |
using | PtQueryDecoderUP = std::unique_ptr< pt_query_decoder, decltype(QueryDecoderDeleter)> |
Functions | |
bool | IsLibiptError (int status) |
bool | IsEndOfStream (int status) |
bool | HasEvents (int status) |
static Expected< pt_config > | CreateBasicLibiptConfig (TraceIntelPT &trace_intel_pt, ArrayRef< uint8_t > buffer) |
Create a basic configuration object limited to a given buffer that can be used for many different decoders. | |
static int | ReadProcessMemory (uint8_t *buffer, size_t size, const pt_asid *, uint64_t pc, void *context) |
Callback used by libipt for reading the process memory. | |
static Error | SetupMemoryImage (pt_insn_decoder *decoder, Process &process) |
Set up the memory image callback for the given decoder. | |
static Expected< PtInsnDecoderUP > | CreateInstructionDecoder (TraceIntelPT &trace_intel_pt, ArrayRef< uint8_t > buffer, Process &process) |
Create an instruction decoder for the given buffer and the given process. | |
static Expected< PtQueryDecoderUP > | CreateQueryDecoder (TraceIntelPT &trace_intel_pt, ArrayRef< uint8_t > buffer) |
Create a query decoder for the given buffer. | |
Variables | |
auto | InsnDecoderDeleter |
auto | QueryDecoderDeleter |
using PtInsnDecoderUP = std::unique_ptr<pt_insn_decoder, decltype(InsnDecoderDeleter)> |
Definition at line 40 of file LibiptDecoder.cpp.
using PtQueryDecoderUP = std::unique_ptr<pt_query_decoder, decltype(QueryDecoderDeleter)> |
Definition at line 43 of file LibiptDecoder.cpp.
|
static |
Create a basic configuration object limited to a given buffer that can be used for many different decoders.
Definition at line 48 of file LibiptDecoder.cpp.
References lldb_private::trace_intel_pt::TraceIntelPT::GetCPUInfo(), and IsLibiptError().
Referenced by CreateInstructionDecoder(), and CreateQueryDecoder().
|
static |
Create an instruction decoder for the given buffer and the given process.
Definition at line 97 of file LibiptDecoder.cpp.
References CreateBasicLibiptConfig(), InsnDecoderDeleter, and SetupMemoryImage().
Referenced by PSBBlockDecoder::Create().
|
static |
Create a query decoder for the given buffer.
The query decoder is the highest level decoder that operates directly on packets and doesn't perform actual instruction decoding. That's why it can be useful for inspecting a raw trace without pinning it to a particular process.
Definition at line 120 of file LibiptDecoder.cpp.
References CreateBasicLibiptConfig(), and QueryDecoderDeleter.
Referenced by lldb_private::trace_intel_pt::SplitTraceIntoPSBBlock().
bool HasEvents | ( | int | status | ) |
Definition at line 26 of file LibiptDecoder.cpp.
Referenced by PSBBlockDecoder::ProcessPTEvents(), and lldb_private::trace_intel_pt::SplitTraceIntoPSBBlock().
bool IsEndOfStream | ( | int | status | ) |
Definition at line 20 of file LibiptDecoder.cpp.
Referenced by PSBBlockDecoder::DecodeInstructionsAndEvents().
bool IsLibiptError | ( | int | status | ) |
Definition at line 18 of file LibiptDecoder.cpp.
Referenced by CreateBasicLibiptConfig(), PSBBlockDecoder::DecodeInstructionsAndEvents(), PSBBlockDecoder::ProcessPTEvents(), PSBBlockDecoder::ProcessPTEventTSC(), PSBBlockAnomalyDetector::RefreshPacketOffset(), SetupMemoryImage(), and lldb_private::trace_intel_pt::SplitTraceIntoPSBBlock().
|
static |
Callback used by libipt for reading the process memory.
More information can be found in https://github.com/intel/libipt/blob/master/doc/man/pt_image_set_callback.3.md
Definition at line 73 of file LibiptDecoder.cpp.
References error(), pc, and lldb_private::Process::ReadMemory().
Referenced by lldb_private::ProcessDebugger::ReadMemory(), and SetupMemoryImage().
Set up the memory image callback for the given decoder.
Definition at line 86 of file LibiptDecoder.cpp.
References IsLibiptError(), and ReadProcessMemory().
Referenced by CreateInstructionDecoder().
auto InsnDecoderDeleter |
Definition at line 32 of file LibiptDecoder.cpp.
Referenced by CreateInstructionDecoder().
auto QueryDecoderDeleter |
Definition at line 36 of file LibiptDecoder.cpp.
Referenced by CreateQueryDecoder().