]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf lock contention: Load kernel map before lookup
authorNamhyung Kim <namhyung@kernel.org>
Thu, 30 Oct 2025 04:01:39 +0000 (21:01 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 31 Oct 2025 18:32:51 +0000 (11:32 -0700)
commit553d18c98a896094b99a01765b9698b204183d49
treec87a489cac5354016ae5c7f9f09cd79e7ea6dea5
parent352864787458d31420b446154a165145f150d1f0
perf lock contention: Load kernel map before lookup

On some machines, it caused troubles when it tried to find kernel
symbols.  I think it's because kernel modules and kallsyms are messed
up during load and split.

Basically we want to make sure the kernel map is loaded and the code has
it in the lock_contention_read().  But recently we added more lookups in
the lock_contention_prepare() which is called before _read().

Also the kernel map (kallsyms) may not be the first one in the group
like on ARM.  Let's use machine__kernel_map() rather than just loading
the first map.

Reviewed-by: Ian Rogers <irogers@google.com>
Fixes: 688d2e8de231c54e ("perf lock contention: Add -l/--lock-addr option")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/bpf_lock_contention.c