LLDB mainline
PSBBlockAnomalyDetector Class Reference

Class used to identify anomalies in traces, which should often indicate a fatal error in the trace. More...

Public Member Functions

 PSBBlockAnomalyDetector (pt_insn_decoder &decoder, TraceIntelPT &trace_intel_pt, DecodedThread &decoded_thread)
Error DetectAnomaly ()

Private Member Functions

std::optional< uint64_t > TryIdentifyInfiniteLoop ()
void RefreshPacketOffset ()

Private Attributes

pt_insn_decoder & m_decoder
DecodedThreadm_decoded_thread
lldb::addr_t m_last_packet_offset = LLDB_INVALID_ADDRESS
uint64_t m_insn_count_at_last_packet_offset = 0
uint64_t m_infinite_decoding_loop_threshold
uint64_t m_next_infinite_decoding_loop_threshold
uint64_t m_extremely_large_decoding_threshold

Detailed Description

Class used to identify anomalies in traces, which should often indicate a fatal error in the trace.

Definition at line 134 of file LibiptDecoder.cpp.

Constructor & Destructor Documentation

◆ PSBBlockAnomalyDetector()

PSBBlockAnomalyDetector::PSBBlockAnomalyDetector ( pt_insn_decoder & decoder,
TraceIntelPT & trace_intel_pt,
DecodedThread & decoded_thread )
inline

Member Function Documentation

◆ DetectAnomaly()

Error PSBBlockAnomalyDetector::DetectAnomaly ( )
inline
Returns
An llvm::Error if an anomaly that includes the last instruction item in the trace, or llvm::Error::success otherwise.

Definition at line 153 of file LibiptDecoder.cpp.

References createStringError(), m_decoded_thread, m_extremely_large_decoding_threshold, m_insn_count_at_last_packet_offset, m_next_infinite_decoding_loop_threshold, RefreshPacketOffset(), and TryIdentifyInfiniteLoop().

◆ RefreshPacketOffset()

void PSBBlockAnomalyDetector::RefreshPacketOffset ( )
inlineprivate

◆ TryIdentifyInfiniteLoop()

std::optional< uint64_t > PSBBlockAnomalyDetector::TryIdentifyInfiniteLoop ( )
inlineprivate

Definition at line 213 of file LibiptDecoder.cpp.

References lldb::eTraceItemKindInstruction, and m_decoded_thread.

Referenced by DetectAnomaly().

Member Data Documentation

◆ m_decoded_thread

DecodedThread& PSBBlockAnomalyDetector::m_decoded_thread
private

◆ m_decoder

pt_insn_decoder& PSBBlockAnomalyDetector::m_decoder
private

Definition at line 300 of file LibiptDecoder.cpp.

Referenced by PSBBlockAnomalyDetector(), and RefreshPacketOffset().

◆ m_extremely_large_decoding_threshold

uint64_t PSBBlockAnomalyDetector::m_extremely_large_decoding_threshold
private

Definition at line 306 of file LibiptDecoder.cpp.

Referenced by DetectAnomaly(), and PSBBlockAnomalyDetector().

◆ m_infinite_decoding_loop_threshold

uint64_t PSBBlockAnomalyDetector::m_infinite_decoding_loop_threshold
private

Definition at line 304 of file LibiptDecoder.cpp.

Referenced by PSBBlockAnomalyDetector(), and RefreshPacketOffset().

◆ m_insn_count_at_last_packet_offset

uint64_t PSBBlockAnomalyDetector::m_insn_count_at_last_packet_offset = 0
private

Definition at line 303 of file LibiptDecoder.cpp.

Referenced by DetectAnomaly(), and RefreshPacketOffset().

◆ m_last_packet_offset

lldb::addr_t PSBBlockAnomalyDetector::m_last_packet_offset = LLDB_INVALID_ADDRESS
private

Definition at line 302 of file LibiptDecoder.cpp.

Referenced by RefreshPacketOffset().

◆ m_next_infinite_decoding_loop_threshold

uint64_t PSBBlockAnomalyDetector::m_next_infinite_decoding_loop_threshold
private

Definition at line 305 of file LibiptDecoder.cpp.

Referenced by DetectAnomaly(), PSBBlockAnomalyDetector(), and RefreshPacketOffset().


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