lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0e691a3e-1406-4496-b7e4-8b1679b59b5d@efficios.com>
Date: Thu, 6 Mar 2025 11:37:27 -0500
From: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To: Steven Rostedt <rostedt@...dmis.org>,
 Shijie Huang <shijie@...eremail.onmicrosoft.com>
Cc: Huang Shijie <shijie@...amperecomputing.com>,
 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-03-06 10:13, Steven Rostedt wrote:
> On Thu, 6 Mar 2025 11:37:38 +0800
> Shijie Huang <shijie@...eremail.onmicrosoft.com> wrote:
> 
>> 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
> 
> I'm fine either way. Mathieu, what's your preference?
> 
> Although the above shows a hashed %p. Is that even useful?

The hashed %p is not really useful.

I think we could just print %Sb

e.g. from core-api/printk-formats.rst:

         %pSb    versatile_init+0x0/0x110 [module_name ed5019fdf5e53be37cb1ba7899292d7e143b259e]

AFAIU, when the kallsyms_lookup_buildid fails, it prints the raw address instead
(see __sprint_symbol).

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ