Skip to content

Commit 6c77221

Browse files
changbindurostedt
authored andcommitted
fgraph: Remove redundant ftrace_graph_notrace_addr() test
We already have tested it before. The second one should be removed. With this change, the performance should have little improvement. Link: http://lkml.kernel.org/r/[email protected] Cc: [email protected] Fixes: 9cd2992 ("fgraph: Have set_graph_notrace only affect function_graph tracer") Signed-off-by: Changbin Du <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent b1d45c2 commit 6c77221

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

kernel/trace/trace_functions_graph.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
137137
if (trace_recursion_test(TRACE_GRAPH_NOTRACE_BIT))
138138
return 0;
139139

140+
/*
141+
* Do not trace a function if it's filtered by set_graph_notrace.
142+
* Make the index of ret stack negative to indicate that it should
143+
* ignore further functions. But it needs its own ret stack entry
144+
* to recover the original index in order to continue tracing after
145+
* returning from the function.
146+
*/
140147
if (ftrace_graph_notrace_addr(trace->func)) {
141148
trace_recursion_set(TRACE_GRAPH_NOTRACE_BIT);
142149
/*
@@ -155,16 +162,6 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
155162
if (ftrace_graph_ignore_irqs())
156163
return 0;
157164

158-
/*
159-
* Do not trace a function if it's filtered by set_graph_notrace.
160-
* Make the index of ret stack negative to indicate that it should
161-
* ignore further functions. But it needs its own ret stack entry
162-
* to recover the original index in order to continue tracing after
163-
* returning from the function.
164-
*/
165-
if (ftrace_graph_notrace_addr(trace->func))
166-
return 1;
167-
168165
/*
169166
* Stop here if tracing_threshold is set. We only write function return
170167
* events to the ring buffer.

0 commit comments

Comments
 (0)