diff mbox series

[v2] tracepoint: Print the function symbol when tracepoint_debug is set

Message ID 20250307033858.4134-1-shijie@os.amperecomputing.com (mailing list archive)
State New
Headers show
Series [v2] tracepoint: Print the function symbol when tracepoint_debug is set | expand

Commit Message

Huang Shijie March 7, 2025, 3:38 a.m. UTC
When tracepoint_debug is set, we may get the output in kernel log:
     [  380.013843] Probe 0 : 00000000f0d68cda

It is not readable, so change to print the function symbol.
After this patch, the output may becomes:
     [   55.225555] Probe 0 : perf_trace_sched_wakeup_template+0x0/0x20

Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com>
---
v1--> v2:
     Change from "%ps" to "%pSb".

     v1(resend): https://lkml.org/lkml/2025/3/5/109

---
 kernel/tracepoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
index abfd0ac1177f..3d958367f5fb 100644
--- a/kernel/tracepoint.c
+++ b/kernel/tracepoint.c
@@ -127,7 +127,7 @@  static void debug_print_probes(struct tracepoint_func *funcs)
 		return;
 
 	for (i = 0; funcs[i].func; i++)
-		printk(KERN_DEBUG "Probe %d : %p\n", i, funcs[i].func);
+		printk(KERN_DEBUG "Probe %d : %pSb\n", i, funcs[i].func);
 }
 
 static struct tracepoint_func *