linux/include/trace/events
Frederic Weisbecker 96a2c464de tracing/bkl: Add bkl ftrace events
Add two events lock_kernel and unlock_kernel() to trace the bkl uses.
This opens the door for userspace tools to perform statistics about
the callsites that use it, dependencies with other locks (by pairing
the trace with lock events), use with recursivity and so on...

The {__reacquire,release}_kernel_lock() events are not traced because
these are called from schedule, thus the sched events are sufficient
to trace them.

Example of a trace:

hald-addon-stor-4152  [000]   165.875501: unlock_kernel: depth: 0, fs/block_dev.c:1358 __blkdev_put()
hald-addon-stor-4152  [000]   167.832974: lock_kernel: depth: 0, fs/block_dev.c:1167 __blkdev_get()

How to get the callsites that acquire it recursively:

cd /debug/tracing/events/bkl
echo "lock_depth > 0" > filter

firefox-4951  [001]   206.276967: unlock_kernel: depth: 1, fs/reiserfs/super.c:575 reiserfs_dirty_inode()

You can also filter by file and/or line.

v2: Use of FILTER_PTR_STRING attribute for files and lines fields to
    make them traceable.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Li Zefan <lizf@cn.fujitsu.com>
2009-09-24 15:16:31 +02:00
..
bkl.h tracing/bkl: Add bkl ftrace events 2009-09-24 15:16:31 +02:00
block.h tracing: prevent NULL pointer dereference in ftrace_raw_event_block_bio_bounce 2009-09-12 21:31:19 -04:00
ext4.h writeback: get rid of wbc->for_writepages 2009-09-16 15:16:18 +02:00
irq.h softirq: add BLOCK_IOPOLL to softirq_to_name 2009-09-17 15:53:44 -04:00
jbd2.h tracing/events: Move TRACE_SYSTEM outside of include guard 2009-07-13 10:59:55 +02:00
kmem.h tracing/events: Move TRACE_SYSTEM outside of include guard 2009-07-13 10:59:55 +02:00
kvm.h KVM: Add trace points in irqchip code 2009-09-10 08:33:11 +03:00
lockdep.h tracing/events: Move TRACE_SYSTEM outside of include guard 2009-07-13 10:59:55 +02:00
module.h tracing/events: Add module tracepoints 2009-08-17 11:25:08 +02:00
napi.h Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-06-15 03:02:23 -07:00
sched.h Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-09-11 13:24:03 -07:00
skb.h net: skb ftracer - add tracepoint to skb_copy_datagram_iovec (v3) 2009-08-13 16:26:14 -07:00
syscalls.h tracing: Create generic syscall TRACE_EVENTs 2009-08-26 00:41:48 +02:00
workqueue.h tracing/events: Move TRACE_SYSTEM outside of include guard 2009-07-13 10:59:55 +02:00