aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index b0623ac785a2..e76384894147 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -243,6 +243,11 @@ static void ftrace_sync_ipi(void *data)
243 243
244#ifdef CONFIG_FUNCTION_GRAPH_TRACER 244#ifdef CONFIG_FUNCTION_GRAPH_TRACER
245static void update_function_graph_func(void); 245static void update_function_graph_func(void);
246
247/* Both enabled by default (can be cleared by function_graph tracer flags */
248static bool fgraph_sleep_time = true;
249static bool fgraph_graph_time = true;
250
246#else 251#else
247static inline void update_function_graph_func(void) { } 252static inline void update_function_graph_func(void) { }
248#endif 253#endif
@@ -917,7 +922,7 @@ static void profile_graph_return(struct ftrace_graph_ret *trace)
917 922
918 calltime = trace->rettime - trace->calltime; 923 calltime = trace->rettime - trace->calltime;
919 924
920 if (!(trace_flags & TRACE_ITER_GRAPH_TIME)) { 925 if (!fgraph_graph_time) {
921 int index; 926 int index;
922 927
923 index = trace->depth; 928 index = trace->depth;
@@ -5639,6 +5644,16 @@ static struct ftrace_ops graph_ops = {
5639 ASSIGN_OPS_HASH(graph_ops, &global_ops.local_hash) 5644 ASSIGN_OPS_HASH(graph_ops, &global_ops.local_hash)
5640}; 5645};
5641 5646
5647void ftrace_graph_sleep_time_control(bool enable)
5648{
5649 fgraph_sleep_time = enable;
5650}
5651
5652void ftrace_graph_graph_time_control(bool enable)
5653{
5654 fgraph_graph_time = enable;
5655}
5656
5642int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace) 5657int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace)
5643{ 5658{
5644 return 0; 5659 return 0;
@@ -5707,7 +5722,7 @@ ftrace_graph_probe_sched_switch(void *ignore,
5707 * Does the user want to count the time a function was asleep. 5722 * Does the user want to count the time a function was asleep.
5708 * If so, do not update the time stamps. 5723 * If so, do not update the time stamps.
5709 */ 5724 */
5710 if (trace_flags & TRACE_ITER_SLEEP_TIME) 5725 if (fgraph_sleep_time)
5711 return; 5726 return;
5712 5727
5713 timestamp = trace_clock_local(); 5728 timestamp = trace_clock_local();