diff options
Diffstat (limited to 'tools/perf/util/event.c')
-rw-r--r-- | tools/perf/util/event.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 6635fcd11ca5..3c1b8a632101 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -35,22 +35,6 @@ const char *perf_event__name(unsigned int id) | |||
35 | return perf_event__names[id]; | 35 | return perf_event__names[id]; |
36 | } | 36 | } |
37 | 37 | ||
38 | int perf_sample_size(u64 sample_type) | ||
39 | { | ||
40 | u64 mask = sample_type & PERF_SAMPLE_MASK; | ||
41 | int size = 0; | ||
42 | int i; | ||
43 | |||
44 | for (i = 0; i < 64; i++) { | ||
45 | if (mask & (1ULL << i)) | ||
46 | size++; | ||
47 | } | ||
48 | |||
49 | size *= sizeof(u64); | ||
50 | |||
51 | return size; | ||
52 | } | ||
53 | |||
54 | static struct perf_sample synth_sample = { | 38 | static struct perf_sample synth_sample = { |
55 | .pid = -1, | 39 | .pid = -1, |
56 | .tid = -1, | 40 | .tid = -1, |
@@ -553,9 +537,18 @@ static int perf_event__process_kernel_mmap(union perf_event *event, | |||
553 | goto out_problem; | 537 | goto out_problem; |
554 | 538 | ||
555 | perf_event__set_kernel_mmap_len(event, machine->vmlinux_maps); | 539 | perf_event__set_kernel_mmap_len(event, machine->vmlinux_maps); |
556 | perf_session__set_kallsyms_ref_reloc_sym(machine->vmlinux_maps, | 540 | |
557 | symbol_name, | 541 | /* |
558 | event->mmap.pgoff); | 542 | * Avoid using a zero address (kptr_restrict) for the ref reloc |
543 | * symbol. Effectively having zero here means that at record | ||
544 | * time /proc/sys/kernel/kptr_restrict was non zero. | ||
545 | */ | ||
546 | if (event->mmap.pgoff != 0) { | ||
547 | perf_session__set_kallsyms_ref_reloc_sym(machine->vmlinux_maps, | ||
548 | symbol_name, | ||
549 | event->mmap.pgoff); | ||
550 | } | ||
551 | |||
559 | if (machine__is_default_guest(machine)) { | 552 | if (machine__is_default_guest(machine)) { |
560 | /* | 553 | /* |
561 | * preload dso of guest kernel and modules | 554 | * preload dso of guest kernel and modules |