mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
fgraph: Have set_graph_notrace only affect function_graph tracer
In order to make the function graph infrastructure more generic, there can not be code specific for the function_graph tracer in the generic code. This includes the set_graph_notrace logic, that stops all graph calls when a function in the set_graph_notrace is hit. By using the trace_recursion mask, we can use a bit in the current task_struct to implement the notrace code, and move the logic out of fgraph.c and into trace_functions_graph.c and keeps it affecting only the tracer and not all call graph callbacks. Acked-by: Namhyung Kim <namhyung@kernel.org> Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
@@ -188,6 +188,18 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
|
||||
int cpu;
|
||||
int pc;
|
||||
|
||||
if (trace_recursion_test(TRACE_GRAPH_NOTRACE_BIT))
|
||||
return 0;
|
||||
|
||||
if (ftrace_graph_notrace_addr(trace->func)) {
|
||||
trace_recursion_set(TRACE_GRAPH_NOTRACE_BIT);
|
||||
/*
|
||||
* Need to return 1 to have the return called
|
||||
* that will clear the NOTRACE bit.
|
||||
*/
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!ftrace_trace_task(tr))
|
||||
return 0;
|
||||
|
||||
@@ -290,6 +302,11 @@ void trace_graph_return(struct ftrace_graph_ret *trace)
|
||||
|
||||
ftrace_graph_addr_finish(trace);
|
||||
|
||||
if (trace_recursion_test(TRACE_GRAPH_NOTRACE_BIT)) {
|
||||
trace_recursion_clear(TRACE_GRAPH_NOTRACE_BIT);
|
||||
return;
|
||||
}
|
||||
|
||||
local_irq_save(flags);
|
||||
cpu = raw_smp_processor_id();
|
||||
data = per_cpu_ptr(tr->trace_buffer.data, cpu);
|
||||
@@ -315,6 +332,11 @@ static void trace_graph_thresh_return(struct ftrace_graph_ret *trace)
|
||||
{
|
||||
ftrace_graph_addr_finish(trace);
|
||||
|
||||
if (trace_recursion_test(TRACE_GRAPH_NOTRACE_BIT)) {
|
||||
trace_recursion_clear(TRACE_GRAPH_NOTRACE_BIT);
|
||||
return;
|
||||
}
|
||||
|
||||
if (tracing_thresh &&
|
||||
(trace->rettime - trace->calltime < tracing_thresh))
|
||||
return;
|
||||
|
Reference in New Issue
Block a user