[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b098cbdf-394b-4f20-9dcd-393ad1b734b7@amperemail.onmicrosoft.com>
Date: Thu, 6 Mar 2025 11:37:38 +0800
From: Shijie Huang <shijie@...eremail.onmicrosoft.com>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Huang Shijie <shijie@...amperecomputing.com>, rostedt@...dmis.org
Cc: patches@...erecomputing.com, cl@...ux.com, yang@...amperecomputing.com,
peterz@...radead.org, jpoimboe@...nel.org, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH resend ] tracepoint: Print the function symbol when
tracepoint_debug is set
On 2025/3/5 21:53, Mathieu Desnoyers wrote:
> On 2025-03-04 20:55, Huang Shijie wrote:
>> 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
>
> What would it print if the address is corrupted ?
>
> Perhaps we could do like the backtrace code and print e.g.
>
> [<00000000f0d68cda>] perf_trace_sched_wakeup_template+0xNN/0xMM
If we want this format, we can change code to:
---
kernel/tracepoint.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
index abfd0ac1177f..5a5041f32cc8 100644
--- a/kernel/tracepoint.c
+++ b/kernel/tracepoint.c
@@ -127,7 +127,8 @@ 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 : [ %p ] %pS\n",
+ i, funcs[i].func, funcs[i].func);
}
The output will look like:
[ 63.818829] Probe 0 : [ 0000000032848d41 ]
perf_trace_sched_wakeup_template+0x0/0x20
[ 63.819287] Probe 0 : [ 00000000fe8cca4d ]
perf_trace_sched_switch+0x0/0x20
[ 65.325638] Probe 0 : [ 0000000032848d41 ]
perf_trace_sched_wakeup_template+0x0/0x20
[ 65.695631] Probe 0 : [ 00000000fe8cca4d ]
perf_trace_sched_switch+0x0/0x20
Thanks
Huang Shijie
Powered by blists - more mailing lists