Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1441207

[PATCH perf/core 01/10] [BUGFIX] perf-probe: Fix to show correct error message for $vars and $params

From Masami Hiramatsu <mhiramat@kernel.org>
Newsgroups linux.kernel
Subject [PATCH perf/core 01/10] [BUGFIX] perf-probe: Fix to show correct error message for $vars and $params
Date 2016-07-12 12:10 +0200
Message-ID <rU2NB-3tA-41@gated-at.bofh.it> (permalink)
References <rU2NA-3tA-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 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 0201f66..dff9a54 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;

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH perf/core 00/10] perf-probe --cache and SDT support Masami Hiramatsu <mhiramat@kernel.org> - 2016-07-12 12:10 +0200
  [PATCH perf/core 03/10] perf-probe: Make --list shows only available cached events Masami Hiramatsu <mhiramat@kernel.org> - 2016-07-12 12:10 +0200
    Re: [PATCH perf/core 03/10] perf-probe: Make --list shows only  available cached events Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 21:30 +0200
      Re: [PATCH perf/core 03/10] perf-probe: Make --list shows only  available cached events Masami Hiramatsu <mhiramat@kernel.org> - 2016-07-14 08:20 +0200
    [tip:perf/core] perf probe: Make --list show only available cached  events tip-bot for Masami Hiramatsu <tipbot@zytor.com> - 2016-07-14 09:10 +0200
  [PATCH perf/core 10/10] perf-test: Add a test case for SDT event Masami Hiramatsu <mhiramat@kernel.org> - 2016-07-12 12:10 +0200
    [tip:perf/core] perf test: Add a test case for SDT event tip-bot for Masami Hiramatsu <tipbot@zytor.com> - 2016-07-14 09:20 +0200
  [PATCH perf/core 09/10] perf build: Add sdt feature detection Masami Hiramatsu <mhiramat@kernel.org> - 2016-07-12 12:10 +0200
    [tip:perf/core] perf build: Add sdt feature detection tip-bot for Masami Hiramatsu <tipbot@zytor.com> - 2016-07-14 09:20 +0200
  [PATCH perf/core 01/10] [BUGFIX] perf-probe: Fix to show correct error message for $vars and $params Masami Hiramatsu <mhiramat@kernel.org> - 2016-07-12 12:10 +0200
    [tip:perf/core] perf probe: Fix to show correct error message for  $vars and $params tip-bot for Masami Hiramatsu <tipbot@zytor.com> - 2016-07-14 09:10 +0200
  [PATCH perf/core 07/10] perf probe: Support @BUILDID or @FILE suffix for SDT events Masami Hiramatsu <mhiramat@kernel.org> - 2016-07-12 12:10 +0200
    Re: [PATCH perf/core 07/10] perf probe: Support @BUILDID or @FILE  suffix for SDT events Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 22:00 +0200
      Re: [PATCH perf/core 07/10] perf probe: Support @BUILDID or @FILE  suffix for SDT events Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-14 02:10 +0200
        Re: [PATCH perf/core 07/10] perf probe: Support @BUILDID or @FILE  suffix for SDT events Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-14 02:20 +0200
          Re: [PATCH perf/core 07/10] perf probe: Support @BUILDID or @FILE  suffix for SDT events Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-14 02:30 +0200
            Re: [PATCH perf/core 07/10] perf probe: Support @BUILDID or @FILE  suffix for SDT events Masami Hiramatsu <mhiramat@kernel.org> - 2016-07-14 17:40 +0200
    [tip:perf/core] perf probe: Support @BUILDID or @FILE suffix for  SDT events tip-bot for Masami Hiramatsu <tipbot@zytor.com> - 2016-07-14 09:10 +0200
  [PATCH perf/core 08/10] perf probe: Support a special SDT probe format Masami Hiramatsu <mhiramat@kernel.org> - 2016-07-12 12:10 +0200
    [tip:perf/core] perf probe: Support a special SDT probe format tip-bot for Masami Hiramatsu <tipbot@zytor.com> - 2016-07-14 09:10 +0200
  [PATCH perf/core 05/10] perf probe: Allow wildcard for cached events Masami Hiramatsu <mhiramat@kernel.org> - 2016-07-12 12:10 +0200
    Re: [PATCH perf/core 05/10] perf probe: Allow wildcard for cached  events Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-13 21:40 +0200
    [tip:perf/core] perf probe: Allow wildcard for cached events tip-bot for Masami Hiramatsu <tipbot@zytor.com> - 2016-07-14 09:10 +0200
  [PATCH perf/core 02/10] perf probe: Accept %sdt and %cached event name Masami Hiramatsu <mhiramat@kernel.org> - 2016-07-12 12:10 +0200
    [tip:perf/core] perf probe: Accept %sdt and %cached event name tip-bot for Masami Hiramatsu <tipbot@zytor.com> - 2016-07-14 09:10 +0200
  Re: [PATCH perf/core 00/10] perf-probe --cache and SDT support Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-07-14 03:40 +0200

csiph-web