diff options
Diffstat (limited to 'tools/perf/util/map.c')
-rw-r--r-- | tools/perf/util/map.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index f6626cc3df2e..af5805f51314 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -210,3 +210,15 @@ size_t map__fprintf(struct map *self, FILE *fp) | |||
210 | return fprintf(fp, " %Lx-%Lx %Lx %s\n", | 210 | return fprintf(fp, " %Lx-%Lx %Lx %s\n", |
211 | self->start, self->end, self->pgoff, self->dso->name); | 211 | self->start, self->end, self->pgoff, self->dso->name); |
212 | } | 212 | } |
213 | |||
214 | /* | ||
215 | * objdump wants/reports absolute IPs for ET_EXEC, and RIPs for ET_DYN. | ||
216 | * map->dso->adjust_symbols==1 for ET_EXEC-like cases. | ||
217 | */ | ||
218 | u64 map__rip_2objdump(struct map *map, u64 rip) | ||
219 | { | ||
220 | u64 addr = map->dso->adjust_symbols ? | ||
221 | map->unmap_ip(map, rip) : /* RIP -> IP */ | ||
222 | rip; | ||
223 | return addr; | ||
224 | } | ||