linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Masami Hiramatsu <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:perf/core] perf probe: Fix to show correct error message for $vars and $params
Date: Thu, 14 Jul 2016 00:05:09 -0700	[thread overview]
Message-ID: <tip-f6eb0518f325ef0d6557fbef5c7ebe48a81e74db@git.kernel.org> (raw)
In-Reply-To: <146831787438.17065.6152436996780110699.stgit@devbox>

Commit-ID:  f6eb0518f325ef0d6557fbef5c7ebe48a81e74db
Gitweb:     http://git.kernel.org/tip/f6eb0518f325ef0d6557fbef5c7ebe48a81e74db
Author:     Masami Hiramatsu <mhiramat@kernel.org>
AuthorDate: Tue, 12 Jul 2016 19:04:34 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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 <acme@kernel.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/146831787438.17065.6152436996780110699.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 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;

  reply	other threads:[~2016-07-14  7:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12 10:04 [PATCH perf/core 00/10] perf-probe --cache and SDT support Masami Hiramatsu
2016-07-12 10:04 ` [PATCH perf/core 01/10] [BUGFIX] perf-probe: Fix to show correct error message for $vars and $params Masami Hiramatsu
2016-07-14  7:05   ` tip-bot for Masami Hiramatsu [this message]
2016-07-12 10:04 ` [PATCH perf/core 02/10] perf probe: Accept %sdt and %cached event name Masami Hiramatsu
2016-07-14  7:05   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2016-07-12 10:04 ` [PATCH perf/core 03/10] perf-probe: Make --list shows only available cached events Masami Hiramatsu
2016-07-13 19:28   ` Arnaldo Carvalho de Melo
2016-07-14  6:13     ` Masami Hiramatsu
2016-07-14  7:06   ` [tip:perf/core] perf probe: Make --list show " tip-bot for Masami Hiramatsu
2016-07-12 10:05 ` [PATCH perf/core 04/10] perf: probe-cache: Add for_each_probe_cache_entry() wrapper Masami Hiramatsu
2016-07-14  7:06   ` [tip:perf/core] perf " tip-bot for Masami Hiramatsu
2016-07-12 10:05 ` [PATCH perf/core 05/10] perf probe: Allow wildcard for cached events Masami Hiramatsu
2016-07-13 19:36   ` Arnaldo Carvalho de Melo
2016-07-14  7:07   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2016-07-12 10:05 ` [PATCH perf/core 06/10] perf probe: Search SDT/cached event from all probe caches Masami Hiramatsu
2016-07-14  7:07   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2016-07-12 10:05 ` [PATCH perf/core 07/10] perf probe: Support @BUILDID or @FILE suffix for SDT events Masami Hiramatsu
2016-07-13 19:50   ` Arnaldo Carvalho de Melo
2016-07-14  0:07     ` Arnaldo Carvalho de Melo
2016-07-14  0:16       ` Arnaldo Carvalho de Melo
2016-07-14  0:20         ` Arnaldo Carvalho de Melo
2016-07-14 15:32           ` Masami Hiramatsu
2016-07-14  7:08   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2016-07-12 10:05 ` [PATCH perf/core 08/10] perf probe: Support a special SDT probe format Masami Hiramatsu
2016-07-14  7:08   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2016-07-12 10:05 ` [PATCH perf/core 09/10] perf build: Add sdt feature detection Masami Hiramatsu
2016-07-14  7:09   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2016-07-12 10:06 ` [PATCH perf/core 10/10] perf-test: Add a test case for SDT event Masami Hiramatsu
2016-07-14  7:10   ` [tip:perf/core] perf test: " tip-bot for Masami Hiramatsu
2016-07-14  1:35 ` [PATCH perf/core 00/10] perf-probe --cache and SDT support Arnaldo Carvalho de Melo

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-f6eb0518f325ef0d6557fbef5c7ebe48a81e74db@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=ananth@linux.vnet.ibm.com \
    --cc=brendan.d.gregg@gmail.com \
    --cc=hemant@linux.vnet.ibm.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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).