perf probe: Fix offset to allow signed value
authorMasami Hiramatsu <mhiramat@redhat.com>
Mon, 15 Mar 2010 17:02:28 +0000 (13:02 -0400)
committerIngo Molnar <mingo@elte.hu>
Tue, 16 Mar 2010 09:02:18 +0000 (10:02 +0100)
Fix dereference offset to intmax_t from uintmax_t, because
it can have negative values (for example local variable's offset
from frame pointer).

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
LKML-Reference: <20100315170228.31852.71946.stgit@localhost6.localdomain6>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/util/probe-finder.c

index f9cbbf18e6ca0a03bb71c601b27e28a23fd903cb..0e8c8f1594ec296f7a1d76fdf9ea22c23aff55e5 100644 (file)
@@ -333,8 +333,8 @@ static void show_location(Dwarf_Op *op, struct probe_finder *pf)
                die("%u exceeds max register number.", regn);
 
        if (deref)
-               ret = snprintf(pf->buf, pf->len, " %s=+%ju(%s)",
-                              pf->var, (uintmax_t)offs, regs);
+               ret = snprintf(pf->buf, pf->len, " %s=%+jd(%s)",
+                              pf->var, (intmax_t)offs, regs);
        else
                ret = snprintf(pf->buf, pf->len, " %s=%s", pf->var, regs);
        DIE_IF(ret < 0);