linux-stable/tools/perf
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
..
Documentation perf list: Add output file option 2024-01-26 10:51:49 -03:00
arch
bench
dlfilters
include/perf
jvmti
pmu-events perf vendor events amd: Fix Zen 4 cache latency events 2024-03-26 18:17:16 -04:00
python
scripts
tests perf test shell daemon: Make signal test less racy 2024-01-26 10:51:49 -03:00
trace
ui
util perf pmu: Fix a potential memory leak in perf_pmu__lookup() 2024-03-26 18:17:14 -04:00
.gitignore
Build
CREDITS
MANIFEST
Makefile
Makefile.config
Makefile.perf perf bpf: Clean up the generated/copied vmlinux.h 2024-03-26 18:17:02 -04:00
builtin-annotate.c
builtin-bench.c
builtin-buildid-cache.c
builtin-buildid-list.c
builtin-c2c.c
builtin-config.c
builtin-daemon.c
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-ftrace.c
builtin-help.c
builtin-inject.c
builtin-kallsyms.c
builtin-kmem.c
builtin-kvm.c
builtin-kwork.c
builtin-list.c perf list: Add output file option 2024-01-26 10:51:49 -03:00
builtin-lock.c
builtin-mem.c
builtin-probe.c
builtin-record.c perf record: Check conflict between '--timestamp-filename' option and pipe mode before recording 2024-03-26 18:17:01 -04:00
builtin-report.c
builtin-sched.c
builtin-script.c
builtin-stat.c
builtin-timechart.c
builtin-top.c perf top: Remove needless malloc(0) call that triggers -Walloc-size 2024-01-26 12:06:12 -03:00
builtin-trace.c
builtin-version.c
builtin.h
check-headers.sh
command-list.txt
design.txt
perf-archive.sh
perf-completion.sh
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c
perf.h