5.0-stable review patch. If anyone has any objections, please let me know.
------------------ From: Adrian Hunter <adrian.hun...@intel.com> commit eaeffeb9838a7c0dec981d258666bfcc0fa6a947 upstream. Since commit 4d99e4136580 ("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: Adrian Hunter <adrian.hun...@intel.com> Tested-by: Joseph Qi <joseph...@linux.alibaba.com> Acked-by: Masami Hiramatsu <mhira...@kernel.org> Cc: Alexander Shishkin <alexander.shish...@linux.intel.com> Cc: Andy Lutomirski <l...@kernel.org> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> Cc: Jiufei Xue <jiufei....@linux.alibaba.com> Cc: Peter Zijlstra <pet...@infradead.org> Cc: sta...@vger.kernel.org Cc: Xu Yu <x...@linux.alibaba.com> Fixes: 4d99e4136580 ("perf machine: Workaround missing maps for x86 PTI entry trampolines") Fixes: d83212d5dd67 ("kallsyms, x86: Export addresses of PTI entry trampolines") Link: http://lkml.kernel.org/r/2ed432de-e904-85d2-5c36-5897ddc5b...@intel.com Signed-off-by: Arnaldo Carvalho de Melo <a...@redhat.com> Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org> --- tools/perf/util/probe-event.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -157,8 +157,10 @@ static struct map *kernel_get_module_map 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]" */