tracepoint: Print the function symbol when tracepoint_debug is set
authorHuang Shijie <shijie@os.amperecomputing.com>
Fri, 7 Mar 2025 03:38:58 +0000 (11:38 +0800)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Fri, 21 Mar 2025 19:30:10 +0000 (15:30 -0400)
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

Link: https://lore.kernel.org/20250307033858.4134-1-shijie@os.amperecomputing.com
Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/tracepoint.c

index 1848ce7e2976f596cb95f21c61504ba3ee7c5a15..62719d2941c9005f793b96dab469e9fa899a8126 100644 (file)
@@ -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 *