From: James Clark Date: Mon, 8 Sep 2025 12:10:18 +0000 (+0100) Subject: perf arm-spe: Show instruction sample types by default X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=80a2d7ea487d9b31d9b78d551aba3bd57642ce97;p=users%2Fhch%2Fmisc.git perf arm-spe: Show instruction sample types by default Instruction sample types are enabled in the default itrace options in perf, but this never applied to SPE because the default nanoseconds period isn't supported. This meant that instructions ended up being opt-in by the user only when they requested an instruction based period. Change the default period type to instructions so that instruction samples are generated by default. This can overridden by specifying any --itrace option. This solves a common complaint from users that the unfiltered SPE samples appear to be missing, and only the samples that have memory flags set appear in the various memory groups. Signed-off-by: James Clark Tested-by: Leo Yan Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ben Gainey Cc: George Wort Cc: Graham Woodward Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Michael Williams Cc: Mike Leach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Will Deacon Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 8942fa598a84..b33a0a170ef8 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -1871,10 +1871,14 @@ int arm_spe_process_auxtrace_info(union perf_event *event, if (dump_trace) return 0; - if (session->itrace_synth_opts && session->itrace_synth_opts->set) + if (session->itrace_synth_opts && session->itrace_synth_opts->set) { spe->synth_opts = *session->itrace_synth_opts; - else + } else { itrace_synth_opts__set_default(&spe->synth_opts, false); + /* Default nanoseconds period not supported */ + spe->synth_opts.period_type = PERF_ITRACE_PERIOD_INSTRUCTIONS; + spe->synth_opts.period = 1; + } err = arm_spe_synth_events(spe, session); if (err)