From: Masami Hiramatsu Date: Mon, 15 Mar 2010 17:02:28 +0000 (-0400) Subject: perf probe: Fix offset to allow signed value X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=67c7ff7c56f38a8ab338fbbfe366621ce6303ba1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: Masami Hiramatsu Cc: systemtap Cc: DLE LKML-Reference: <20100315170228.31852.71946.stgit@localhost6.localdomain6> Signed-off-by: Ingo Molnar --- diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index f9cbbf18e6ca..0e8c8f1594ec 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -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);