Skip to content

Commit 9c3164e

Browse files
james-c-linaroacmel
authored andcommitted
perf tools 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. Reviewed-by: Yeoreum Yun <[email protected]> Signed-off-by: James Clark <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Athira Rajeev <[email protected]> Cc: Graham Woodward <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: John Garry <[email protected]> Cc: Kan Liang <[email protected]> Cc: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Michael Petlan <[email protected]> Cc: Mike Leach <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rob Herring <[email protected]> Cc: Thomas Richter <[email protected]> Cc: Veronika Molnarova <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 23a65c5 commit 9c3164e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tools/perf/arch/arm64/util/arm-spe.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
376376
container_of(itr, struct arm_spe_recording, itr);
377377
struct evsel *evsel, *tmp;
378378
struct perf_cpu_map *cpus = evlist->core.user_requested_cpus;
379-
379+
bool discard = false;
380380
int err;
381381

382382
sper->evlist = evlist;
@@ -396,10 +396,17 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
396396
return 0;
397397

398398
evlist__for_each_entry_safe(evlist, tmp, evsel) {
399-
if (evsel__is_aux_event(evsel))
399+
if (evsel__is_aux_event(evsel)) {
400400
arm_spe_setup_evsel(evsel, cpus);
401+
if (evsel->core.attr.config &
402+
perf_pmu__format_bits(evsel->pmu, "discard"))
403+
discard = true;
404+
}
401405
}
402406

407+
if (discard)
408+
return 0;
409+
403410
err = arm_spe_setup_aux_buffer(opts);
404411
if (err)
405412
return err;

0 commit comments

Comments
 (0)