Commit 060c8899 authored by Adrian Hunter's avatar Adrian Hunter Committed by Greg Kroah-Hartman

perf probe: Fix getting the kernel map

commit eaeffeb9838a7c0dec981d258666bfcc0fa6a947 upstream.

Since commit 4d99e413 ("perf machine: Workaround missing maps for
x86 PTI entry trampolines"), perf tools has been creating more than one
kernel map, however 'perf probe' assumed there could be only one.

Fix by using machine__kernel_map() to get the main kernel map.
Signed-off-by: default avatarAdrian Hunter <>
Tested-by: default avatarJoseph Qi <>
Acked-by: default avatarMasami Hiramatsu <>
Cc: Alexander Shishkin <>
Cc: Andy Lutomirski <>
Cc: Greg Kroah-Hartman <>
Cc: Jiufei Xue <>
Cc: Peter Zijlstra <>
Cc: Xu Yu <>
Fixes: 4d99e413 ("perf machine: Workaround missing maps for x86 PTI entry trampolines")
Fixes: d83212d5 ("kallsyms, x86: Export addresses of PTI entry trampolines")
Link: default avatarArnaldo Carvalho de Melo <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent a7e83004
......@@ -169,8 +169,10 @@ static struct map *kernel_get_module_map(const char *module)
if (module && strchr(module, '/'))
return dso__new_map(module);
if (!module)
module = "kernel";
if (!module) {
pos = machine__kernel_map(host_machine);
return map__get(pos);
for (pos = maps__first(maps); pos; pos = map__next(pos)) {
/* short_name is "[module]" */
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment