.../admin-guide/kallsyms-lineinfo.rst | 31 + arch/x86/kernel/dumpstack.c | 6 +- include/linux/kallsyms.h | 9 + init/Kconfig | 40 ++ kernel/Makefile | 1 + kernel/kallsyms.c | 182 ++++++ kernel/kallsyms_internal.h | 6 + kernel/kallsyms_paraminfo_btf.c | 199 ++++++ lib/Kconfig.debug | 11 + lib/tests/Makefile | 3 + lib/tests/paraminfo_kunit.c | 249 ++++++++ scripts/Makefile | 3 + scripts/empty_paraminfo.S | 18 + scripts/gen_paraminfo.c | 597 ++++++++++++++++++ scripts/link-vmlinux.sh | 44 +- 15 files changed, 1393 insertions(+), 6 deletions(-) create mode 100644 kernel/kallsyms_paraminfo_btf.c create mode 100644 lib/tests/paraminfo_kunit.c create mode 100644 scripts/empty_paraminfo.S create mode 100644 scripts/gen_paraminfo.c
Building on the lineinfo series, this adds typed function parameter display to oops and WARN dumps. A build-time tool extracts parameter names and types from DWARF, and the kernel maps pt_regs to the calling convention at crash time. When BTF is available, struct pointer parameters are dereferenced and their members displayed. Example output from a WARN in a function receiving struct new_utsname * (kernel version info) and struct file * parameters: ------------[ cut here ]------------ WARNING: drivers/tty/sysrq.c:1209 at demo_crash+0xf/0x20 (drivers/tty/sysrq.c:1209) CPU: 2 UID: 0 PID: 323 Comm: bash RIP: 0010:demo_crash+0xf/0x20 (drivers/tty/sysrq.c:1209) ... RDI: ffffffffb8ca8d00 RSI: ffffa0a3c250acc0 ... Function parameters (paraminfo_demo_crash): uts (struct new_utsname *) = 0xffffffffb8ca8d00 .sysname = "Linux" .nodename = "localhost" .release = "7.0.0-rc2-00006-g3190..." .version = "#45 SMP PRE" file (struct file * ) = 0xffffa0a3c250acc0 .f_mode = (fmode_t)67993630 .f_op = (struct file_operations *)0xffffffffb7237620 .f_flags = (unsigned int)32769 .f_cred = (struct cred *)0xffffa0a3c2e06a80 .dentry = (struct dentry *)0xffffa0a3c0978cc0 .prev_pos = (loff_t)-1 Call Trace: <TASK> write_sysrq_trigger+0x96/0xb0 (drivers/tty/sysrq.c:1222) proc_reg_write+0x54/0xa0 (fs/proc/inode.c:330) vfs_write+0xc9/0x480 (fs/read_write.c:686) ksys_write+0x6e/0xe0 (fs/read_write.c:738) do_syscall_64+0xe2/0x570 (arch/x86/entry/syscall_64.c:62) entry_SYSCALL_64_after_hwframe+0x77/0x7f (arch/x86/entry/entry_64.S:121) Patch 1 adds the core paraminfo infrastructure (DWARF extraction, kernel-side lookup, register-to-parameter mapping, ~1-2 MB overhead). Patch 2 adds optional BTF-based struct rendering, gated behind CONFIG_KALLSYMS_PARAMINFO_BTF. Sasha Levin (2): kallsyms: show function parameter info in oops/WARN dumps kallsyms: add BTF-based deep parameter rendering in oops dumps .../admin-guide/kallsyms-lineinfo.rst | 31 + arch/x86/kernel/dumpstack.c | 6 +- include/linux/kallsyms.h | 9 + init/Kconfig | 40 ++ kernel/Makefile | 1 + kernel/kallsyms.c | 182 ++++++ kernel/kallsyms_internal.h | 6 + kernel/kallsyms_paraminfo_btf.c | 199 ++++++ lib/Kconfig.debug | 11 + lib/tests/Makefile | 3 + lib/tests/paraminfo_kunit.c | 249 ++++++++ scripts/Makefile | 3 + scripts/empty_paraminfo.S | 18 + scripts/gen_paraminfo.c | 597 ++++++++++++++++++ scripts/link-vmlinux.sh | 44 +- 15 files changed, 1393 insertions(+), 6 deletions(-) create mode 100644 kernel/kallsyms_paraminfo_btf.c create mode 100644 lib/tests/paraminfo_kunit.c create mode 100644 scripts/empty_paraminfo.S create mode 100644 scripts/gen_paraminfo.c -- 2.51.0
On Mon, Mar 23, 2026 at 12:48:55PM -0400, Sasha Levin wrote: > Building on the lineinfo series, this adds typed function parameter hi, could you please specify the exact tree/commit and point to the series this patchset is based on? thanks, jirka > display to oops and WARN dumps. A build-time tool extracts parameter > names and types from DWARF, and the kernel maps pt_regs to the calling > convention at crash time. When BTF is available, struct pointer > parameters are dereferenced and their members displayed. > > Example output from a WARN in a function receiving struct new_utsname * > (kernel version info) and struct file * parameters: > > ------------[ cut here ]------------ > WARNING: drivers/tty/sysrq.c:1209 at demo_crash+0xf/0x20 (drivers/tty/sysrq.c:1209) > CPU: 2 UID: 0 PID: 323 Comm: bash > RIP: 0010:demo_crash+0xf/0x20 (drivers/tty/sysrq.c:1209) > ... > RDI: ffffffffb8ca8d00 > RSI: ffffa0a3c250acc0 > ... > Function parameters (paraminfo_demo_crash): > uts (struct new_utsname *) = 0xffffffffb8ca8d00 > .sysname = "Linux" .nodename = "localhost" > .release = "7.0.0-rc2-00006-g3190..." .version = "#45 SMP PRE" > file (struct file * ) = 0xffffa0a3c250acc0 > .f_mode = (fmode_t)67993630 .f_op = (struct file_operations *)0xffffffffb7237620 > .f_flags = (unsigned int)32769 .f_cred = (struct cred *)0xffffa0a3c2e06a80 > .dentry = (struct dentry *)0xffffa0a3c0978cc0 > .prev_pos = (loff_t)-1 > Call Trace: > <TASK> > write_sysrq_trigger+0x96/0xb0 (drivers/tty/sysrq.c:1222) > proc_reg_write+0x54/0xa0 (fs/proc/inode.c:330) > vfs_write+0xc9/0x480 (fs/read_write.c:686) > ksys_write+0x6e/0xe0 (fs/read_write.c:738) > do_syscall_64+0xe2/0x570 (arch/x86/entry/syscall_64.c:62) > entry_SYSCALL_64_after_hwframe+0x77/0x7f (arch/x86/entry/entry_64.S:121) > > Patch 1 adds the core paraminfo infrastructure (DWARF extraction, > kernel-side lookup, register-to-parameter mapping, ~1-2 MB overhead). > Patch 2 adds optional BTF-based struct rendering, gated behind > CONFIG_KALLSYMS_PARAMINFO_BTF. > > Sasha Levin (2): > kallsyms: show function parameter info in oops/WARN dumps > kallsyms: add BTF-based deep parameter rendering in oops dumps > > .../admin-guide/kallsyms-lineinfo.rst | 31 + > arch/x86/kernel/dumpstack.c | 6 +- > include/linux/kallsyms.h | 9 + > init/Kconfig | 40 ++ > kernel/Makefile | 1 + > kernel/kallsyms.c | 182 ++++++ > kernel/kallsyms_internal.h | 6 + > kernel/kallsyms_paraminfo_btf.c | 199 ++++++ > lib/Kconfig.debug | 11 + > lib/tests/Makefile | 3 + > lib/tests/paraminfo_kunit.c | 249 ++++++++ > scripts/Makefile | 3 + > scripts/empty_paraminfo.S | 18 + > scripts/gen_paraminfo.c | 597 ++++++++++++++++++ > scripts/link-vmlinux.sh | 44 +- > 15 files changed, 1393 insertions(+), 6 deletions(-) > create mode 100644 kernel/kallsyms_paraminfo_btf.c > create mode 100644 lib/tests/paraminfo_kunit.c > create mode 100644 scripts/empty_paraminfo.S > create mode 100644 scripts/gen_paraminfo.c > > -- > 2.51.0 > >
On Tue, Mar 24, 2026 at 09:57:11AM +0100, Jiri Olsa wrote: >On Mon, Mar 23, 2026 at 12:48:55PM -0400, Sasha Levin wrote: >> Building on the lineinfo series, this adds typed function parameter > >hi, >could you please specify the exact tree/commit and point to the >series this patchset is based on? Yup, sorry, I should have noted that. This series is based on Andrew Morton's mm-nonmm-unstable branch (git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm mm-nonmm-unstable) since he took the base lineinfo patches and these build on code adjacent to it. There's no direct dependency between the two, but they touch the same parts of the code. -- Thanks, Sasha
On Mon, 23 Mar 2026 12:48:55 -0400 Sasha Levin <sashal@kernel.org> wrote: > Building on the lineinfo series, this adds typed function parameter > display to oops and WARN dumps. A build-time tool extracts parameter > names and types from DWARF, and the kernel maps pt_regs to the calling > convention at crash time. When BTF is available, struct pointer > parameters are dereferenced and their members displayed. mm.git is full and I'm seriously looking at loadshedded. Can we please leave this until next cycle, give your "kallsyms: embed source file:line info in kernel stack traces", v4 time to settle in?
On Mon, Mar 23, 2026 at 03:50:57PM -0700, Andrew Morton wrote: >On Mon, 23 Mar 2026 12:48:55 -0400 Sasha Levin <sashal@kernel.org> wrote: > >> Building on the lineinfo series, this adds typed function parameter >> display to oops and WARN dumps. A build-time tool extracts parameter >> names and types from DWARF, and the kernel maps pt_regs to the calling >> convention at crash time. When BTF is available, struct pointer >> parameters are dereferenced and their members displayed. > >mm.git is full and I'm seriously looking at loadshedded. Can we please >leave this until next cycle, give your "kallsyms: embed source file:line >info in kernel stack traces", v4 time to settle in? Definitely. If you want to ignore these, and related patches that might appear in the next couple of weeks, I'll plan to send them to you in an organized series after -rc1. -- Thanks, Sasha
On Mon, Mar 23, 2026 at 12:48:55PM -0400, Sasha Levin wrote: > Function parameters (paraminfo_demo_crash): > uts (struct new_utsname *) = 0xffffffffb8ca8d00 > .sysname = "Linux" .nodename = "localhost" > .release = "7.0.0-rc2-00006-g3190..." .version = "#45 SMP PRE" > file (struct file * ) = 0xffffa0a3c250acc0 > .f_mode = (fmode_t)67993630 .f_op = (struct file_operations *)0xffffffffb7237620 > .f_flags = (unsigned int)32769 .f_cred = (struct cred *)0xffffa0a3c2e06a80 > .dentry = (struct dentry *)0xffffa0a3c0978cc0 Should this be in crash's format? struct dentry ffffffffffff0000
On Mon, Mar 23, 2026 at 09:43:59PM +0300, Alexey Dobriyan wrote:
>On Mon, Mar 23, 2026 at 12:48:55PM -0400, Sasha Levin wrote:
>> Function parameters (paraminfo_demo_crash):
>> uts (struct new_utsname *) = 0xffffffffb8ca8d00
>> .sysname = "Linux" .nodename = "localhost"
>> .release = "7.0.0-rc2-00006-g3190..." .version = "#45 SMP PRE"
>> file (struct file * ) = 0xffffa0a3c250acc0
>> .f_mode = (fmode_t)67993630 .f_op = (struct file_operations *)0xffffffffb7237620
>> .f_flags = (unsigned int)32769 .f_cred = (struct cred *)0xffffa0a3c2e06a80
>> .dentry = (struct dentry *)0xffffa0a3c0978cc0
>
>Should this be in crash's format?
>
> struct dentry ffffffffffff0000
The format currently used comes from the kernel's own BTF show infrastructure.
crash's struct dentry ffffffffffff0000 syntax is specific to crash. drgn, GDB,
bpftool, and the kernel's own BTF rendering all use the (struct type *)0xaddr
notation we're already using. Adopting crash's format would make this output
inconsistent with all other BTF-based output in the kernel, and would also lose
the member name context (.dentry).
--
Thanks,
Sasha
© 2016 - 2026 Red Hat, Inc.