linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Adrian Hunter <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jiufei.xue@linux.alibaba.com, alexander.shishkin@linux.intel.com,
	adrian.hunter@intel.com, peterz@infradead.org,
	linux-kernel@vger.kernel.org, hpa@zytor.com,
	gregkh@linuxfoundation.org, xuyu@linux.alibaba.com,
	acme@redhat.com, joseph.qi@linux.alibaba.com,
	mhiramat@kernel.org, mingo@kernel.org, luto@kernel.org,
	tglx@linutronix.de
Subject: [tip:perf/urgent] perf probe: Fix getting the kernel map
Date: Fri, 22 Mar 2019 15:01:55 -0700	[thread overview]
Message-ID: <tip-eaeffeb9838a7c0dec981d258666bfcc0fa6a947@git.kernel.org> (raw)
In-Reply-To: <2ed432de-e904-85d2-5c36-5897ddc5b23b@intel.com>

Commit-ID:  eaeffeb9838a7c0dec981d258666bfcc0fa6a947
Gitweb:     https://git.kernel.org/tip/eaeffeb9838a7c0dec981d258666bfcc0fa6a947
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Mon, 4 Mar 2019 15:13:21 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 11 Mar 2019 11:56:03 -0300

perf probe: Fix getting the kernel map

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.hunter@intel.com>
Tested-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiufei Xue <jiufei.xue@linux.alibaba.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: stable@vger.kernel.org
Cc: Xu Yu <xuyu@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-5897ddc5b23b@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index a1b8d9649ca7..198e09ff611e 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -160,8 +160,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]" */

  parent reply	other threads:[~2019-03-22 22:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-26  7:31 [bug report][stable] perf probe: failed to add events Joseph Qi
2019-02-26  9:05 ` Greg KH
2019-02-26 12:32   ` Joseph Qi
2019-02-26 13:08     ` Greg KH
2019-02-26 14:20       ` Arnaldo Carvalho de Melo
2019-02-27 12:39         ` Adrian Hunter
2019-02-28  2:07           ` Joseph Qi
2019-02-28  7:19             ` Adrian Hunter
2019-03-02 10:58               ` Joseph Qi
2019-03-04 13:13                 ` [PATCH] perf probe: Fix getting the kernel map Adrian Hunter
2019-03-08 14:39                   ` Arnaldo Carvalho de Melo
2019-03-11  9:23                     ` Masami Hiramatsu
2019-03-22 22:01                   ` tip-bot for Adrian Hunter [this message]
2019-03-21 10:10               ` [bug report][stable] perf probe: failed to add events Greg KH
2019-03-25 10:02                 ` Adrian Hunter
2019-02-27  1:53       ` Joseph Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-eaeffeb9838a7c0dec981d258666bfcc0fa6a947@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=jiufei.xue@linux.alibaba.com \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=xuyu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).