Re: [PATCH v2 3/3] tracing/kprobes: Use APIs that matches symbols without .XXX suffix

From: Steven Rostedt
Date: Wed Aug 07 2024 - 16:08:36 EST


On Wed, 7 Aug 2024 19:41:11 +0000
Song Liu <songliubraving@xxxxxxxx> wrote:


> It appears there are multiple APIs that may need change. For example, on gcc
> built kernel, /sys/kernel/tracing/available_filter_functions does not show
> the suffix:
>
> [root@(none)]# grep cmos_irq_enable /proc/kallsyms
> ffffffff81db5470 t __pfx_cmos_irq_enable.constprop.0
> ffffffff81db5480 t cmos_irq_enable.constprop.0
> ffffffff822dec6e t cmos_irq_enable.constprop.0.cold
>
> [root@(none)]# grep cmos_irq_enable /sys/kernel/tracing/available_filter_functions
> cmos_irq_enable

Strange, I don't see that:

~# grep cmos_irq_enable /proc/kallsyms
ffffffff8f4b2500 t __pfx_cmos_irq_enable.constprop.0
ffffffff8f4b2510 t cmos_irq_enable.constprop.0

~# grep cmos_irq_enable /sys/kernel/tracing/available_filter_functions
cmos_irq_enable.constprop.0

-- Steve

>
> perf-probe uses _text+<offset> for such cases:
>
> [root@(none)]# cat /sys/kernel/tracing/kprobe_events
> p:probe/cmos_irq_enable _text+14374016
>
> I am not sure which APIs do we need to change here.
>
> Thanks,
> Song
>
>