aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_functions_graph.c
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2016-12-08 19:28:28 -0500
committerSteven Rostedt <rostedt@goodmis.org>2016-12-09 09:21:35 -0500
commit1a41442864e35bff859582fe9c5d051d0b1040ba (patch)
tree2936a094e5539875fca532d424291bcd9eef8c0e /kernel/trace/trace_functions_graph.c
parent794de08a16cf1fc1bf785dc48f66d36218cf6d88 (diff)
tracing/fgraph: Have wakeup and irqsoff tracers ignore graph functions too
Currently both the wakeup and irqsoff traces do not handle set_graph_notrace well. The ftrace infrastructure will ignore the return paths of all functions leaving them hanging without an end: # echo '*spin*' > set_graph_notrace # cat trace [...] _raw_spin_lock() { preempt_count_add() { do_raw_spin_lock() { update_rq_clock(); Where the '*spin*' functions should have looked like this: _raw_spin_lock() { preempt_count_add(); do_raw_spin_lock(); } update_rq_clock(); Instead, have the wakeup and irqsoff tracers ignore the functions that are set by the set_graph_notrace like the function_graph tracer does. Move the logic in the function_graph tracer into a header to allow wakeup and irqsoff tracers to use it as well. Cc: Namhyung Kim <namhyung.kim@lge.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_functions_graph.c')
-rw-r--r--kernel/trace/trace_functions_graph.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 566f7327c3aa..d56123cdcc89 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -65,7 +65,7 @@ struct fgraph_data {
65 65
66#define TRACE_GRAPH_INDENT 2 66#define TRACE_GRAPH_INDENT 2
67 67
68static unsigned int max_depth; 68unsigned int fgraph_max_depth;
69 69
70static struct tracer_opt trace_opts[] = { 70static struct tracer_opt trace_opts[] = {
71 /* Display overruns? (for self-debug purpose) */ 71 /* Display overruns? (for self-debug purpose) */
@@ -384,10 +384,10 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
384 if (!ftrace_trace_task(tr)) 384 if (!ftrace_trace_task(tr))
385 return 0; 385 return 0;
386 386
387 /* trace it when it is-nested-in or is a function enabled. */ 387 if (ftrace_graph_ignore_func(trace))
388 if ((!(trace->depth || ftrace_graph_addr(trace->func)) || 388 return 0;
389 ftrace_graph_ignore_irqs()) || (trace->depth < 0) || 389
390 (max_depth && trace->depth >= max_depth)) 390 if (ftrace_graph_ignore_irqs())
391 return 0; 391 return 0;
392 392
393 /* 393 /*
@@ -1500,7 +1500,7 @@ graph_depth_write(struct file *filp, const char __user *ubuf, size_t cnt,
1500 if (ret) 1500 if (ret)
1501 return ret; 1501 return ret;
1502 1502
1503 max_depth = val; 1503 fgraph_max_depth = val;
1504 1504
1505 *ppos += cnt; 1505 *ppos += cnt;
1506 1506
@@ -1514,7 +1514,7 @@ graph_depth_read(struct file *filp, char __user *ubuf, size_t cnt,
1514 char buf[15]; /* More than enough to hold UINT_MAX + "\n"*/ 1514 char buf[15]; /* More than enough to hold UINT_MAX + "\n"*/
1515 int n; 1515 int n;
1516 1516
1517 n = sprintf(buf, "%d\n", max_depth); 1517 n = sprintf(buf, "%d\n", fgraph_max_depth);
1518 1518
1519 return simple_read_from_buffer(ubuf, cnt, ppos, buf, n); 1519 return simple_read_from_buffer(ubuf, cnt, ppos, buf, n);
1520} 1520}