1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/tools/perf/arch/x86/util
Zhengjun Xing 151e7d7503 perf record: Support sample-read topdown metric group for hybrid platforms
With the hardware TopDown metrics feature, the sample-read feature should
be supported for a TopDown group, e.g., sample a non-topdown event and read
a Topdown metric group. But the current perf record code errors are out.

For a TopDown metric group,the slots event must be the leader of the group,
but the leader slots event doesn't support sampling. To support sample-read
the TopDown metric group, uses the 2nd event of the group as the "leader"
for the purposes of sampling.

Only the platform with the TopDown metric feature supports sample-read the
topdown group. In commit acb65150a4 ("perf record: Support sample-read
topdown metric group"), it adds arch_topdown_sample_read() to indicate
whether the TopDown group supports sample-read, it should only work on the
non-hybrid systems, this patch extends the support for hybrid platforms.

Before:

  # ./perf record -e "{cpu_core/slots/,cpu_core/cycles/,cpu_core/topdown-retiring/}:S" -a sleep 1
  Error:
  The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (cpu_core/topdown-retiring/).
  /bin/dmesg | grep -i perf may provide additional information.

After:

  # ./perf record -e "{cpu_core/slots/,cpu_core/cycles/,cpu_core/topdown-retiring/}:S" -a sleep 1
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 0.238 MB perf.data (369 samples) ]

Fixes: acb65150a4 ("perf record: Support sample-read topdown metric group")
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Zhengjun Xing <zhengjun.xing@linux.intel.com>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220602153603.1884710-1-zhengjun.xing@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2022-06-03 21:30:10 +02:00
..
archinsn.c tools/perf: Convert to insn_decode() 2021-03-15 12:41:26 +01:00
auxtrace.c tools: Fix off-by 1 relative directory includes 2020-03-06 08:36:46 -03:00
Build perf stat: Enable iostat mode for x86 platforms 2021-04-20 08:40:20 -03:00
dwarf-regs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
event.c perf maps: Use a pointer for kmaps 2022-02-14 16:47:13 -03:00
evlist.c perf parse-events: Move slots event for the hybrid platform too 2022-05-20 11:13:37 -03:00
evsel.c perf record: Support sample-read topdown metric group for hybrid platforms 2022-06-03 21:30:10 +02:00
evsel.h perf record: Support sample-read topdown metric group for hybrid platforms 2022-06-03 21:30:10 +02:00
header.c tools: Fix off-by 1 relative directory includes 2020-03-06 08:36:46 -03:00
intel-bts.c perf auxtrace: Record whether an auxtrace mmap is needed 2022-05-10 14:27:19 -03:00
intel-pt.c perf intel-pt: Track sideband system-wide when needed 2022-05-26 12:36:57 -03:00
iostat.c perf iostat: Fix Segmentation fault from NULL 'struct perf_counts_values *' 2021-09-27 09:41:07 -03:00
kvm-stat.c perf x86 kvm-stat: Support to analyze kvm MSR 2021-05-12 12:43:12 -03:00
machine.c tools: Fix off-by 1 relative directory includes 2020-03-06 08:36:46 -03:00
mem-events.c perf tools: Support pmu prefix for mem-store event 2021-06-01 11:04:05 -03:00
perf_regs.c perf regs x86: Fix arch__intr_reg_mask() for the hybrid platform 2022-05-21 14:45:19 -03:00
pmu.c perf pmu: Add PMU alias support 2021-09-03 08:33:26 -03:00
topdown.c perf record: Support sample-read topdown metric group for hybrid platforms 2022-06-03 21:30:10 +02:00
topdown.h perf parse-events: Move slots event for the hybrid platform too 2022-05-20 11:13:37 -03:00
tsc.c perf tsc: Move out common functions from x86 2020-09-22 13:38:33 -03:00
unwind-libdw.c perf libdw: Fix off-by 1 relative directory includes 2020-06-01 12:24:23 -03:00
unwind-libunwind.c perf unwind: Fix libunwind build failure on i386 systems 2019-09-26 21:59:38 +02:00