perf annotate browser: Suppress the callq address

    0.00 |       callq  ffffffff8112f190 <__mod_zone_page_state>

Becomes:

    0.00 |       callq  __mod_zone_page_state

But if you press 'o' it gets verbose, i.e. as in objdump -dS:

    0.00 | ffffffff8116bdda:  callq  ffffffff8112f190 <__mod_zone_page_state>
Requested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-bwse2wib954y0db7dq91bes5@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 97148a97
......@@ -20,12 +20,50 @@ const char *disassembler_style;
static int call__parse(struct ins_operands *ops)
{
ops->target = strtoull(ops->raw, NULL, 16);
char *endptr, *tok, *name;
ops->target = strtoull(ops->raw, &endptr, 16);
name = strchr(endptr, '<');
if (name == NULL)
goto indirect_call;
name++;
tok = strchr(name, '>');
if (tok == NULL)
return -1;
*tok = '\0';
ops->target_name = strdup(name);
*tok = '>';
return ops->target_name == NULL ? -1 : 0;
indirect_call:
tok = strchr(endptr, '*');
if (tok == NULL)
return -1;
ops->target = strtoull(tok + 1, NULL, 16);
return 0;
}
static int call__scnprintf(struct ins *ins, char *bf, size_t size,
struct ins_operands *ops, bool addrs)
{
if (addrs)
return scnprintf(bf, size, "%-6.6s %s", ins->name, ops->raw);
if (ops->target_name)
return scnprintf(bf, size, "%-6.6s %s", ins->name, ops->target_name);
return scnprintf(bf, size, "%-6.6s *%" PRIx64, ins->name, ops->target);
}
static struct ins_ops call_ops = {
.parse = call__parse,
.scnprintf = call__scnprintf,
};
bool ins__is_call(const struct ins *ins)
......@@ -251,6 +289,7 @@ void disasm_line__free(struct disasm_line *dl)
{
free(dl->line);
free(dl->name);
free(dl->ops.target_name);
free(dl);
}
......
......@@ -11,6 +11,7 @@ struct ins;
struct ins_operands {
char *raw;
char *target_name;
u64 target;
};
......
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