linux-stable/tools
Zhengjun Xing 7f51f27345 perf jevents: Fix event syntax error caused by ExtSel
[ Upstream commit f4df0dbbe6 ]

In the origin code, when "ExtSel" is 1, the eventcode will change to
"eventcode |= 1 << 21”. For event “UNC_Q_RxL_CREDITS_CONSUMED_VN0.DRS",
its "ExtSel" is "1", its eventcode will change from 0x1E to 0x20001E,
but in fact the eventcode should <=0x1FF, so this will cause the parse
fail:

  # perf stat -e "UNC_Q_RxL_CREDITS_CONSUMED_VN0.DRS" -a sleep 0.1
  event syntax error: '.._RxL_CREDITS_CONSUMED_VN0.DRS'
                                    \___ value too big for format, maximum is 511

On the perf kernel side, the kernel assumes the valid bits are continuous.
It will adjust the 0x100 (bit 8 for perf tool) to bit 21 in HW.

DEFINE_UNCORE_FORMAT_ATTR(event_ext, event, "config:0-7,21");

So the perf tool follows the kernel side and just set bit8 other than bit21.

Fixes: fedb2b5182 ("perf jevents: Add support for parsing uncore json files")
Reviewed-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Xing Zhengjun <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@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220525140410.1706851-1-zhengjun.xing@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-14 18:11:44 +02:00
..
accounting tools/accounting/getdelays.c: fix netlink attribute length 2020-04-13 10:48:08 +02:00
arch x86: xen: insn: Decode Xen and KVM emulate-prefix signature 2022-05-15 19:54:47 +02:00
bpf bpftool: Remove inclusion of utilities.mak from Makefiles 2022-01-27 09:19:53 +01:00
build tools build: Use $(shell ) instead of `` to get embedded libperl's ccopts 2022-04-15 14:18:40 +02:00
cgroup iocost_monitor: drop string wrap around numbers when outputting json 2020-06-22 09:31:01 +02:00
debugging
firewire
firmware
gpio tools: gpio-hammer: Avoid potential overflow in main 2020-10-01 13:17:47 +02:00
hv - First round of vmbus hibernation support from Dexuan Cui. 2019-09-24 12:36:31 -07:00
iio
include bpf: Fix comment for helper bpf_current_task_under_cgroup() 2022-04-15 14:18:30 +02:00
io_uring tools/io_uring: fix compile breakage 2020-10-07 08:01:27 +02:00
kvm/kvm_stat tools/kvm_stat: Fix kvm_exit filter name 2020-02-11 04:35:36 -08:00
laptop
leds
lib libbpf: Skip forward declaration when counting duplicated type names 2022-04-15 14:18:14 +02:00
memory-model tools/memory-model: Fix data race detection for unordered store and load 2019-12-31 16:43:40 +01:00
nfsd
objtool x86/xen: Mark cpu_bringup_and_idle() as dead_end_function 2022-05-25 09:14:38 +02:00
pci tools: PCI: Fix fd leakage 2020-01-17 19:48:54 +01:00
pcmcia
perf perf jevents: Fix event syntax error caused by ExtSel 2022-06-14 18:11:44 +02:00
power tools/power turbostat: fix ICX DRAM power numbers 2022-06-14 18:11:25 +02:00
scripts tools: Allow proper CC/CXX/... override with LLVM=1 in Makefile.include 2021-07-31 08:19:37 +02:00
spi
testing selftests/bpf: fix btf_dump/btf_dump due to recent clang change 2022-06-14 18:11:29 +02:00
thermal/tmon tools/thermal/tmon: Add cross compiling support 2021-09-22 12:26:20 +02:00
time
usb usb: testusb: Fix for showing the connection speed 2021-10-09 14:39:49 +02:00
virtio tools/virtio: xen stub 2019-10-13 09:38:27 -04:00
vm tools/vm/page-types: remove dependency on opt_file for idle page tracking 2021-10-09 14:39:50 +02:00
wmi
Makefile