Files
TheRock/compiler/amd-llvm/lldb/source/Plugins/Trace/intel-pt/TraceCursorIntelPT.h
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

94 lines
3.2 KiB
C++

//===-- TraceCursorIntelPT.h ------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACECURSORINTELPT_H
#define LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACECURSORINTELPT_H
#include "ThreadDecoder.h"
#include <optional>
namespace lldb_private {
namespace trace_intel_pt {
class TraceCursorIntelPT : public TraceCursor {
public:
TraceCursorIntelPT(
lldb::ThreadSP thread_sp, DecodedThreadSP decoded_thread_sp,
const std::optional<LinuxPerfZeroTscConversion> &tsc_conversion,
std::optional<uint64_t> beginning_of_time_nanos);
bool Seek(int64_t offset, lldb::TraceCursorSeekType origin) override;
void Next() override;
bool HasValue() const override;
llvm::StringRef GetError() const override;
lldb::addr_t GetLoadAddress() const override;
lldb::TraceEvent GetEventType() const override;
lldb::cpu_id_t GetCPU() const override;
std::optional<uint64_t> GetHWClock() const override;
lldb::TraceItemKind GetItemKind() const override;
bool GoToId(lldb::user_id_t id) override;
lldb::user_id_t GetId() const override;
bool HasId(lldb::user_id_t id) const override;
std::optional<double> GetWallClockTime() const override;
std::optional<std::string> GetSyncPointMetadata() const override;
private:
/// Clear the current TSC and nanoseconds ranges if after moving they are not
/// valid anymore.
void ClearTimingRangesIfInvalid();
/// Get or calculate the TSC range that includes the current trace item.
const std::optional<DecodedThread::TSCRange> &GetTSCRange() const;
/// Get or calculate the TSC range that includes the current trace item.
const std::optional<DecodedThread::NanosecondsRange> &
GetNanosecondsRange() const;
/// Storage of the actual instructions
DecodedThreadSP m_decoded_thread_sp;
/// Internal instruction index currently pointing at.
int64_t m_pos;
/// Timing information and cached values.
/// \{
/// TSC -> nanos conversion utility. \a std::nullopt if not available at all.
std::optional<LinuxPerfZeroTscConversion> m_tsc_conversion;
/// Lowest nanoseconds timestamp seen in any thread trace, \a std::nullopt if
/// not available at all.
std::optional<uint64_t> m_beginning_of_time_nanos;
/// Range of trace items with the same TSC that includes the current trace
/// item, \a std::nullopt if not calculated or not available.
std::optional<DecodedThread::TSCRange> mutable m_tsc_range;
bool mutable m_tsc_range_calculated = false;
/// Range of trace items with the same non-interpolated timestamps in
/// nanoseconds that includes the current trace item, \a std::nullopt if not
/// calculated or not available.
std::optional<DecodedThread::NanosecondsRange> mutable m_nanoseconds_range;
bool mutable m_nanoseconds_range_calculated = false;
/// \}
};
} // namespace trace_intel_pt
} // namespace lldb_private
#endif // LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_TRACECURSORINTELPT_H