[PATCH] um: use %pB to print functions in stack traces

Johannes Berg johannes at sipsolutions.net
Wed Sep 23 23:50:01 PDT 2026


From: Johannes Berg <johannes.berg at intel.com>

In a stack trace we get the return address, so if the call is at
the end of a function, it can get printed as the next function,
e.g.

  vpanic+0x1d3/0x435
  abort+0x0/0x4e
  do_exit+0x29c/0xcb7
  sys_exit_group+0x0/0x16
  pid_child_should_wake+0x0/0x83

Use %pB like on x86, which resolves the name with address - 1,
in the same example I get:

  vpanic+0x1d3/0x435
  panic+0x55/0x55
  do_exit+0x29c/0xcb7
  do_group_exit+0xbe/0xbe
  sys_exit_group+0x16/0x16

Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
 arch/um/kernel/sysrq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c
index 13ee5666668d..5a2c28e09294 100644
--- a/arch/um/kernel/sysrq.c
+++ b/arch/um/kernel/sysrq.c
@@ -18,7 +18,7 @@ static void _print_addr(void *data, unsigned long address, int reliable)
 {
 	const char *loglvl = data;
 
-	printk("%s [<%08lx>] %s%pS\n", loglvl, address, reliable ? "" : "? ",
+	printk("%s [<%08lx>] %s%pB\n", loglvl, address, reliable ? "" : "? ",
 		(void *)address);
 }
 
-- 
2.55.0




More information about the linux-um mailing list