linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ian Rogers <irogers@google.com>,
	James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org
Subject: [PATCH v2 2/5] perf tools: Fix split kallsyms DSO counting
Date: Tue,  2 Dec 2025 15:57:15 -0800	[thread overview]
Message-ID: <20251202235718.1018752-3-namhyung@kernel.org> (raw)
In-Reply-To: <20251202235718.1018752-1-namhyung@kernel.org>

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")
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 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


  parent reply	other threads:[~2025-12-02 23:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02 23:57 [PATCHSET v2 0/5] perf tools: Fix /proc/kallsyms map split Namhyung Kim
2025-12-02 23:57 ` [PATCH v2 1/5] perf tools: Mark split kallsyms DSOs as loaded Namhyung Kim
2025-12-02 23:57 ` Namhyung Kim [this message]
2025-12-02 23:57 ` [PATCH v2 3/5] perf tools: Fallback to initial kernel map properly Namhyung Kim
2025-12-02 23:57 ` [PATCH v2 4/5] perf tools: Use machine->root_dir to find /proc/kallsyms Namhyung Kim
2025-12-02 23:57 ` [PATCH v2 5/5] perf test: Add kallsyms split test Namhyung Kim
2025-12-03  1:12   ` Ian Rogers
2025-12-03 17:58 ` [PATCHSET v2 0/5] perf tools: Fix /proc/kallsyms map split Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251202235718.1018752-3-namhyung@kernel.org \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).