Re: [PATCH 2/5] perf tools: Fix split kallsyms DSO counting

From: Ian Rogers
Date: Tue Dec 02 2025 - 15:57:22 EST


On Tue, Dec 2, 2025 at 12:16 AM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>
> 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.
>
> Fixes: 2e538c4a1847291cf ("perf tools: Improve kernel/modules symbol lookup")
> Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>

Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>

Thanks,
Ian

> ---
> tools/perf/util/symbol.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> index 5a38435d90c96092..8eea49c50453d13a 100644
> --- a/tools/perf/util/symbol.c
> +++ b/tools/perf/util/symbol.c
> @@ -960,11 +960,11 @@ static int maps__split_kallsyms(struct maps *kmaps, struct dso *dso, u64 delta,
> if (dso__kernel(dso) == 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);
> map__zput(curr_map);
> --
> 2.52.0.158.g65b55ccf14-goog
>