From: Sasha Levin <sashal@kernel.org>
To: Petr Pavlu <petr.pavlu@suse.com>
Cc: Sasha Levin <sashal@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Masahiro Yamada <masahiroy@kernel.org>,
Luis Chamberlain <mcgrof@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Richard Weinberger <richard@nod.at>,
Juergen Gross <jgross@suse.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
Jonathan Corbet <corbet@lwn.net>,
Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nsc@kernel.org>,
Daniel Gomez <da.gomez@kernel.org>,
Greg KH <gregkh@linuxfoundation.org>,
Petr Mladek <pmladek@suse.com>,
Steven Rostedt <rostedt@goodmis.org>, Kees Cook <kees@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Thorsten Leemhuis <linux@leemhuis.info>,
Vlastimil Babka <vbabka@kernel.org>, Helge Deller <deller@gmx.de>,
Randy Dunlap <rdunlap@infradead.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Vivian Wang <wangruikang@iscas.ac.cn>,
Zhen Lei <thunder.leizhen@huawei.com>,
Sami Tolvanen <samitolvanen@google.com>,
linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
linux-modules@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v7 1/4] kallsyms: embed source file:line info in kernel stack traces
Date: Tue, 28 Jul 2026 15:22:33 -0400 [thread overview]
Message-ID: <20260728192234.443651-1-sashal@kernel.org> (raw)
In-Reply-To: <e063df8e-3396-4ce9-9e66-27681af17fbc@suse.com>
On Mon, Jul 27, 2026 at 01:53:36PM +0200, Petr Pavlu wrote:
>I'm unable to reproduce these numbers. Could it be that the "stripped"
>vmlinux here still includes debug information?
Yup! the figure was taken from an unstripped vmlinux, so it was really
reporting DWARF size. Will fix, and state the recipe inline so it's
reproducible. Your numbers reproduce here exactly:
no lineinfo: 51.1 MiB
lineinfo, before 3/4: 69.1 MiB (+18.0 MiB / +35.3%)
lineinfo, after 3/4: 59.1 MiB ( +8.0 MiB / +15.7%)
>Nit: It might be worth explicitly mentioning libelf as a dependency [...]
>libelf and libdw are available on Arch in libelf, not elfutils.
>[...]
>Nit: Without more context, elfutils could be understood to mean the eu-*
>utilities [...]
>Nit: Again, I suggest mentioning both libelf and libdw for clarity.
Will fix.
>Nit: raw_offset can be declared as `unsigned long` [...] Similarly here,
>raw_min can be declared as `unsigned long`.
Will fix.
>The fallback output printed by echo includes -lz. Is this library really
>required by gen_lineinfo?
No. Will drop it.
>Does gen_lineinfo need to define own hash map [...] Could it be replaced by
>the shared functionality in scripts/include/hashtable.h and hash.h?
Will fix.
>Programs under the scripts/ directory normally use xmalloc() [...]
>The return value of strdup() should be checked for NULL.
Will fix.
>Nit: This can be simplified [...]
>Nit: scripts/include/array_size.h provides ARRAY_SIZE().
>These two lines are unnecessary as the same code is repeated below.
Will fix.
>I think using well-known top-level directories in the kernel tree [...] is
>rather fragile. [...] An alternative approach would be to pass $srctree and
>$objtree to gen_lineinfo
Agreed, will do it that way. Reading them with getenv() rather than -D:
kbuild already exports objtree, srctree and srcroot, and kconfig reads them
the same way, so no Makefile change is needed. Each gets registered both as
spelled and as realpath() so a symlinked tree matches either form, longest
match wins.
On your two caveats: realpath() is applied only to the roots, never to a
DWARF path, since generated sources need not exist when gen_lineinfo runs --
DWARF paths get purely lexical normalization. And srcroot is what covers M=
external modules, whose sources are under neither srctree nor objtree.
I'll keep kernel_dirs[] as a last-resort fallback rather than deleting it,
so an object built outside all three roots degrades as it does today instead
of dropping to a bare basename.
Worth noting the rework is not just cosmetic: 1136 of 4450 filenames here
carried a "./" prefix from DWARF directory entries (addr2line shows it too),
which normalization removes, folding the file count to 4354.
>I think using ELF_C_READ_MMAP is normally preferred. Even better, this
>could use ELF_C_READ_MMAP_PRIVATE to avoid opening modules as read-write
Will fix.
>The program has inconsistent error handling.
Will fix.
>This output clutters the build log [...] It should probably be hidden
>behind a --verbose option and printed only when KBUILD_VERBOSE=1.
Will fix.
Separately, working through your review turned up two bugs, both of which
v8 will fix with regression coverage:
- Module lineinfo blobs are malformed. emit_section_table() emits the .Lhdr
label before its .balign 4, so table_offset (.Lhdr - .Lroot) points into
the padding and the kernel reads the header 1-3 bytes early.
- The symbol-boundary check added in v7 over-corrected. Functions whose only
line row deduplicate() had collapsed, or that never had a row at their own
first byte, stopped resolving: 5017 here, including 1542 .cold fragments,
all __probestub_*, and the __ia32_sys_* compat wrappers. v6 printed these
correctly.
Thanks for the thorough review.
--
Thanks,
Sasha
next prev parent reply other threads:[~2026-07-28 19:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 16:38 [PATCH v7 0/4] kallsyms: embed source file:line info in kernel stack traces Sasha Levin
2026-07-09 16:38 ` [PATCH v7 1/4] " Sasha Levin
2026-07-27 11:53 ` Petr Pavlu
2026-07-28 19:22 ` Sasha Levin [this message]
2026-07-09 16:38 ` [PATCH v7 2/4] kallsyms: extend lineinfo to loadable modules Sasha Levin
2026-07-09 16:38 ` [PATCH v7 3/4] kallsyms: delta-compress lineinfo tables for ~2.7x size reduction Sasha Levin
2026-07-09 16:38 ` [PATCH v7 4/4] kallsyms: add KUnit tests for lineinfo feature Sasha Levin
2026-07-10 10:04 ` [PATCH v7 0/4] kallsyms: embed source file:line info in kernel stack traces Geert Uytterhoeven
2026-07-16 11:32 ` Sasha Levin
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=20260728192234.443651-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=da.gomez@kernel.org \
--cc=deller@gmx.de \
--cc=geert@linux-m68k.org \
--cc=gregkh@linuxfoundation.org \
--cc=jgross@suse.com \
--cc=kees@kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=linux@leemhuis.info \
--cc=masahiroy@kernel.org \
--cc=mcgrof@kernel.org \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=peterz@infradead.org \
--cc=petr.pavlu@suse.com \
--cc=pmladek@suse.com \
--cc=rdunlap@infradead.org \
--cc=richard@nod.at \
--cc=rostedt@goodmis.org \
--cc=samitolvanen@google.com \
--cc=thunder.leizhen@huawei.com \
--cc=torvalds@linux-foundation.org \
--cc=vbabka@kernel.org \
--cc=wangruikang@iscas.ac.cn \
/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