linux-stable/tools
James Clark f7e36d02d7 libperf: evlist: Fix --cpu argument on hybrid platform
Since the linked fixes: commit, specifying a CPU on hybrid platforms
results in an error because Perf tries to open an extended type event
on "any" CPU which isn't valid. Extended type events can only be opened
on CPUs that match the type.

Before (working):

  $ perf record --cpu 1 -- true
  [ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 2.385 MB perf.data (7 samples) ]

After (not working):

  $ perf record -C 1 -- true
  WARNING: A requested CPU in '1' is not supported by PMU 'cpu_atom' (CPUs 16-27) for event 'cycles:P'
  Error:
  The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (cpu_atom/cycles:P/).
  /bin/dmesg | grep -i perf may provide additional information.

(Ignore the warning message, that's expected and not particularly
relevant to this issue).

This is because perf_cpu_map__intersect() of the user specified CPU (1)
and one of the PMU's CPUs (16-27) correctly results in an empty (NULL)
CPU map. However for the purposes of opening an event, libperf converts
empty CPU maps into an any CPU (-1) which the kernel rejects.

Fix it by deleting evsels with empty CPU maps in the specific case where
user requested CPU maps are evaluated.

Fixes: 251aa04024 ("perf parse-events: Wildcard most "numeric" events")
Reviewed-by: Ian Rogers <irogers@google.com>
Tested-by: Thomas Falcon <thomas.falcon@intel.com>
Signed-off-by: James Clark <james.clark@linaro.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: https://lore.kernel.org/r/20241114160450.295844-2-james.clark@linaro.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
2024-12-11 09:19:44 -08:00
..
accounting
arch tools headers: Sync arm64 kvm header with the kernel sources 2024-12-04 14:34:49 -08:00
bootconfig
bpf - The series "resource: A couple of cleanups" from Andy Shevchenko 2024-11-25 16:09:48 -08:00
build perf tools changes for v6.13 2024-11-26 14:54:00 -08:00
certs
cgroup
counter
crypto crypto: tools/ccp - Remove unused variable 2024-08-30 18:22:30 +08:00
debugging
firewire tools/firewire: Fix several incorrect format specifiers 2024-11-14 09:12:04 +09:00
firmware
gpio tools: gpio: Fix several incorrect format specifiers 2024-11-13 16:30:05 +01:00
hv hyperv-next for v6.12 2024-09-19 08:15:30 +02:00
iio iio: Add channel type for attention 2024-11-03 20:33:43 +00:00
include tools headers: Sync uapi/asm-generic/mman.h with the kernel sources 2024-12-04 14:34:50 -08:00
kvm/kvm_stat
laptop
leds
lib libperf: evlist: Fix --cpu argument on hybrid platform 2024-12-11 09:19:44 -08:00
memory-model tools/memory-model: simple.txt: Fix stale reference to recipes-pairs.txt 2024-09-13 23:56:44 -07:00
mm - The series "zram: optimal post-processing target selection" from 2024-11-23 09:58:07 -08:00
net NFSD 6.13 Release Notes 2024-11-26 12:59:30 -08:00
objtool Kbuild updates for v6.13 2024-11-30 13:41:50 -08:00
pci tools: PCI: Fix incorrect printf format specifiers 2024-11-20 14:20:51 -06:00
pcmcia
perf perf test expr: Fix system_tsc_freq for only x86 2024-12-11 09:19:44 -08:00
power turbostat version 2024.11.30 2024-11-30 18:30:22 -08:00
rcu tools/rcu: Remove RCU Tasks Rude asynchronous APIs from rcu-updaters.sh 2024-07-29 07:39:32 +05:30
sched_ext sched_ext: Rename scx_bpf_dispatch[_vtime]_from_dsq*() -> scx_bpf_dsq_move[_vtime]*() 2024-11-11 07:06:16 -10:00
scripts
sound ASoC: dapm-graph: show path name for non-static routes 2024-08-23 11:03:00 +01:00
spi spi: spidev_test: add support for word delay 2024-11-07 15:25:50 +00:00
testing ARM: 2024-11-30 14:51:08 -08:00
thermal tools/thermal: Fix common realloc mistake 2024-11-15 14:29:03 +01:00
time
tracing tracing/tools: Updates for 6.13 2024-11-22 13:24:22 -08:00
usb usbip: tools: Fix detach_port() invalid port error path 2024-10-29 04:23:23 +01:00
verification verification/dot2: Improve dot parser robustness 2024-11-19 08:57:13 -05:00
virtio Fix typo in vringh_test.c 2024-11-06 04:40:07 -05:00
wmi
workqueue
writeback
Makefile sched_ext: Add scx_simple and scx_example_qmap example schedulers 2024-06-18 10:09:17 -10:00