Skip to contentSkip to conversation

perf arm-spe: Use advertised caps/min_interval as default sample_period

PATCH Applied German Gomez 3 participants 3 messages Feb 21, 2022 – Feb 23, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf arm-spe: Use advertised caps/min_interval as default sample_period

When recording SPE traces, the default sample_period is currently being set to 1 in the perf_event_attr fields, instead of the value advertised in '/sys/devices/arm_spe_0/caps/min_interval':

Before:

$ perf record -e arm_spe// -vv -- sleep 1
[...]
  { sample_period, sample_freq }   1
[...]

Use the value from the above sysfs location as a more sensible default (it was already being read, but the value not being used)

After:

$ perf record -e arm_spe// -vv -- sleep 1
[...]
  { sample_period, sample_freq }   1024
[...]
---
 tools/perf/arch/arm64/util/arm-spe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/arch/arm64/util/arm-spe.c +1 -1
index 2100d46cc..5860bbaea 100644
@@ -158,7 +158,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
 				return -EINVAL;
 			}
 			evsel->core.attr.freq = 0;
-			evsel->core.attr.sample_period = 1;
+			evsel->core.attr.sample_period = arm_spe_pmu->default_config->sample_period;
 			arm_spe_evsel = evsel;
 			opts->full_auxtrace = true;
 		}
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · German Gomez

When recording SPE traces, the default sample_period is currently being set to 1 in the perf_event_attr fields, instead of the value advertised in '/sys/devices/arm_spe_0/caps/min_interval':

Before:

$ perf record -e arm_spe// -vv -- sleep 1
[...]
  { sample_period, sample_freq }   1
[...]

Use the value from the above sysfs location as a more sensible default (it was already being read, but the value not being used)

Quoted 8 lines

After:

$ perf record -e arm_spe// -vv -- sleep 1
[...]
  { sample_period, sample_freq }   1024
[...]

The change looks good to me:

maintainer Applied
#2 lore raw

Em Wed, Feb 23, 2022 at 09:14:36AM +0800, Leo Yan escreveu:

Quoted 22 lines · German Gomez
Quoted 21 lines

When recording SPE traces, the default sample_period is currently being set to 1 in the perf_event_attr fields, instead of the value advertised in '/sys/devices/arm_spe_0/caps/min_interval':

Before:

$ perf record -e arm_spe// -vv -- sleep 1
[...]
  { sample_period, sample_freq }   1
[...]

Use the value from the above sysfs location as a more sensible default (it was already being read, but the value not being used)

After:

$ perf record -e arm_spe// -vv -- sleep 1
[...]
  { sample_period, sample_freq }   1024
[...]
Quoted 5 lines
Quoted 1 line

The change looks good to me:

Thanks, applied.

- Arnaldo