Files
Linux/tools/perf/util
Mark Rutland 66ec11919a perf pmu: Unbreak perf record for arm/arm64 with events with explicit PMU
Currently, perf record is broken on arm/arm64 systems when the PMU is
specified explicitly as part of the event, e.g.

$ ./perf record -e armv8_cortex_a53/cpu_cycles/u true

In such cases, perf record fails to open events unless
perf_event_paranoid is set to -1, even if the PMU in question supports
mode exclusion. Further, even when perf_event_paranoid is toggled, no
samples are recorded.

This is an unintended side effect of commit:

  e3ba76deef ("perf tools: Force uncore events to system wide monitoring)

... which assumes that if a PMU has an associated cpu_map, it is an
uncore PMU, and forces events for such PMUs to be system-wide.

This is not true for arm/arm64 systems, which can have heterogeneous
CPUs. To account for this, multiple CPU PMUs are exposed, each with a
"cpus" field under sysfs, which the perf tool parses into a cpu_map. ARM
PMUs do not have a "cpumask" file, and only have a "cpus" file. For the
gory details as to why, see commit:

 7e3fcffe95 ("perf pmu: Support alternative sysfs cpumask")

Given all of this, we can instead identify uncore PMUs by explicitly
checking for a "cpumask" file, and restore arm/arm64 PMU support back to
a working state. This patch does so, adding a new perf_pmu::is_uncore
field, and splitting the existing cpumask parsing so that it can be
reused.

Signed-off-by: Mark Rutland <[email protected]>
Tested-by Will Deacon <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: 4.12+ <[email protected]>
Fixes: e3ba76deef ("perf tools: Force uncore events to system wide monitoring)
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
2017-10-09 15:48:46 -03:00
..
2017-07-25 11:23:50 -03:00
2017-04-24 13:43:32 -03:00
…
2016-06-28 10:54:56 -03:00
…
2017-07-18 23:14:11 -03:00
2017-07-18 23:14:11 -03:00
2017-04-19 13:01:51 -03:00
…
…
2016-10-24 11:07:39 -03:00
…
…
…
…
2016-07-12 15:19:55 -03:00
…
…
2017-07-18 23:14:08 -03:00
2017-07-26 14:21:59 -03:00
2017-07-26 14:21:59 -03:00
2016-08-23 15:37:33 -03:00
…
…
…
…
…
…
2017-06-27 11:49:13 -03:00
…
2017-08-22 11:51:28 -03:00
2017-08-22 11:51:28 -03:00