Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);