From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753421AbcHXF6j (ORCPT ); Wed, 24 Aug 2016 01:58:39 -0400 Received: from mail.kernel.org ([198.145.29.136]:50406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753367AbcHXF6h (ORCPT ); Wed, 24 Aug 2016 01:58:37 -0400 From: Masami Hiramatsu To: Arnaldo Carvalho de Melo Cc: Masami Hiramatsu , linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Jiri Olsa Subject: [RFC PATCH 3/4] perf-probe: Ignore vmlinux buildid if offline kernel is given Date: Wed, 24 Aug 2016 14:58:27 +0900 Message-Id: <147201830716.5713.4198150817987792737.stgit@devbox> X-Mailer: git-send-email 2.7.4 In-Reply-To: <147201825017.5713.10732844032749364745.stgit@devbox> References: <147201825017.5713.10732844032749364745.stgit@devbox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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) {