diff options
Diffstat (limited to 'tools/perf/util/hist.c')
-rw-r--r-- | tools/perf/util/hist.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index d0f07f7bdf16..a6cea2894d12 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -1050,13 +1050,17 @@ static int hist_entry__parse_objdump_line(struct hist_entry *self, FILE *file, | |||
1050 | * Parse hexa addresses followed by ':' | 1050 | * Parse hexa addresses followed by ':' |
1051 | */ | 1051 | */ |
1052 | line_ip = strtoull(tmp, &tmp2, 16); | 1052 | line_ip = strtoull(tmp, &tmp2, 16); |
1053 | if (*tmp2 != ':' || tmp == tmp2) | 1053 | if (*tmp2 != ':' || tmp == tmp2 || tmp2[1] == '\0') |
1054 | line_ip = -1; | 1054 | line_ip = -1; |
1055 | } | 1055 | } |
1056 | 1056 | ||
1057 | if (line_ip != -1) { | 1057 | if (line_ip != -1) { |
1058 | u64 start = map__rip_2objdump(self->ms.map, sym->start); | 1058 | u64 start = map__rip_2objdump(self->ms.map, sym->start), |
1059 | end = map__rip_2objdump(self->ms.map, sym->end); | ||
1060 | |||
1059 | offset = line_ip - start; | 1061 | offset = line_ip - start; |
1062 | if (offset < 0 || (u64)line_ip > end) | ||
1063 | offset = -1; | ||
1060 | } | 1064 | } |
1061 | 1065 | ||
1062 | objdump_line = objdump_line__new(offset, line); | 1066 | objdump_line = objdump_line__new(offset, line); |