[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20240809121447.2078084-9-leo.yan@arm.com>
Date: Fri, 9 Aug 2024 13:14:47 +0100
From: Leo Yan <leo.yan@....com>
To: Peter Zijlstra <peterz@...radead.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
"Liang, Kan" <kan.liang@...ux.intel.com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Mike Leach <mike.leach@...aro.org>,
James Clark <james.clark@...aro.org>,
linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org,
coresight@...ts.linaro.org,
linux-arm-kernel@...ts.infradead.org
Cc: Leo Yan <leo.yan@....com>
Subject: [PATCH v4 8/8] perf arm-spe: Support multiple events in arm_spe_evsel_is_auxtrace()
The 'pmu_type' field is an unique value and cannot support multiple PMU
events.
The arm_spe_evsel_is_auxtrace() function changes to compare PMU name to
decide if it is a Arm SPE event. This leads to the 'pmu_type' field is
no longer used, remove it.
Signed-off-by: Leo Yan <leo.yan@....com>
---
tools/perf/util/arm-spe.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c
index afbd5869f6bf..7c27d5179470 100644
--- a/tools/perf/util/arm-spe.c
+++ b/tools/perf/util/arm-spe.c
@@ -11,6 +11,7 @@
#include <linux/bitops.h>
#include <linux/kernel.h>
#include <linux/log2.h>
+#include <linux/string.h>
#include <linux/types.h>
#include <linux/zalloc.h>
#include <stdlib.h>
@@ -45,7 +46,6 @@ struct arm_spe {
u32 auxtrace_type;
struct perf_session *session;
struct machine *machine;
- u32 pmu_type;
u64 midr;
struct perf_tsc_conversion tc;
@@ -1053,12 +1053,10 @@ static void arm_spe_free(struct perf_session *session)
free(spe);
}
-static bool arm_spe_evsel_is_auxtrace(struct perf_session *session,
+static bool arm_spe_evsel_is_auxtrace(struct perf_session *session __maybe_unused,
struct evsel *evsel)
{
- struct arm_spe *spe = container_of(session->auxtrace, struct arm_spe, auxtrace);
-
- return evsel->core.attr.type == spe->pmu_type;
+ return strstarts(evsel->pmu_name, ARM_SPE_PMU_NAME);
}
static const char * const arm_spe_info_fmts[] = {
@@ -1128,7 +1126,7 @@ arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session)
int err;
evlist__for_each_entry(evlist, evsel) {
- if (evsel->core.attr.type == spe->pmu_type) {
+ if (arm_spe_evsel_is_auxtrace(session, evsel)) {
found = true;
break;
}
@@ -1313,7 +1311,6 @@ int arm_spe_process_auxtrace_info(union perf_event *event,
spe->session = session;
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->midr = midr;
spe->timeless_decoding = arm_spe__is_timeless_decoding(spe);
--
2.34.1
Powered by blists - more mailing lists