* [PATCH -tip ] [BUGFIX] perf probe: Fix regression of variable finder
@ 2011-08-20 5:39 Masami Hiramatsu
0 siblings, 0 replies; only message in thread
From: Masami Hiramatsu @ 2011-08-20 5:39 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ingo Molnar
Cc: Frederic Weisbecker, Peter Zijlstra, Pekka Enberg, linux-kernel,
yrl.pp-manager.tt, Masami Hiramatsu, Peter Zijlstra,
Paul Mackerras, Ingo Molnar, Arnaldo Carvalho de Melo
Fix to call convert_variable() if previous call does not fail.
To call convert_variable, it ensures "ret" is 0. However, since
"ret" has the return value of synthesize_perf_probe_arg() which
always returns positive value if it succeeded, perf probe doesn't
call convert_variable(). This will cause a SEGV when we add an
event with arguments.
This has to be fixed as it ensures "ret" is greater than 0
(or not negative).
This regression has been introduced by my previous patch, f182e3e1.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
---
tools/perf/util/probe-finder.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 555fc38..5d73262 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -659,7 +659,7 @@ static int find_variable(Dwarf_Die *sc_die, struct probe_finder *pf)
if (!die_find_variable_at(&pf->cu_die, pf->pvar->var, 0, &vr_die))
ret = -ENOENT;
}
- if (ret == 0)
+ if (ret >= 0)
ret = convert_variable(&vr_die, pf);
if (ret < 0)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-08-20 5:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-20 5:39 [PATCH -tip ] [BUGFIX] perf probe: Fix regression of variable finder Masami Hiramatsu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox