Skip to contentSkip to conversation

tracepoint: Print the function symbol when tracepoint_debug is set

PATCH Superseded Huang Shijie 2 participants 2 messages Mar 4, 2025 Tracing

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tracepoint: Print the function symbol when tracepoint_debug is set

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:

     [   54.930567] Probe 0 : perf_trace_sched_wakeup_template
---
 kernel/tracepoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/tracepoint.c +1 -1
index 1848ce7e2976..82bef4b9400a 100644
@@ -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 : %ps\n", i, funcs[i].func);
 }
 
 static struct tracepoint_func *
Signature · 1 line
2.40.1
maintainer
#1 lore raw

Can you resend this with [email protected] please.

I probably should update the MAINTAINERS file and place this and include/linux/tracepoint.h under TRACING.

-- Steve

Quoted 26 lines · On Tue, 4 Mar 2025 18:18:43 +0800 Huang Shijie…

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:

     [   54.930567] Probe 0 : perf_trace_sched_wakeup_template
---
 kernel/tracepoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/tracepoint.c +1 -1
index 1848ce7e2976..82bef4b9400a 100644
@@ -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 : %ps\n", i, funcs[i].func);
 }
 
 static struct tracepoint_func *