diff options
Diffstat (limited to 'tools/perf/util/event.c')
| -rw-r--r-- | tools/perf/util/event.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 7bad5c3fa7b7..52cf479bc593 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
| @@ -1295,12 +1295,9 @@ void thread__find_addr_location(struct thread *thread, | |||
| 1295 | * Callers need to drop the reference to al->thread, obtained in | 1295 | * Callers need to drop the reference to al->thread, obtained in |
| 1296 | * machine__findnew_thread() | 1296 | * machine__findnew_thread() |
| 1297 | */ | 1297 | */ |
| 1298 | int perf_event__preprocess_sample(const union perf_event *event, | 1298 | int machine__resolve(struct machine *machine, struct addr_location *al, |
| 1299 | struct machine *machine, | 1299 | struct perf_sample *sample) |
| 1300 | struct addr_location *al, | ||
| 1301 | struct perf_sample *sample) | ||
| 1302 | { | 1300 | { |
| 1303 | u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; | ||
| 1304 | struct thread *thread = machine__findnew_thread(machine, sample->pid, | 1301 | struct thread *thread = machine__findnew_thread(machine, sample->pid, |
| 1305 | sample->tid); | 1302 | sample->tid); |
| 1306 | 1303 | ||
| @@ -1315,11 +1312,11 @@ int perf_event__preprocess_sample(const union perf_event *event, | |||
| 1315 | * events, but for older perf.data files there was no such thing, so do | 1312 | * events, but for older perf.data files there was no such thing, so do |
| 1316 | * it now. | 1313 | * it now. |
| 1317 | */ | 1314 | */ |
| 1318 | if (cpumode == PERF_RECORD_MISC_KERNEL && | 1315 | if (sample->cpumode == PERF_RECORD_MISC_KERNEL && |
| 1319 | machine__kernel_map(machine) == NULL) | 1316 | machine__kernel_map(machine) == NULL) |
| 1320 | machine__create_kernel_maps(machine); | 1317 | machine__create_kernel_maps(machine); |
| 1321 | 1318 | ||
| 1322 | thread__find_addr_map(thread, cpumode, MAP__FUNCTION, sample->ip, al); | 1319 | thread__find_addr_map(thread, sample->cpumode, MAP__FUNCTION, sample->ip, al); |
| 1323 | dump_printf(" ...... dso: %s\n", | 1320 | dump_printf(" ...... dso: %s\n", |
| 1324 | al->map ? al->map->dso->long_name : | 1321 | al->map ? al->map->dso->long_name : |
| 1325 | al->level == 'H' ? "[hypervisor]" : "<not found>"); | 1322 | al->level == 'H' ? "[hypervisor]" : "<not found>"); |
| @@ -1395,16 +1392,12 @@ bool sample_addr_correlates_sym(struct perf_event_attr *attr) | |||
| 1395 | return false; | 1392 | return false; |
| 1396 | } | 1393 | } |
| 1397 | 1394 | ||
| 1398 | void perf_event__preprocess_sample_addr(union perf_event *event, | 1395 | void thread__resolve(struct thread *thread, struct addr_location *al, |
| 1399 | struct perf_sample *sample, | 1396 | struct perf_sample *sample) |
| 1400 | struct thread *thread, | ||
| 1401 | struct addr_location *al) | ||
| 1402 | { | 1397 | { |
| 1403 | u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; | 1398 | thread__find_addr_map(thread, sample->cpumode, MAP__FUNCTION, sample->addr, al); |
| 1404 | |||
| 1405 | thread__find_addr_map(thread, cpumode, MAP__FUNCTION, sample->addr, al); | ||
| 1406 | if (!al->map) | 1399 | if (!al->map) |
| 1407 | thread__find_addr_map(thread, cpumode, MAP__VARIABLE, | 1400 | thread__find_addr_map(thread, sample->cpumode, MAP__VARIABLE, |
| 1408 | sample->addr, al); | 1401 | sample->addr, al); |
| 1409 | 1402 | ||
| 1410 | al->cpu = sample->cpu; | 1403 | al->cpu = sample->cpu; |
