All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Jiri Olsa <jolsa@redhat.com>
Subject: [RFC PATCH 3/4] perf-probe: Ignore vmlinux buildid if offline kernel is given
Date: Wed, 24 Aug 2016 14:58:27 +0900	[thread overview]
Message-ID: <147201830716.5713.4198150817987792737.stgit@devbox> (raw)
In-Reply-To: <147201825017.5713.10732844032749364745.stgit@devbox>

Ignore the buildid of running kernel when both --outdir and
--vmlinux is given and --outdir is not tracing_path,
because that kernel should be off-line.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 tools/perf/builtin-probe.c   |    6 ++++++
 tools/perf/util/symbol-elf.c |    2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 5b45ec8..773cea0 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -602,6 +602,12 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
 	 */
 	symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL);
 
+	/* If user gives output directory and offline vmlinux, ignore buildid */
+	if (probe_conf.output_dir && symbol_conf.vmlinux_name &&
+	    strcmp(probe_conf.output_dir, tracing_path) != 0) {
+		symbol_conf.ignore_vmlinux_buildid = true;
+	}
+
 	switch (params.command) {
 	case 'l':
 		if (params.uprobes) {
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index a811c13..013cebf 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -685,7 +685,7 @@ int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,
 	}
 
 	/* Always reject images with a mismatched build-id: */
-	if (dso->has_build_id) {
+	if (dso->has_build_id && !symbol_conf.ignore_vmlinux_buildid) {
 		u8 build_id[BUILD_ID_SIZE];
 
 		if (elf_read_build_id(elf, build_id, BUILD_ID_SIZE) < 0) {

  parent reply	other threads:[~2016-08-24  5:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24  5:57 [RFC PATCH 0/4] perf probe: Introduce remote cross-arch probes Masami Hiramatsu
2016-08-24  5:57 ` [RFC PATCH 1/4] perf-probe: Remove unused tracing_dir variable Masami Hiramatsu
2016-09-05 13:19   ` [tip:perf/core] perf probe: " tip-bot for Masami Hiramatsu
2016-08-24  5:58 ` [RFC PATCH 2/4] perf-probe: Add offline output directory option Masami Hiramatsu
2016-08-24 12:58   ` Arnaldo Carvalho de Melo
2016-08-25  6:37     ` Masami Hiramatsu
2016-08-25 10:48     ` Masami Hiramatsu
2016-08-25 14:40       ` Arnaldo Carvalho de Melo
2016-08-24  5:58 ` Masami Hiramatsu [this message]
2016-08-24  5:58 ` [RFC PATCH 4/4] perf-probe: Support probing on offline cross-arch binary Masami Hiramatsu
2016-08-24 13:03   ` Arnaldo Carvalho de Melo
2016-08-25  6:57     ` Masami Hiramatsu

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=147201830716.5713.4198150817987792737.stgit@devbox \
    --to=mhiramat@kernel.org \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.