aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/trace/ftrace.c2
-rw-r--r--kernel/trace/trace.c3
-rw-r--r--kernel/trace/trace.h10
3 files changed, 14 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index c5049f54a275..57592a9dd630 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -48,7 +48,7 @@ int ftrace_enabled __read_mostly;
48static int last_ftrace_enabled; 48static int last_ftrace_enabled;
49 49
50/* set when tracing only a pid */ 50/* set when tracing only a pid */
51static int ftrace_pid_trace = -1; 51int ftrace_pid_trace = -1;
52 52
53/* Quick disabling of function tracer. */ 53/* Quick disabling of function tracer. */
54int function_trace_stop; 54int function_trace_stop;
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 710b39acd81b..1bd9574404e5 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1209,6 +1209,9 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
1209 int cpu; 1209 int cpu;
1210 int pc; 1210 int pc;
1211 1211
1212 if (!ftrace_trace_task(current))
1213 return 0;
1214
1212 if (!ftrace_graph_addr(trace->func)) 1215 if (!ftrace_graph_addr(trace->func))
1213 return 0; 1216 return 0;
1214 1217
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 41f026bfc9ed..95fff37ed970 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -541,6 +541,16 @@ print_graph_function(struct trace_iterator *iter)
541} 541}
542#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ 542#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
543 543
544extern int ftrace_pid_trace;
545
546static inline int ftrace_trace_task(struct task_struct *task)
547{
548 if (ftrace_pid_trace < 0)
549 return 1;
550
551 return test_tsk_trace_trace(task);
552}
553
544/* 554/*
545 * trace_iterator_flags is an enumeration that defines bit 555 * trace_iterator_flags is an enumeration that defines bit
546 * positions into trace_flags that controls the output. 556 * positions into trace_flags that controls the output.