]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf tools: Mark split kallsyms DSOs as loaded
authorNamhyung Kim <namhyung@kernel.org>
Tue, 2 Dec 2025 23:57:14 +0000 (15:57 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 3 Dec 2025 05:59:14 +0000 (21:59 -0800)
The maps__split_kallsyms() will split symbols to module DSOs if it comes
from a module.  It also handled some unusual kernel symbols after modules
by creating new kernel maps like "[kernel].0".

But they are pseudo DSOs to have those unexpected symbols.  They should
not be considered as unloaded kernel DSOs.  Otherwise the dso__load()
for them will end up calling dso__load_kallsyms() and then
maps__split_kallsyms() again and again.

Reviewed-by: Ian Rogers <irogers@google.com>
Fixes: 2e538c4a1847291cf ("perf tools: Improve kernel/modules symbol lookup")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/symbol.c

index d8fc5ea77f849326729050be8818073464b2435d..5a38435d90c96092ceea645c47c97d8dcaf81d86 100644 (file)
@@ -972,6 +972,7 @@ static int maps__split_kallsyms(struct maps *kmaps, struct dso *dso, u64 delta,
                                return -1;
 
                        dso__set_kernel(ndso, dso__kernel(dso));
+                       dso__set_loaded(ndso);
 
                        curr_map = map__new2(pos->start, ndso);
                        if (curr_map == NULL) {