aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_functions_graph.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-09-11 13:55:35 -0400
committerSteven Rostedt <rostedt@goodmis.org>2009-09-11 13:55:35 -0400
commit637e7e864103a7a68c1ce43ada27dfc25c0d113f (patch)
tree7ef0eadf41d79b07bc19f62b1355f7c824d781fd /kernel/trace/trace_functions_graph.c
parent48659d31195bb76d688e99dabd816c5472fb1656 (diff)
tracing: add lock depth to entries
This patch adds the lock depth of the big kernel lock to the generic entry header. This way we can see the depth of the lock and help in removing the BKL. Example: # _------=> CPU# # / _-----=> irqs-off # | / _----=> need-resched # || / _---=> hardirq/softirq # ||| / _--=> preempt-depth # |||| /_--=> lock-depth # |||||/ delay # cmd pid |||||| time | caller # \ / |||||| \ | / <idle>-0 2.N..3 5902255250us+: lock_acquire: read rcu_read_lock <idle>-0 2.N..3 5902255253us+: lock_release: rcu_read_lock <idle>-0 2dN..3 5902255257us+: lock_acquire: xtime_lock <idle>-0 2dN..4 5902255259us : lock_acquire: clocksource_lock <idle>-0 2dN..4 5902255261us+: lock_release: clocksource_lock 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.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index ee791a9650c5..48af49374384 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -368,6 +368,7 @@ static enum print_line_t
368print_graph_lat_fmt(struct trace_seq *s, struct trace_entry *entry) 368print_graph_lat_fmt(struct trace_seq *s, struct trace_entry *entry)
369{ 369{
370 int hardirq, softirq; 370 int hardirq, softirq;
371 int ret;
371 372
372 hardirq = entry->flags & TRACE_FLAG_HARDIRQ; 373 hardirq = entry->flags & TRACE_FLAG_HARDIRQ;
373 softirq = entry->flags & TRACE_FLAG_SOFTIRQ; 374 softirq = entry->flags & TRACE_FLAG_SOFTIRQ;
@@ -382,6 +383,13 @@ print_graph_lat_fmt(struct trace_seq *s, struct trace_entry *entry)
382 hardirq ? 'h' : softirq ? 's' : '.')) 383 hardirq ? 'h' : softirq ? 's' : '.'))
383 return 0; 384 return 0;
384 385
386 if (entry->lock_depth < 0)
387 ret = trace_seq_putc(s, '.');
388 else
389 ret = trace_seq_printf(s, "%d", entry->lock_depth);
390 if (!ret)
391 return 0;
392
385 if (entry->preempt_count) 393 if (entry->preempt_count)
386 return trace_seq_printf(s, "%x", entry->preempt_count); 394 return trace_seq_printf(s, "%x", entry->preempt_count);
387 return trace_seq_puts(s, "."); 395 return trace_seq_puts(s, ".");
@@ -1001,8 +1009,8 @@ static void print_lat_header(struct seq_file *s)
1001 seq_printf(s, "#%.*s / _----=> need-resched \n", size, spaces); 1009 seq_printf(s, "#%.*s / _----=> need-resched \n", size, spaces);
1002 seq_printf(s, "#%.*s| / _---=> hardirq/softirq \n", size, spaces); 1010 seq_printf(s, "#%.*s| / _---=> hardirq/softirq \n", size, spaces);
1003 seq_printf(s, "#%.*s|| / _--=> preempt-depth \n", size, spaces); 1011 seq_printf(s, "#%.*s|| / _--=> preempt-depth \n", size, spaces);
1004 seq_printf(s, "#%.*s||| / \n", size, spaces); 1012 seq_printf(s, "#%.*s||| / _-=> lock-depth \n", size, spaces);
1005 seq_printf(s, "#%.*s|||| \n", size, spaces); 1013 seq_printf(s, "#%.*s|||| / \n", size, spaces);
1006} 1014}
1007 1015
1008static void print_graph_headers(struct seq_file *s) 1016static void print_graph_headers(struct seq_file *s)
@@ -1021,7 +1029,7 @@ static void print_graph_headers(struct seq_file *s)
1021 if (tracer_flags.val & TRACE_GRAPH_PRINT_PROC) 1029 if (tracer_flags.val & TRACE_GRAPH_PRINT_PROC)
1022 seq_printf(s, " TASK/PID "); 1030 seq_printf(s, " TASK/PID ");
1023 if (lat) 1031 if (lat)
1024 seq_printf(s, "||||"); 1032 seq_printf(s, "|||||");
1025 if (tracer_flags.val & TRACE_GRAPH_PRINT_DURATION) 1033 if (tracer_flags.val & TRACE_GRAPH_PRINT_DURATION)
1026 seq_printf(s, " DURATION "); 1034 seq_printf(s, " DURATION ");
1027 seq_printf(s, " FUNCTION CALLS\n"); 1035 seq_printf(s, " FUNCTION CALLS\n");
@@ -1035,7 +1043,7 @@ static void print_graph_headers(struct seq_file *s)
1035 if (tracer_flags.val & TRACE_GRAPH_PRINT_PROC) 1043 if (tracer_flags.val & TRACE_GRAPH_PRINT_PROC)
1036 seq_printf(s, " | | "); 1044 seq_printf(s, " | | ");
1037 if (lat) 1045 if (lat)
1038 seq_printf(s, "||||"); 1046 seq_printf(s, "|||||");
1039 if (tracer_flags.val & TRACE_GRAPH_PRINT_DURATION) 1047 if (tracer_flags.val & TRACE_GRAPH_PRINT_DURATION)
1040 seq_printf(s, " | | "); 1048 seq_printf(s, " | | ");
1041 seq_printf(s, " | | | |\n"); 1049 seq_printf(s, " | | | |\n");