* [PATCH v2] tracing: Ignore .function on the function trace event
@ 2026-11-19 8:01 David Carlier
0 siblings, 0 replies; only message in thread
From: David Carlier @ 2026-11-19 8:01 UTC (permalink / raw)
To: Steven Rostedt, Masami Hiramatsu
Cc: Mathieu Desnoyers, Daniel Wade, linux-trace-kernel, linux-kernel,
stable
For the function event, parse_pred() handles the .function suffix
before the ftrace_event_is_function() case, so "ip.function == schedule"
builds a predicate with no regex. Setting it through perf then
dereferences the NULL pred->regex in ftrace_function_set_filter_pred().
The "ip" field of that event already takes a function name, so ignore
the suffix there and let the function event case handle it.
Fixes: cfb58e278c6a ("tracing/filters: Dynamically allocate filter_pred.regex")
Cc: stable@vger.kernel.org
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: David Carlier <devnexen@gmail.com>
---
Changes in v2:
- Ignore the suffix instead of rejecting it (Steven)
- Fixes: points at the commit that made regex a pointer (Daniel Wade)
- v1: https://lore.kernel.org/linux-trace-kernel/20261114195914.2678414-1-devnexen@gmail.com/
kernel/trace/trace_events_filter.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index c10951bcfc5f..2bbcc2abe794 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -1708,7 +1708,9 @@ static int parse_pred(const char *str, void *data,
/* See if the field is a kernel function name */
if ((len = str_has_prefix(str + i, ".function"))) {
- function = true;
+ /* Ignore if event is already a function */
+ if (!ftrace_event_is_function(call))
+ function = true;
i += len;
}
--
2.55.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-19 8:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 8:01 [PATCH v2] tracing: Ignore .function on the function trace event David Carlier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.