On 3/6/26 06:31, Randy Dunlap wrote:
On 3/5/26 2:26 PM, Helge Deller wrote:
On 3/5/26 03:18, Sasha Levin wrote:
On Wed, Mar 04, 2026 at 09:17:37PM +0100, Helge Deller wrote:
On 3/3/26 19:21, Sasha Levin wrote:
Add CONFIG_KALLSYMS_LINEINFO, which embeds a compact address-to-line
lookup table in the kernel image so stack traces directly print source
file and line number information:

   root@localhost:~# echo c > /proc/sysrq-trigger
   [   11.201987] sysrq: Trigger a crash
   [   11.202831] Kernel panic - not syncing: sysrq triggered crash
   [   11.206218] Call Trace:
   [   11.206501]  <TASK>
   [   11.206749]  dump_stack_lvl+0x5d/0x80 (lib/dump_stack.c:94)
   [   11.207403]  vpanic+0x36e/0x620 (kernel/panic.c:650)
   [   11.208565]  ? __lock_acquire+0x465/0x2240 (kernel/locking/lockdep.c:4674)
   [   11.209324]  panic+0xc9/0xd0 (kernel/panic.c:787)
   [   11.211873]  ? find_held_lock+0x2b/0x80 (kernel/locking/lockdep.c:5350)
   [   11.212597]  ? lock_release+0xd3/0x300 (kernel/locking/lockdep.c:5535)
   [   11.213312]  sysrq_handle_crash+0x1a/0x20 (drivers/tty/sysrq.c:154)
   [   11.214005]  __handle_sysrq.cold+0x66/0x256 (drivers/tty/sysrq.c:611)
   [   11.214712]  write_sysrq_trigger+0x65/0x80 (drivers/tty/sysrq.c:1221)
   [   11.215424]  proc_reg_write+0x1bd/0x3c0 (fs/proc/inode.c:330)
   [   11.216061]  vfs_write+0x1c6/0xff0 (fs/read_write.c:686)
   [   11.218848]  ksys_write+0xfa/0x200 (fs/read_write.c:740)
   [   11.222394]  do_syscall_64+0xf3/0x690 (arch/x86/entry/syscall_64.c:63)
   [   11.223942]  entry_SYSCALL_64_after_hwframe+0x77/0x7f 
(arch/x86/entry/entry_64.S:121)

As mentioned in the other series, I really like this patch series.

I tested this series again on the parisc architecture, and the relative
directories are now stripped with this version of your patch.
IIRC, the previous patch did show the subdirectory names.
[  132.840382] Backtrace:
[  132.840382]  [<104254d8>] show_stack+0x50/0x64 (traps.c:212)
[  132.840382]  [<1041c0c8>] dump_stack_lvl+0x6c/0xa0 (dump_stack.c:122)
[  132.840382]  [<1041c118>] dump_stack+0x1c/0x2c (dump_stack.c:130)
[  132.840382]  [<10402218>] vpanic+0x154/0x344 (panic.c:550)
[  132.840382]  [<10402438>] panic+0x30/0x34 (panic.c:787)
[  132.840382]  [<10bebea8>] sysrq_handle_crash+0x30/0x34 (rcupdate.h:110)
[  132.840382]  [<10bec720>] __handle_sysrq+0xc0/0x1e4 (preempt.h:14)

Ugh... Can you confirm that you've build this kernel with O=?

Yes. Both -Os and -O2 do not show the relative path.

Helge,
I'm fairly sure that Sasha meant with O=build_dir_name,
not -O for optimization levels.

Ah, ok.
Anyway, I checked again.
I did *not* used a "O=..." parameter in either case.
I recompiled again with the RFC patch, and here the relative paths show up 
again (even without O=):
root@debian:~# echo c > /proc/sysrq-trigger
[  121.172011] sysrq: Trigger a crash
[  121.173986] Kernel panic - not syncing: sysrq triggered crash
[  121.176141] CPU: 1 UID: 0 PID: 382 Comm: bash Not tainted 7.0.0-rc2-32bit+ 
#2971 VOLUNTARY
[  121.177041] Hardware name: 9000/778/B160L
[  121.178092] Backtrace:
[  121.178533]  [<104254d8>] show_stack+0x50/0x64 (kernel/traps.c:212)
[  121.181408]  [<1041c0c8>] dump_stack_lvl+0x6c/0xa0 (lib/dump_stack.c:122)
[  121.182145]  [<1041c118>] dump_stack+0x1c/0x2c (lib/dump_stack.c:130)
[  121.182779]  [<10402218>] vpanic+0x154/0x344 (kernel/panic.c:552)
[  121.182871]  [<10402438>] panic+0x30/0x34 (kernel/panic.c:787)
[  121.182871]  [<10beb5a0>] sysrq_handle_crash+0x30/0x34 
(drivers/tty/sysrq.c:154)
[  121.182871]  [<10bebe18>] __handle_sysrq+0xc0/0x1e4 
(arch/parisc/include/asm/current.h:13)
[  121.182871]  [<10bec7c0>] write_sysrq_trigger+0x8c/0xcc 
(drivers/tty/sysrq.c:1223)
[  121.182871]  [<106ba460>] proc_reg_write+0xd0/0x10c (fs/proc/inode.c:343)
[  121.182871]  [<1060faf0>] vfs_write+0xb8/0x46c (fs/read_write.c:691)
[  121.182871]  [<1061005c>] ksys_write+0x78/0x118 (fs/read_write.c:741)
[  121.182871]  [<10610114>] sys_write+0x18/0x28 (fs/read_write.c:748)
[  121.182871]  [<10421334>] syscall_exit+0x0/0x10 (kernel/entry.S:1722)

Helge
The RFC had a dirty dirty hack around how we turn these absolute paths into
relative ones, but I tried to re-do it so no one would yell at me :)

Seems it is needed...

Reply via email to