[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201221083557.27642-4-leo.yan@linaro.org>
Date: Mon, 21 Dec 2020 16:35:53 +0800
From: Leo Yan <leo.yan@...aro.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>,
John Garry <john.garry@...wei.com>,
Will Deacon <will@...nel.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Ian Rogers <irogers@...gle.com>,
James Clark <james.clark@....com>,
Dave Martin <Dave.Martin@....com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Leo Yan <leo.yan@...aro.org>
Subject: [PATCH v1 3/7] perf arm-spe: Dump TSC parameters
The TSC parameters are stored in auxtrace info, this patch dumps these
parameters for reporting the raw data.
Signed-off-by: Leo Yan <leo.yan@...aro.org>
---
tools/perf/util/arm-spe.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c
index 8901a1656a41..a504ceec2de6 100644
--- a/tools/perf/util/arm-spe.c
+++ b/tools/perf/util/arm-spe.c
@@ -26,6 +26,7 @@
#include "symbol.h"
#include "thread.h"
#include "thread-stack.h"
+#include "tsc.h"
#include "tool.h"
#include "util/synthetic-events.h"
@@ -45,6 +46,8 @@ struct arm_spe {
struct machine *machine;
u32 pmu_type;
+ struct perf_tsc_conversion tc;
+
u8 timeless_decoding;
u8 data_queued;
@@ -722,14 +725,23 @@ static bool arm_spe_evsel_is_auxtrace(struct perf_session *session,
static const char * const arm_spe_info_fmts[] = {
[ARM_SPE_PMU_TYPE] = " PMU Type %"PRId64"\n",
+ [ARM_SPE_TIME_SHIFT] = " Time Shift %"PRIu64"\n",
+ [ARM_SPE_TIME_MULT] = " Time Muliplier %"PRIu64"\n",
+ [ARM_SPE_TIME_ZERO] = " Time Zero %"PRIu64"\n",
+ [ARM_SPE_TIME_CYCLES] = " Time Cycles %"PRIu64"\n",
+ [ARM_SPE_TIME_MASK] = " Time Mask %#"PRIx64"\n",
+ [ARM_SPE_CAP_USER_TIME_SHORT] = " Cap Time Short %"PRId64"\n",
};
static void arm_spe_print_info(__u64 *arr)
{
+ int i;
+
if (!dump_trace)
return;
- fprintf(stdout, arm_spe_info_fmts[ARM_SPE_PMU_TYPE], arr[ARM_SPE_PMU_TYPE]);
+ for (i = 0; i < ARM_SPE_AUXTRACE_PRIV_MAX; i++)
+ fprintf(stdout, arm_spe_info_fmts[i], arr[i]);
}
struct arm_spe_synth {
@@ -934,6 +946,12 @@ int arm_spe_process_auxtrace_info(union perf_event *event,
spe->machine = &session->machines.host; /* No kvm support */
spe->auxtrace_type = auxtrace_info->type;
spe->pmu_type = auxtrace_info->priv[ARM_SPE_PMU_TYPE];
+ spe->tc.time_shift = auxtrace_info->priv[ARM_SPE_TIME_SHIFT];
+ spe->tc.time_mult = auxtrace_info->priv[ARM_SPE_TIME_MULT];
+ spe->tc.time_zero = auxtrace_info->priv[ARM_SPE_TIME_ZERO];
+ spe->tc.time_cycles = auxtrace_info->priv[ARM_SPE_TIME_CYCLES];
+ spe->tc.time_mask = auxtrace_info->priv[ARM_SPE_TIME_MASK];
+ spe->tc.cap_user_time_short = auxtrace_info->priv[ARM_SPE_CAP_USER_TIME_SHORT];
spe->timeless_decoding = arm_spe__is_timeless_decoding(spe);
spe->auxtrace.process_event = arm_spe_process_event;
--
2.17.1
Powered by blists - more mailing lists