aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/annotate.c9
-rw-r--r--tools/perf/util/annotate.h6
2 files changed, 12 insertions, 3 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index e1e7d0eb6145..5eb34123f55b 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)
75{ 75{
76 const char *s = strchr(ops->raw, '+'); 76 const char *s = strchr(ops->raw, '+');
77 77
78 if (s++ == NULL) 78 ops->target.addr = strtoll(ops->raw, NULL, 16);
79 return -1; 79
80 if (s++ != NULL)
81 ops->target.offset = strtoll(s, NULL, 16);
82 else
83 ops->target.offset = UINT64_MAX;
80 84
81 ops->target.offset = strtoll(s, NULL, 16);
82 return 0; 85 return 0;
83} 86}
84 87
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index 2b9e3e038a84..13a21f10dabb 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -2,6 +2,7 @@
2#define __PERF_ANNOTATE_H 2#define __PERF_ANNOTATE_H
3 3
4#include <stdbool.h> 4#include <stdbool.h>
5#include <stdint.h>
5#include "types.h" 6#include "types.h"
6#include "symbol.h" 7#include "symbol.h"
7#include <linux/list.h> 8#include <linux/list.h>
@@ -41,6 +42,11 @@ struct disasm_line {
41 struct ins_operands ops; 42 struct ins_operands ops;
42}; 43};
43 44
45static inline bool disasm_line__has_offset(const struct disasm_line *dl)
46{
47 return dl->ops.target.offset != UINT64_MAX;
48}
49
44void disasm_line__free(struct disasm_line *dl); 50void disasm_line__free(struct disasm_line *dl);
45struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos); 51struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos);
46size_t disasm__fprintf(struct list_head *head, FILE *fp); 52size_t disasm__fprintf(struct list_head *head, FILE *fp);