[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140623031712.6541.39111.stgit@kbuild-fedora.novalocal>
Date: Mon, 23 Jun 2014 03:17:12 +0000
From: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To: Patrick Palka <patrick@...cs.ath.cx>, Jiri Olsa <jolsa@...hat.com>,
linux-kernel@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Ingo Molnar <mingo@...hat.com>,
Paul Mackerras <paulus@...ba.org>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Ingo Molnar <mingo@...nel.org>
Subject: [PATCH -tip ] [BUGFIX]: Fix to add a missing pair of braces for
error path.
Fix to add a missing pair of braces for error path.
Commit 36d789a4d75f (perf probe: Improve error message for
unknown member of data structure) introduced this bug.
Without this fix, defining an event with global variables
is always failed, because it always returns -ENOENT if
the argument is not a local variable.
----
# perf probe -na "vfs_read smp_found_config"
Error: Failed to add events.
----
With this fix, you can set a global variable for the
argument of new event.
----
# perf probe -na "vfs_read smp_found_config"
Added new event:
probe:vfs_read (on vfs_read with smp_found_config)
You can now use it in all perf tools, such as:
perf record -e probe:vfs_read -aR sleep 1
----
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Reported-by: Patrick Palka <patrick@...cs.ath.cx>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
---
tools/perf/util/probe-finder.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 98e3047..10560fc 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -572,10 +572,12 @@ static int find_variable(Dwarf_Die *sc_die, struct probe_finder *pf)
/* Search child die for local variables and parameters. */
if (!die_find_variable_at(sc_die, pf->pvar->var, pf->addr, &vr_die)) {
/* Search again in global variables */
- if (!die_find_variable_at(&pf->cu_die, pf->pvar->var, 0, &vr_die))
+ if (!die_find_variable_at(&pf->cu_die, pf->pvar->var, 0,
+ &vr_die)) {
pr_warning("Failed to find '%s' in this function.\n",
pf->pvar->var);
ret = -ENOENT;
+ }
}
if (ret >= 0)
ret = convert_variable(&vr_die, pf);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists