linux-stable/tools
Sandipan Das 5e4c58a31c perf vendor events amd: Fix Zen 4 cache latency events
[ Upstream commit 498d348637 ]

L3PMCx0AC and L3PMCx0AD, used in l3_xi_sampled_latency* events, have a
quirk that requires them to be programmed with SliceId set to 0x3.
Without this, the events do not count at all and affects dependent
metrics such as l3_read_miss_latency.

If ThreadMask is not specified, the amd-uncore driver internally sets
ThreadMask to 0x3, EnAllCores to 0x1 and EnAllSlices to 0x1 but does
not set SliceId. Since SliceId must also be set to 0x3 in this case,
specify all the other fields explicitly.

E.g.

  $ sudo perf stat -e l3_xi_sampled_latency.all,l3_xi_sampled_latency_requests.all -a sleep 1

Before:

   Performance counter stats for 'system wide':

                   0      l3_xi_sampled_latency.all
                   0      l3_xi_sampled_latency_requests.all

         1.005155399 seconds time elapsed

After:

   Performance counter stats for 'system wide':

             921,446      l3_xi_sampled_latency.all
              54,210      l3_xi_sampled_latency_requests.all

         1.005664472 seconds time elapsed

Fixes: 5b2ca349c3 ("perf vendor events amd: Add Zen 4 uncore events")
Signed-off-by: Sandipan Das <sandipan.das@amd.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: ananth.narayan@amd.com
Cc: ravi.bangoria@amd.com
Cc: eranian@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240301084431.646221-1-sandipan.das@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:17:16 -04:00
..
accounting
arch work around gcc bugs with 'asm goto' with outputs 2024-02-09 15:57:48 -08:00
bootconfig
bpf tools/resolve_btfids: Fix cross-compilation to non-host endianness 2024-03-26 18:16:40 -04:00
build
certs
cgroup
counter
crypto crypto: tcrypt - add script tcrypt_speed_compare.py 2023-12-29 11:25:55 +08:00
debugging
edid
firewire
firmware
gpio
hv
iio
include tools/resolve_btfids: Refactor set sorting with types from btf_ids.h 2024-03-26 18:16:40 -04:00
kvm/kvm_stat
laptop
leds
lib libbpf: Use OPTS_SET() macro in bpf_xdp_query() 2024-03-26 18:16:39 -04:00
memory-model
mm
net/ynl tools: ynl: fix handling of multiple mcast groups 2024-02-28 15:24:34 -08:00
objtool objtool: Fix UNWIND_HINT_{SAVE,RESTORE} across basic blocks 2024-03-26 18:16:51 -04:00
pci
pcmcia
perf perf vendor events amd: Fix Zen 4 cache latency events 2024-03-26 18:17:16 -04:00
power tools cpupower bench: Override CFLAGS assignments 2024-01-21 16:57:51 -07:00
rcu
scripts
spi
testing selftests: forwarding: Add missing multicast routing config entries 2024-03-26 18:16:41 -04:00
thermal tools/thermal/tmon: Fix compilation warning for wrong format 2024-01-02 09:33:19 +01:00
time
tracing tools/rtla: Exit with EXIT_SUCCESS when help is invoked 2024-02-12 10:59:09 +01:00
usb
verification tools/rv: Fix curr_reactor uninitialized variable 2024-02-12 09:58:36 +01:00
virtio
wmi
workqueue
Makefile