From 1082c8ad116814e16113de9c4a7a067d3e5a0e5c Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sat, 21 May 2022 19:06:16 +0300 Subject: [PATCH] pps: print out message when we get the first counters Mostly for debug purposes, show the first visible counter timestamp. Signed-off-by: Lionel Landwerlin Reviewed-by: Emma Anholt Part-of: --- src/tool/pps/pps_datasource.cc | 6 ++++++ src/tool/pps/pps_datasource.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/tool/pps/pps_datasource.cc b/src/tool/pps/pps_datasource.cc index 088bc7ec975..c7bd4caba36 100644 --- a/src/tool/pps/pps_datasource.cc +++ b/src/tool/pps/pps_datasource.cc @@ -100,6 +100,7 @@ void GpuDataSource::OnStart(const StartArgs &args) driver->enable_perfcnt(time_to_sleep.count()); state = State::Start; + got_first_counters = false; { std::lock_guard lock(started_m); @@ -314,6 +315,11 @@ void GpuDataSource::trace(TraceContext &ctx) continue; } + if (!got_first_counters) { + PPS_LOG("Got first counters at gpu_ts=0x%016lx", gpu_timestamp); + got_first_counters = true; + } + auto packet = ctx.NewTracePacket(); packet->set_timestamp_clock_id(driver->gpu_clock_id()); packet->set_timestamp(gpu_timestamp); diff --git a/src/tool/pps/pps_datasource.h b/src/tool/pps/pps_datasource.h index f2946cbd6a5..51174a72a83 100644 --- a/src/tool/pps/pps_datasource.h +++ b/src/tool/pps/pps_datasource.h @@ -65,6 +65,9 @@ class GpuDataSource : public perfetto::DataSource