Skip to content

Commit 4145310

Browse files
committed
perf machine: Fix insertion of PERF_RECORD_KSYMBOL related kernel maps
This was detected at the end of a 'perf record' session when build-id collection was enabled and thus the BPF programs put in place while the session was running, some even put in place by perf itself were processed and inserted, with some overlaps related to BPF trampolines and programs took place. Using maps__fixup_overlap_and_insert() instead of maps__insert() "fixes" the problem, in the sense that overlaps will be dealt with and then the consistency will be kept, but it would be interesting to fully understand why such overlaps take place and how to deal with them when doing symbol resolution. Reported-by: Arnaldo Carvalho de Melo <[email protected]> Suggested-by: Ian Rogers <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Reviewed-by: Ian Rogers <[email protected]> Link: https://lore.kernel.org/lkml/CAP-5=fXEEMFgPF2aZhKsfrY_En+qoqX20dWfuE_ad73Uxf0ZHQ@mail.gmail.com Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Namhyung Kim <[email protected]>
1 parent e0e4e0b commit 4145310

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/util/machine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ static int machine__process_ksymbol_register(struct machine *machine,
718718

719719
map__set_start(map, event->ksymbol.addr);
720720
map__set_end(map, map__start(map) + event->ksymbol.len);
721-
err = maps__insert(machine__kernel_maps(machine), map);
721+
err = maps__fixup_overlap_and_insert(machine__kernel_maps(machine), map);
722722
if (err) {
723723
err = -ENOMEM;
724724
goto out;

0 commit comments

Comments
 (0)