]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
perf tools: Fix split kallsyms DSO counting
authorNamhyung Kim <namhyung@kernel.org>
Tue, 2 Dec 2025 23:57:15 +0000 (15:57 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:09:36 +0000 (13:09 +0100)
[ Upstream commit ad0b9c4865b98dc37f4d606d26b1c19808796805 ]

It's counted twice as it's increased after calling maps__insert().  I
guess we want to increase it only after it's added properly.

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

index 80c54196e0e4f98dead8b995e52337391724b516..b48d237124e12153964927f83270f60fb4a82088 100644 (file)
@@ -893,11 +893,11 @@ static int maps__split_kallsyms(struct maps *kmaps, struct dso *dso, u64 delta,
                        if (dso->kernel == DSO_SPACE__KERNEL_GUEST)
                                snprintf(dso_name, sizeof(dso_name),
                                        "[guest.kernel].%d",
-                                       kernel_range++);
+                                       kernel_range);
                        else
                                snprintf(dso_name, sizeof(dso_name),
                                        "[kernel].%d",
-                                       kernel_range++);
+                                       kernel_range);
 
                        ndso = dso__new(dso_name);
                        if (ndso == NULL)