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 perf tools improvements and fixes for v6.8: 2024-01-19 14:25:23 -08:00
bench libperf cpumap: Replace usage of perf_cpu_map__new(NULL) with perf_cpu_map__new_online_cpus() 2023-12-12 14:55:13 -03:00
dlfilters perf dlfilter: Add a test for object_code() 2023-09-30 00:09:06 -07:00
include/perf perf dlfilter: Add al_cleanup() 2023-08-15 16:41:49 -03:00
jvmti
pmu-events perf vendor events amd: Fix Zen 4 cache latency events 2024-03-26 18:17:16 -04:00
python
scripts perf scripts python arm-cs-trace-disasm.py: Do not ignore disam first sample 2023-12-20 14:31:59 -03:00
tests perf test shell daemon: Make signal test less racy 2024-01-26 10:51:49 -03:00
trace tools headers uapi: Sync linux/stat.h with the kernel sources to pick STATX_MNT_ID_UNIQUE 2024-01-26 10:51:48 -03:00
ui perf TUI: Don't ignore job control 2024-01-04 18:29:17 -03:00
util perf pmu: Fix a potential memory leak in perf_pmu__lookup() 2024-03-26 18:17:14 -04:00
.gitignore perf build: Shellcheck support for OUTPUT directory 2023-12-05 15:46:43 -03:00
Build
CREDITS
MANIFEST tools perf: Add arm64 sysreg files to MANIFEST 2023-11-22 11:17:53 -08:00
Makefile
Makefile.config perf probe: Convert to check dwarf_getcfi feature 2023-11-10 09:04:21 -03:00
Makefile.perf perf bpf: Clean up the generated/copied vmlinux.h 2024-03-26 18:17:02 -04:00
builtin-annotate.c perf annotate: Add --insn-stat option for debugging 2023-12-23 22:40:17 -03:00
builtin-bench.c perf tools changes for v6.6: 2023-09-09 20:06:17 -07:00
builtin-buildid-cache.c perf buildid-cache: Fix use of uninitialized value 2023-10-12 10:01:56 -07:00
builtin-buildid-list.c
builtin-c2c.c libperf cpumap: Rename perf_cpu_map__empty() to perf_cpu_map__has_any_cpu_or_is_empty() 2023-12-12 14:55:13 -03:00
builtin-config.c
builtin-daemon.c
builtin-data.c
builtin-diff.c
builtin-evlist.c
builtin-ftrace.c libperf cpumap: Replace usage of perf_cpu_map__new(NULL) with perf_cpu_map__new_online_cpus() 2023-12-12 14:55:13 -03:00
builtin-help.c
builtin-inject.c perf record: Lazy load kernel symbols 2023-11-09 13:49:32 -03:00
builtin-kallsyms.c
builtin-kmem.c
builtin-kvm.c
builtin-kwork.c perf kwork: Fix a build error on 32-bit 2023-11-21 10:02:38 -08:00
builtin-list.c perf list: Add output file option 2024-01-26 10:51:49 -03:00
builtin-lock.c perf lock: Fix a memory leak on an error path 2023-11-27 10:21:27 -03:00
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 perf report: Support data type profiling 2023-12-23 22:39:42 -03:00
builtin-sched.c libperf rc_check: Add RC_CHK_EQUAL 2023-10-25 13:37:22 -07:00
builtin-script.c perf: script: fix missing ',' for fields option 2023-10-17 12:40:51 -07:00
builtin-stat.c perf stat: Combine the -A/--no-aggr and --no-merge options 2023-12-14 18:24:38 -03:00
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 perf env: Introduce perf_env__arch_strerrno() 2023-12-04 16:42:09 -03:00
builtin-version.c perf version: Add status of bpf skeletons 2023-09-18 16:46:15 -07:00
builtin.h
check-headers.sh perf tools: Add get_unaligned_leNN() 2023-10-17 12:40:02 -07:00
command-list.txt
design.txt
perf-archive.sh perf archive: Add new option '--unpack' to expand tarballs 2023-12-20 13:20:45 -03:00
perf-completion.sh perf shell completion: Support completion of metrics/metricgroups 2023-09-11 10:26:36 -03:00
perf-iostat.sh
perf-read-vdso.c
perf-sys.h
perf.c perf tools: Add --debug-file option to redirect debug output 2023-11-28 14:14:53 -03:00
perf.h