From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v10 01/12] perf symbol: Fix symbols__fixup_end() for equal-start zero-sized aliases
Date: Tue, 24 Nov 2026 22:41:55 +0000 [thread overview]
Message-ID: <sashiko-outbox-232151@kernel.org> (raw)
In-Reply-To: <20261124223109.820609-2-irogers@google.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] perf symbol: inaccurate Fixes trailer for symbols__fixup_end()
alias fix
--
commit 68abd9e71787b2b2d18ca97e39f460dd4ecc3f6d
Author: Ian Rogers <irogers@google.com>
> perf symbol: Fix symbols__fixup_end() for equal-start zero-sized aliases
>
> When multiple zero-sized symbols share the same start address (such as
> STB_GLOBAL and STB_WEAK aliases in /proc/kallsyms), symbols__fixup_end()
> previously skipped earlier entries in the equal-start group and only
> updated end on the final entry before the next distinct address.
>
> Because __dso__load_kallsyms() and ELF loaders call symbols__fixup_end()
> before symbols__fixup_duplicate(), inflating only the last entry gave it
> a non-zero length while leaving earlier aliases at the same address with
> zero length. In choose_best_symbol(), the initial "Prefer a symbol with
> non zero length" check then unconditionally selected whichever alias
> happened to appear last, bypassing the STT_NOTYPE, STB_WEAK, STB_GLOBAL,
> underscore-count, and arch__choose_best_symbol() heuristics (for example
> dropping a global symbol when followed by a weak alias at the same
> address).
>
> Track group_start across each equal-start group in symbols__fixup_end():
> when no symbol at that start address already has a non-zero size
> (!addr_has_sized), synthesize end for every symbol in the group so
> subsequent deduplication compares equal-length aliases using binding and
> name heuristics (and so allow_aliases callers do not retain zero-length
> earlier aliases). When any symbol at that address already has an
> explicit non-zero size (addr_has_sized), leave zero-sized aliases at
> zero as before so choose_best_symbol() continues to prefer explicitly
> sized symbols.
>
> Fixes: 694bf407b061 ("perf symbols: Add some heuristics for choosing the best duplicate symbol")
> Signed-off-by: Ian Rogers <irogers@google.com>
[Severity: Low]
In 694bf407b061 ("perf symbols: Add some heuristics for choosing the best
duplicate symbol"), dso__load_kallsyms() and dso__load_sym() called
symbols__fixup_duplicate() before symbols__fixup_end(), so equal-start
zero-sized aliases still had zero size when choose_best_symbol() compared
them.
Should the Fixes tag reference 432746f8e0b6 ("perf symbols: Fixup symbol
sizes before picking best ones"), which reordered symbols__fixup_end()
ahead of symbols__fixup_duplicate(), or 73ffb62041a1 ("perf symbol: Switch
backing storage from rbtree to struct symbols array"), which introduced the
addr_has_sized skip in symbols__fixup_end()?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261124223109.820609-1-irogers@google.com?part=1
next prev parent reply other threads:[~2026-11-24 22:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 22:30 [PATCH v10 00/12] perf symbol: Sorted array optimizations and memory shrinking Ian Rogers
2026-11-24 22:30 ` [PATCH v10 01/12] perf symbol: Fix symbols__fixup_end() for equal-start zero-sized aliases Ian Rogers
2026-11-24 22:41 ` sashiko-bot [this message]
2026-11-24 22:30 ` [PATCH v10 02/12] perf symbol: Drop num_by_name and sorted_by_name from struct symbols Ian Rogers
2026-11-24 22:31 ` [PATCH v10 03/12] perf symbol: Replace sorted boolean with sorted_cnt prefix length Ian Rogers
2026-11-24 22:31 ` [PATCH v10 04/12] perf symbol: Add secondary sorted run for dso__insert_symbol() Ian Rogers
2026-11-24 22:31 ` [PATCH v10 05/12] perf test symbols: Add sorted insertion and equal-start alias tests Ian Rogers
2026-11-24 22:31 ` [PATCH v10 06/12] perf dso: Synchronize dso_cache access and make dso->loaded atomic Ian Rogers
2026-11-24 22:31 ` [PATCH v10 07/12] perf symbol: Add symbols__shrink() and symbols__try_delete_unannotated() Ian Rogers
2026-11-24 22:31 ` [PATCH v10 08/12] perf dso: Add dso__shrink() and dso__try_evict() Ian Rogers
2026-11-24 22:31 ` [PATCH v10 09/12] perf session: Add dsos, machine, and perf_session shrinking Ian Rogers
2026-11-24 22:31 ` [PATCH v10 10/12] perf test symbols: Add symbol and DSO shrinking tests Ian Rogers
2026-11-24 22:31 ` [PATCH v10 11/12] perf session: Add dso__session() and session-scoped allocation wrappers Ian Rogers
2026-11-24 22:31 ` [PATCH v10 12/12] perf test symbols: Add session allocation wrapper and lock contention tests Ian Rogers
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=sashiko-outbox-232151@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=irogers@google.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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