diff options
Diffstat (limited to 'tools/perf/util/event.c')
-rw-r--r-- | tools/perf/util/event.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 2d860fbeb227..48e4b252f6ff 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -1489,8 +1489,8 @@ int perf_event__process(struct perf_tool *tool __maybe_unused, | |||
1489 | return machine__process_event(machine, event, sample); | 1489 | return machine__process_event(machine, event, sample); |
1490 | } | 1490 | } |
1491 | 1491 | ||
1492 | void __thread__find_map(struct thread *thread, u8 cpumode, enum map_type type, | 1492 | struct map *__thread__find_map(struct thread *thread, u8 cpumode, enum map_type type, |
1493 | u64 addr, struct addr_location *al) | 1493 | u64 addr, struct addr_location *al) |
1494 | { | 1494 | { |
1495 | struct map_groups *mg = thread->mg; | 1495 | struct map_groups *mg = thread->mg; |
1496 | struct machine *machine = mg->machine; | 1496 | struct machine *machine = mg->machine; |
@@ -1504,7 +1504,7 @@ void __thread__find_map(struct thread *thread, u8 cpumode, enum map_type type, | |||
1504 | 1504 | ||
1505 | if (machine == NULL) { | 1505 | if (machine == NULL) { |
1506 | al->map = NULL; | 1506 | al->map = NULL; |
1507 | return; | 1507 | return NULL; |
1508 | } | 1508 | } |
1509 | 1509 | ||
1510 | if (cpumode == PERF_RECORD_MISC_KERNEL && perf_host) { | 1510 | if (cpumode == PERF_RECORD_MISC_KERNEL && perf_host) { |
@@ -1532,7 +1532,7 @@ void __thread__find_map(struct thread *thread, u8 cpumode, enum map_type type, | |||
1532 | !perf_host) | 1532 | !perf_host) |
1533 | al->filtered |= (1 << HIST_FILTER__HOST); | 1533 | al->filtered |= (1 << HIST_FILTER__HOST); |
1534 | 1534 | ||
1535 | return; | 1535 | return NULL; |
1536 | } | 1536 | } |
1537 | try_again: | 1537 | try_again: |
1538 | al->map = map_groups__find(mg, type, al->addr); | 1538 | al->map = map_groups__find(mg, type, al->addr); |
@@ -1562,14 +1562,15 @@ try_again: | |||
1562 | map__load(al->map); | 1562 | map__load(al->map); |
1563 | al->addr = al->map->map_ip(al->map, al->addr); | 1563 | al->addr = al->map->map_ip(al->map, al->addr); |
1564 | } | 1564 | } |
1565 | |||
1566 | return al->map; | ||
1565 | } | 1567 | } |
1566 | 1568 | ||
1567 | void __thread__find_symbol(struct thread *thread, u8 cpumode, | 1569 | void __thread__find_symbol(struct thread *thread, u8 cpumode, |
1568 | enum map_type type, u64 addr, | 1570 | enum map_type type, u64 addr, |
1569 | struct addr_location *al) | 1571 | struct addr_location *al) |
1570 | { | 1572 | { |
1571 | __thread__find_map(thread, cpumode, type, addr, al); | 1573 | if (__thread__find_map(thread, cpumode, type, addr, al)) |
1572 | if (al->map != NULL) | ||
1573 | al->sym = map__find_symbol(al->map, al->addr); | 1574 | al->sym = map__find_symbol(al->map, al->addr); |
1574 | else | 1575 | else |
1575 | al->sym = NULL; | 1576 | al->sym = NULL; |
@@ -1668,8 +1669,7 @@ bool sample_addr_correlates_sym(struct perf_event_attr *attr) | |||
1668 | void thread__resolve(struct thread *thread, struct addr_location *al, | 1669 | void thread__resolve(struct thread *thread, struct addr_location *al, |
1669 | struct perf_sample *sample) | 1670 | struct perf_sample *sample) |
1670 | { | 1671 | { |
1671 | thread__find_map(thread, sample->cpumode, sample->addr, al); | 1672 | if (!thread__find_map(thread, sample->cpumode, sample->addr, al)) { |
1672 | if (!al->map) { | ||
1673 | __thread__find_map(thread, sample->cpumode, MAP__VARIABLE, | 1673 | __thread__find_map(thread, sample->cpumode, MAP__VARIABLE, |
1674 | sample->addr, al); | 1674 | sample->addr, al); |
1675 | } | 1675 | } |