From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751188AbcGNHFz (ORCPT ); Thu, 14 Jul 2016 03:05:55 -0400 Received: from terminus.zytor.com ([198.137.202.10]:45396 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750883AbcGNHFq (ORCPT ); Thu, 14 Jul 2016 03:05:46 -0400 Date: Thu, 14 Jul 2016 00:05:09 -0700 From: tip-bot for Masami Hiramatsu Message-ID: Cc: peterz@infradead.org, mingo@kernel.org, namhyung@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, ananth@linux.vnet.ibm.com, brendan.d.gregg@gmail.com, mhiramat@kernel.org, hpa@zytor.com, acme@kernel.org, acme@redhat.com, hemant@linux.vnet.ibm.com Reply-To: namhyung@kernel.org, mingo@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org, brendan.d.gregg@gmail.com, ananth@linux.vnet.ibm.com, tglx@linutronix.de, acme@redhat.com, acme@kernel.org, hpa@zytor.com, mhiramat@kernel.org, hemant@linux.vnet.ibm.com In-Reply-To: <146831787438.17065.6152436996780110699.stgit@devbox> References: <146831787438.17065.6152436996780110699.stgit@devbox> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf probe: Fix to show correct error message for $vars and $params Git-Commit-ID: f6eb0518f325ef0d6557fbef5c7ebe48a81e74db 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: f6eb0518f325ef0d6557fbef5c7ebe48a81e74db Gitweb: http://git.kernel.org/tip/f6eb0518f325ef0d6557fbef5c7ebe48a81e74db Author: Masami Hiramatsu AuthorDate: Tue, 12 Jul 2016 19:04:34 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 13 Jul 2016 23:09:04 -0300 perf probe: Fix to show correct error message for $vars and $params Fix to show correct error messages for $vars and $params because those special variables requires debug information to find the real variables or function parameters. E.g. without this fix; ---- # perf probe -x /lib64/libc-2.23.so getaddrinfo \$params Failed to write event: Invalid argument Please upgrade your kernel to at least 3.14 to have access to feature $params Error: Failed to add events. ---- Perf ends up with an error, but the message is not correct. With this fix, perf shows correct error message as below. ---- # perf probe -x /lib64/libc-2.23.so getaddrinfo \$params The /usr/lib64/libc-2.23.so file has no debug information. Rebuild with -g, or install an appropriate debuginfo package. Error: Failed to add events. ---- Reported-and-Tested-by: Arnaldo Carvalho de Melo Signed-off-by: Masami Hiramatsu Cc: Ananth N Mavinakayanahalli Cc: Brendan Gregg Cc: Hemant Kumar Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/146831787438.17065.6152436996780110699.stgit@devbox Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/probe-event.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 2b222a7..fef9768 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -1547,7 +1547,9 @@ bool perf_probe_event_need_dwarf(struct perf_probe_event *pev) return true; for (i = 0; i < pev->nargs; i++) - if (is_c_varname(pev->args[i].var)) + if (is_c_varname(pev->args[i].var) || + !strcmp(pev->args[i].var, "$params") || + !strcmp(pev->args[i].var, "$vars")) return true; return false;