From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id C4F9A10E735 for ; Mon, 10 Oct 2022 21:42:21 +0000 (UTC) From: Umesh Nerlige Ramappa To: igt-dev@lists.freedesktop.org, Lionel G Landwerlin , Ashutosh Dixit Date: Mon, 10 Oct 2022 21:42:04 +0000 Message-Id: <20221010214215.5378-26-umesh.nerlige.ramappa@intel.com> In-Reply-To: <20221010214215.5378-1-umesh.nerlige.ramappa@intel.com> References: <20221010214215.5378-1-umesh.nerlige.ramappa@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t v6 25/36] tools/i915-perf: printout CPU clock used List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: From: Lionel Landwerlin Signed-off-by: Lionel Landwerlin --- tools/i915-perf/i915_perf_recorder.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/i915-perf/i915_perf_recorder.c b/tools/i915-perf/i915_perf_recorder.c index 72011c87..f8f9b737 100644 --- a/tools/i915-perf/i915_perf_recorder.c +++ b/tools/i915-perf/i915_perf_recorder.c @@ -588,6 +588,17 @@ static uint64_t timespec_diff(struct timespec *begin, static clock_t correlation_clock_id = CLOCK_MONOTONIC; +static const char * +get_correlation_clock_name(clock_t clock_id) +{ + switch (clock_id) { + case CLOCK_BOOTTIME: return "bootime"; + case CLOCK_MONOTONIC: return "monotonic"; + case CLOCK_MONOTONIC_RAW: return "monotonic_raw"; + default: return "*unknown*"; + } +} + static bool get_correlation_timestamps(struct intel_perf_record_timestamp_correlation *corr, int drm_fd) { @@ -1069,6 +1080,9 @@ main(int argc, char *argv[]) goto fail; } + fprintf(stdout, "Using correlation clock: %s\n", + get_correlation_clock_name(correlation_clock_id)); + ctx.oa_exponent = oa_exponent_for_period(ctx.oa_timestamp_frequency, perf_period); fprintf(stdout, "Opening perf stream with metric_id=%"PRIu64" oa_exponent=%u oa_format=%u\n", ctx.metric_set->perf_oa_metrics_set, ctx.oa_exponent, -- 2.25.1