Commit 67c7ff7c authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Ingo Molnar

perf probe: Fix offset to allow signed value

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: default avatarMasami 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: default avatarIngo Molnar <mingo@elte.hu>
parent b63be8d7
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment