[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241217115610.371755-4-james.clark@linaro.org>
Date: Tue, 17 Dec 2024 11:56:06 +0000
From: James Clark <james.clark@...aro.org>
To: linux-arm-kernel@...ts.infradead.org,
linux-perf-users@...r.kernel.org
Cc: James Clark <james.clark@...aro.org>,
Will Deacon <will@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
"Liang, Kan" <kan.liang@...ux.intel.com>,
John Garry <john.g.garry@...cle.com>,
Mike Leach <mike.leach@...aro.org>,
Leo Yan <leo.yan@...ux.dev>,
Graham Woodward <graham.woodward@....com>,
linux-kernel@...r.kernel.org,
bpf@...r.kernel.org
Subject: [PATCH 3/5] perf tool: arm-spe: Don't allocate buffer or tracking event in discard mode
The buffer will never be written to so don't bother allocating it. The
tracking event is also not required.
Signed-off-by: James Clark <james.clark@...aro.org>
---
tools/perf/arch/arm64/util/arm-spe.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c
index 1b543855f206..4301181b8e45 100644
--- a/tools/perf/arch/arm64/util/arm-spe.c
+++ b/tools/perf/arch/arm64/util/arm-spe.c
@@ -376,7 +376,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
container_of(itr, struct arm_spe_recording, itr);
struct evsel *evsel, *tmp;
struct perf_cpu_map *cpus = evlist->core.user_requested_cpus;
-
+ bool discard = false;
int err;
sper->evlist = evlist;
@@ -396,10 +396,17 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
return 0;
evlist__for_each_entry_safe(evlist, tmp, evsel) {
- if (evsel__is_aux_event(evsel))
+ if (evsel__is_aux_event(evsel)) {
arm_spe_setup_evsel(evsel, cpus);
+ if (evsel->core.attr.config &
+ perf_pmu__format_bits(evsel->pmu, "discard"))
+ discard = true;
+ }
}
+ if (discard)
+ return 0;
+
err = arm_spe_setup_aux_buffer(opts);
if (err)
return err;
--
2.34.1
Powered by blists - more mailing lists