From fb29fa58e36df09c807d252247d64a221fcd5bbb Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Wed, 25 Apr 2012 14:16:03 -0300 Subject: perf annotate: Mark jump instructions with no offset I.e. jumps that go to code outside the current function, that is denoted in objdump -dS as: 399f877a9f: jne 399f87bcf4 <_L_lock_5154> I.e. without the + after the name of the current function, like in: 399f877aa5: jmp 399f877ab2 <_int_free+0x412> The browser will use that info to avoid drawing connectors to the start of the function, since ops.target.addr was zero. Cc: David Ahern Cc: Frederic Weisbecker Cc: Mike Galbraith Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-xrn35g2mlawz1ydo1p73w3q6@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/annotate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tools/perf/util/annotate.c') diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index e1e7d0e..5eb3412 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -75,10 +75,13 @@ static int jump__parse(struct ins_operands *ops) { const char *s = strchr(ops->raw, '+'); - if (s++ == NULL) - return -1; + ops->target.addr = strtoll(ops->raw, NULL, 16); + + if (s++ != NULL) + ops->target.offset = strtoll(s, NULL, 16); + else + ops->target.offset = UINT64_MAX; - ops->target.offset = strtoll(s, NULL, 16); return 0; } -- cgit v1.1