aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_events.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_events.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_events.c')
-rw-r--r--kernel/trace/trace_events.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 28d92027a93c..975f324a07e7 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -86,6 +86,7 @@ int trace_define_common_fields(struct ftrace_event_call *call)
86 __common_field(unsigned char, flags); 86 __common_field(unsigned char, flags);
87 __common_field(unsigned char, preempt_count); 87 __common_field(unsigned char, preempt_count);
88 __common_field(int, pid); 88 __common_field(int, pid);
89 __common_field(int, lock_depth);
89 90
90 return ret; 91 return ret;
91} 92}
@@ -571,11 +572,13 @@ static int trace_write_header(struct trace_seq *s)
571 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 572 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
572 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 573 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
573 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 574 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
575 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
574 "\n", 576 "\n",
575 FIELD(unsigned short, type), 577 FIELD(unsigned short, type),
576 FIELD(unsigned char, flags), 578 FIELD(unsigned char, flags),
577 FIELD(unsigned char, preempt_count), 579 FIELD(unsigned char, preempt_count),
578 FIELD(int, pid)); 580 FIELD(int, pid),
581 FIELD(int, lock_depth));
579} 582}
580 583
581static ssize_t 584static ssize_t