[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251126173552333XoJZN20143fWbsdTEtWoU@zte.com.cn>
Date: Wed, 26 Nov 2025 17:35:52 +0800 (CST)
From: <wang.yaxin@....com.cn>
To: <wang.yaxin@....com.cn>
Cc: <rostedt@...dmis.org>, <mhiramat@...nel.org>, <mark.rutland@....com>,
<mathieu.desnoyers@...icios.com>, <linux-kernel@...r.kernel.org>,
<linux-trace-kernel@...r.kernel.org>, <hu.shengming@....com.cn>,
<zhang.run@....com.cn>, <yang.yang29@....com.cn>
Subject: [PATCH v2 3/3] fgraph: Remove coarse PID filtering from graph_entry()
From: Shengming Hu <hu.shengming@....com.cn>
With PID filtering working via ftrace_pids_enabled() and fgraph_pid_func,
the coarse-grained ftrace_trace_task() check in graph_entry() is obsolete.
It was only a fallback for uninitialized op->private (now fixed), and its
removal ensures consistent PID filtering with standard function tracing.
Also remove unused ftrace_trace_task() definition from trace.h.
Signed-off-by: Shengming Hu <hu.shengming@....com.cn>
---
kernel/trace/trace.h | 9 ---------
kernel/trace/trace_functions_graph.c | 3 ---
2 files changed, 12 deletions(-)
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 58be6d741..2bc985739 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -1159,11 +1159,6 @@ struct ftrace_func_command {
char *params, int enable);
};
extern bool ftrace_filter_param __initdata;
-static inline int ftrace_trace_task(struct trace_array *tr)
-{
- return this_cpu_read(tr->array_buffer.data->ftrace_ignore_pid) !=
- FTRACE_PID_IGNORE;
-}
extern int ftrace_is_dead(void);
int ftrace_create_function_files(struct trace_array *tr,
struct dentry *parent);
@@ -1181,10 +1176,6 @@ void ftrace_clear_pids(struct trace_array *tr);
int init_function_trace(void);
void ftrace_pid_follow_fork(struct trace_array *tr, bool enable);
#else
-static inline int ftrace_trace_task(struct trace_array *tr)
-{
- return 1;
-}
static inline int ftrace_is_dead(void) { return 0; }
static inline int
ftrace_create_function_files(struct trace_array *tr,
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 44d5dc503..cb9aef060 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -233,9 +233,6 @@ static int graph_entry(struct ftrace_graph_ent *trace,
return 1;
}
- if (!ftrace_trace_task(tr))
- return 0;
-
if (ftrace_graph_ignore_func(gops, trace))
return 0;
--
2.25.1
Powered by blists - more mailing lists