9#ifndef LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACECURSORINTELPT_H
10#define LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACECURSORINTELPT_H
16namespace trace_intel_pt {
22 const std::optional<LinuxPerfZeroTscConversion> &tsc_conversion,
23 std::optional<uint64_t> beginning_of_time_nanos);
31 llvm::StringRef
GetError()
const override;
39 std::optional<uint64_t>
GetHWClock()
const override;
59 const std::optional<DecodedThread::TSCRange> &
GetTSCRange()
const;
62 const std::optional<DecodedThread::NanosecondsRange> &
Class used for iterating over the instructions of a thread's trace, among other kinds of information.
void ClearTimingRangesIfInvalid()
Clear the current TSC and nanoseconds ranges if after moving they are not valid anymore.
std::optional< uint64_t > GetHWClock() const override
Get the last hardware clock value that was emitted before the current trace item.
lldb::TraceItemKind GetItemKind() const override
Trace item information (instructions, errors and events)
std::optional< DecodedThread::TSCRange > m_tsc_range
Range of trace items with the same TSC that includes the current trace item, std::nullopt if not calc...
std::optional< double > GetWallClockTime() const override
Get the approximate wall clock time in nanoseconds at which the current trace item was executed.
std::optional< std::string > GetSyncPointMetadata() const override
Get some metadata associated with a synchronization point event.
bool HasValue() const override
const std::optional< DecodedThread::NanosecondsRange > & GetNanosecondsRange() const
Get or calculate the TSC range that includes the current trace item.
lldb::TraceEvent GetEventType() const override
lldb::addr_t GetLoadAddress() const override
lldb::cpu_id_t GetCPU() const override
Get the CPU associated with the current trace item.
void Next() override
Move the cursor to the next item (instruction or error).
bool m_tsc_range_calculated
llvm::StringRef GetError() const override
std::optional< LinuxPerfZeroTscConversion > m_tsc_conversion
Timing information and cached values.
DecodedThreadSP m_decoded_thread_sp
Storage of the actual instructions.
bool m_nanoseconds_range_calculated
int64_t m_pos
Internal instruction index currently pointing at.
std::optional< uint64_t > m_beginning_of_time_nanos
Lowest nanoseconds timestamp seen in any thread trace, std::nullopt if not available at all.
std::optional< DecodedThread::NanosecondsRange > m_nanoseconds_range
Range of trace items with the same non-interpolated timestamps in nanoseconds that includes the curre...
bool GoToId(lldb::user_id_t id) override
Instruction identifiers:
bool Seek(int64_t offset, lldb::TraceCursorSeekType origin) override
Make the cursor point to an item in the trace based on an origin point and an offset.
const std::optional< DecodedThread::TSCRange > & GetTSCRange() const
Get or calculate the TSC range that includes the current trace item.
bool HasId(lldb::user_id_t id) const override
lldb::user_id_t GetId() const override
std::shared_ptr< DecodedThread > DecodedThreadSP
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Thread > ThreadSP
TraceEvent
Events that might happen during a trace session.
TraceCursorSeekType
Enum to indicate the reference point when invoking TraceCursor::Seek().