From: Nick Alcock <nick.alcock@oracle.com>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: Zhen Lei <thunder.leizhen@huawei.com>,
masahiroy@kernel.org, linux-modules@vger.kernel.org,
linux-kernel@vger.kernel.org, arnd@arndb.de,
akpm@linux-foundation.org, eugene.loh@oracle.com,
kris.van.hees@oracle.com, Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH v9 7/8] kallsyms: add /proc/kallmodsyms for text symbol disambiguation
Date: Mon, 14 Nov 2022 16:57:17 +0000 [thread overview]
Message-ID: <87r0y5v5hu.fsf@esperi.org.uk> (raw)
In-Reply-To: <Y3Bjy8UlZXdpWMYn@bombadil.infradead.org> (Luis Chamberlain's message of "Sat, 12 Nov 2022 19:26:03 -0800")
On 13 Nov 2022, Luis Chamberlain said:
> On Wed, Nov 09, 2022 at 01:41:31PM +0000, Nick Alcock wrote:
>> This helps disambiguate symbols with identical names when some are in
>> built-in modules are some are not, but if symbols are still ambiguous,
>> {object file names} are added as needed to disambiguate them.
>
> *Why* would we ever want to trouble ourselves with expanding all this
> data into the kernel? The commit log does a poor effort to describe
> any value-add doing this could ever have.
Er... the cover letter says:
> The whole point of symbols is that their names are unique: you can look up a
> symbol and get back a unique address, and vice versa. Alas, because
> /proc/kallsyms (rightly) reports all symbols, even hidden ones, it does not
> really satisfy this requirement. Large numbers of symbols are duplicated
> many times (just search for __list_del_entry!), and while usually these are
> just out-of-lined things defined in header files and thus all have the same
> implementation, it does make it needlessly hard to figure out which one is
> which in stack dumps, when tracing, and such things. Right now the kernel
> has no way at all to tell these apart, and nor has the user: their address
> differs and that's all. Which module did they come from? Which object
> file? We don't know. Figuring out which is which when tracing needs a
> combination of guesswork and luck. In discussions at LPC it became clear
> that this is not just annoying me but Steve Rostedt and others, so it's
> probably desirable to fix this.
This *is* the motivation. Previous iterations of this series only added
module names, but that doesn't disambiguate all symbols, and only
*partially* disambiguating symbols isn't really much use. If all symbols
can be completely unambiguously identified (via a triplet of (name,
module, translation unit), and mapped to a single address, you can be
sure that you can unambiguously cite a single such triple and get a
single address back, and vice versa: e.g. trace output could finally
give you names that you could be sure came from one specific place, and
thus often with one particular caller, even if that symbol appears in
fifty different places in the kernel with callers in fifty different
translation units that do quite different things.
(Plus, with notational additions in tracers, you could in future use
this to trace, say, only *one* instance of __list_del_entry, rather than
being forced to either trace all of them or none, or guess which entry
was which and do a tiresome binary search of repeated traces to get the
right one after lots of trials.)
(And also it's not actually that much data any more: 10KiB or so. :) )
I can add some of this to the commit log too if you like. (As noted in
earlier messages -- which you haven't yet had time to read -- I was
trying to keep that sort of duplication down, perhaps unwisely.)
>> I am not wedded to the name or format of /proc/kallmodsyms, but felt it
>> best to split it out of /proc/kallsyms to avoid breaking existing
>> kallsyms parsers.
>
> I'd like much more review from other parties other than Oracle on this then.
Well, yes. That's what these postings are all about. If I was supposed
to get review from someone else as well, I'm happy to add those people
to the Cc: of future iterations.
next prev parent reply other threads:[~2022-11-14 16:59 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 13:41 [PATCH PING v9] kallsyms: reliable symbol->address lookup with /proc/kallmodsyms Nick Alcock
2022-11-09 13:41 ` [PATCH v9 1/8] kbuild: bring back tristate.conf Nick Alcock
2022-11-10 3:56 ` Luis Chamberlain
2022-11-09 13:41 ` [PATCH v9 2/8] kbuild: add modules_thick.builtin Nick Alcock
2022-11-10 3:58 ` Luis Chamberlain
2022-11-11 13:47 ` Nick Alcock
2022-11-11 14:03 ` Nick Alcock
2022-11-11 15:12 ` Luis Chamberlain
2022-11-14 17:49 ` Nick Alcock
2022-11-15 21:21 ` Luis Chamberlain
2022-11-21 15:21 ` Nick Alcock
2022-11-21 19:12 ` Luis Chamberlain
2022-11-21 19:18 ` Luis Chamberlain
2022-11-21 21:14 ` Nick Alcock
2022-11-09 13:41 ` [PATCH v9 3/8] kbuild: generate an address ranges map at vmlinux link time Nick Alcock
2022-11-13 3:02 ` Luis Chamberlain
2022-11-14 16:48 ` Nick Alcock
2022-11-15 21:22 ` Luis Chamberlain
2022-11-16 16:06 ` Nick Alcock
2022-11-09 13:41 ` [PATCH v9 4/8] kallsyms: introduce sections needed to map symbols to built-in modules Nick Alcock
2022-11-13 3:15 ` Luis Chamberlain
2022-11-14 17:04 ` Nick Alcock
2022-11-15 11:47 ` Leizhen (ThunderTown)
2022-11-15 13:25 ` Nick Alcock
2022-11-15 19:58 ` Luis Chamberlain
2022-11-15 20:36 ` Luis Chamberlain
2022-11-09 13:41 ` [PATCH v9 5/8] kallsyms: optimize .kallsyms_modules* Nick Alcock
2022-11-09 13:41 ` [PATCH v9 6/8] kallsyms: distinguish text symbols fully using object file names Nick Alcock
2022-11-09 13:41 ` [PATCH v9 7/8] kallsyms: add /proc/kallmodsyms for text symbol disambiguation Nick Alcock
2022-11-13 3:26 ` Luis Chamberlain
2022-11-14 16:57 ` Nick Alcock [this message]
2022-11-15 21:24 ` Luis Chamberlain
2022-11-09 13:41 ` [PATCH v9 8/8] perf: proof-of-concept kallmodsyms support Nick Alcock
-- strict thread matches above, loose matches on Subject: below --
2022-10-27 19:57 [PATCH v9] kallsyms: reliable symbol->address lookup with /proc/kallmodsyms Nick Alcock
2022-10-27 19:57 ` [PATCH v9 7/8] kallsyms: add /proc/kallmodsyms for text symbol disambiguation Nick Alcock
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=87r0y5v5hu.fsf@esperi.org.uk \
--to=nick.alcock@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=eugene.loh@oracle.com \
--cc=kris.van.hees@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=mcgrof@kernel.org \
--cc=rostedt@goodmis.org \
--cc=thunder.leizhen@huawei.com \
/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).