From 4aca0a2fe3a0cc0750872fc9ab41b10c491ee7f5 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Wed, 25 Apr 2012 14:16:03 -0300 Subject: [PATCH] --- yaml --- r: 304856 b: refs/heads/master c: fb29fa58e36df09c807d252247d64a221fcd5bbb h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/tools/perf/util/annotate.c | 9 ++++++--- trunk/tools/perf/util/annotate.h | 6 ++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index c229bd01cb61..cee27f88b05f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 44d1a3edfbd65f9da6725921e2425b10477772d8 +refs/heads/master: fb29fa58e36df09c807d252247d64a221fcd5bbb diff --git a/trunk/tools/perf/util/annotate.c b/trunk/tools/perf/util/annotate.c index e1e7d0eb6145..5eb34123f55b 100644 --- a/trunk/tools/perf/util/annotate.c +++ b/trunk/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; } diff --git a/trunk/tools/perf/util/annotate.h b/trunk/tools/perf/util/annotate.h index 2b9e3e038a84..13a21f10dabb 100644 --- a/trunk/tools/perf/util/annotate.h +++ b/trunk/tools/perf/util/annotate.h @@ -2,6 +2,7 @@ #define __PERF_ANNOTATE_H #include +#include #include "types.h" #include "symbol.h" #include @@ -41,6 +42,11 @@ struct disasm_line { struct ins_operands ops; }; +static inline bool disasm_line__has_offset(const struct disasm_line *dl) +{ + return dl->ops.target.offset != UINT64_MAX; +} + void disasm_line__free(struct disasm_line *dl); struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos); size_t disasm__fprintf(struct list_head *head, FILE *fp);