From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933842AbcIENYX (ORCPT ); Mon, 5 Sep 2016 09:24:23 -0400 Received: from terminus.zytor.com ([198.137.202.10]:38776 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933214AbcIENYT (ORCPT ); Mon, 5 Sep 2016 09:24:19 -0400 Date: Mon, 5 Sep 2016 06:23:48 -0700 From: tip-bot for Masami Hiramatsu Message-ID: Cc: mhiramat@kernel.org, hpa@zytor.com, tglx@linutronix.de, acme@redhat.com, mingo@kernel.org, jolsa@redhat.com, peterz@infradead.org, linux-kernel@vger.kernel.org Reply-To: acme@redhat.com, tglx@linutronix.de, mhiramat@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, jolsa@redhat.com, peterz@infradead.org, mingo@kernel.org In-Reply-To: <147222347320.5088.2582658035296667520.stgit@devbox> References: <147222347320.5088.2582658035296667520.stgit@devbox> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf probe: Ignore vmlinux Build-id when offline vmlinux given Git-Commit-ID: e50243bbeb528e92e31e03e560b557737c9def3c X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: e50243bbeb528e92e31e03e560b557737c9def3c Gitweb: http://git.kernel.org/tip/e50243bbeb528e92e31e03e560b557737c9def3c Author: Masami Hiramatsu AuthorDate: Fri, 26 Aug 2016 23:57:58 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 1 Sep 2016 12:42:22 -0300 perf probe: Ignore vmlinux Build-id when offline vmlinux given Ignore vmlinux build-id when user gives offline vmlinux if the command does not affect running kernel. perf-probe has several actions some of them does not change the running kernel, like --lines, --vars, and --funcs. e.g. ----- $ ./perf probe -k ./vmlinux-arm -V do_sys_open:14 Available variables at do_sys_open:14 @ char* filename int dfd int fd int flags struct filename* tmp struct open_flags op umode_t mode ----- Signed-off-by: Masami Hiramatsu Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/147222347320.5088.2582658035296667520.stgit@devbox Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-probe.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index b4220cd..f87996b 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c @@ -611,6 +611,14 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused) */ symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL); + /* + * Except for --list, --del and --add, other command doesn't depend + * nor change running kernel. So if user gives offline vmlinux, + * ignore its buildid. + */ + if (!strchr("lda", params.command) && symbol_conf.vmlinux_name) + symbol_conf.ignore_vmlinux_buildid = true; + switch (params.command) { case 'l': if (params.uprobes) { @@ -655,13 +663,6 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused) } break; case 'D': - /* - * If user gives offline vmlinux, ignore buildid, since - * --definition doesn't change running kernel. - */ - if (symbol_conf.vmlinux_name) - symbol_conf.ignore_vmlinux_buildid = true; - /* fall through */ case 'a': /* Ensure the last given target is used */