Re: [PATCH] maple_tree: fix tracepoint string pointers

From: Andrew Morton

Date: Thu Oct 30 2025 - 22:32:07 EST


On Thu, 30 Oct 2025 16:55:05 +0100 Martin Kaiser <martin@xxxxxxxxx> wrote:

> maple_tree tracepoints contain pointers to function names. Such a pointer
> is saved when a tracepoint logs an event. There's no guarantee that it's
> still valid when the event is parsed later and the pointer is dereferenced.

Oh.

> The kernel warns about these unsafe pointers.
>
> event 'ma_read' has unsafe pointer field 'fn'
> WARNING: kernel/trace/trace.c:3779 at ignore_event+0x1da/0x1e4
>
> Mark the function names as tracepoint_string() to fix the events.
>
> ...
>
> - trace_ma_op(__func__, mas);
> + trace_ma_op(TP_FCT, mas);
>

What could cause the storage for __func__ to disappear as you suggest?