]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 12:54:51 +0000 (13:54 +0100)
commit25b5ee3439cfc00b4abc8f78ef2d78c1ca9f3433
tree1ca278df3216e2f9ca63df57e336819f5039d0ff
parent76a339268d75ccd28d9ea2fb827fe65250f2426f
perf lock contention: Load kernel map before lookup

[ Upstream commit 553d18c98a896094b99a01765b9698b204183d49 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/util/bpf_lock_contention.c