diff options
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/map.c | 8 | ||||
-rw-r--r-- | tools/perf/util/map.h | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index af5805f51314..138e3cb2b727 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -222,3 +222,11 @@ u64 map__rip_2objdump(struct map *map, u64 rip) | |||
222 | rip; | 222 | rip; |
223 | return addr; | 223 | return addr; |
224 | } | 224 | } |
225 | |||
226 | u64 map__objdump_2ip(struct map *map, u64 addr) | ||
227 | { | ||
228 | u64 ip = map->dso->adjust_symbols ? | ||
229 | addr : | ||
230 | map->unmap_ip(map, addr); /* RIP -> IP */ | ||
231 | return ip; | ||
232 | } | ||
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h index 9cee9c788dbf..86f77cb1d060 100644 --- a/tools/perf/util/map.h +++ b/tools/perf/util/map.h | |||
@@ -61,9 +61,9 @@ static inline u64 identity__map_ip(struct map *map __used, u64 ip) | |||
61 | } | 61 | } |
62 | 62 | ||
63 | 63 | ||
64 | /* rip -> addr suitable for passing to `objdump --start-address=` */ | 64 | /* rip/ip <-> addr suitable for passing to `objdump --start-address=` */ |
65 | u64 map__rip_2objdump(struct map *map, u64 rip); | 65 | u64 map__rip_2objdump(struct map *map, u64 rip); |
66 | 66 | u64 map__objdump_2ip(struct map *map, u64 addr); | |
67 | 67 | ||
68 | struct symbol; | 68 | struct symbol; |
69 | struct mmap_event; | 69 | struct mmap_event; |