1
linux/include/trace
Frederic Weisbecker 2062501ae6 tracing/lockdep: report the time waited for a lock
While trying to optimize the new lock on reiserfs to replace
the bkl, I find the lock tracing very useful though it lacks
something important for performance (and latency) instrumentation:
the time a task waits for a lock.

That's what this patch implements:

  bash-4816  [000]   202.652815: lock_contended: lock_contended: &sb->s_type->i_mutex_key
  bash-4816  [000]   202.652819: lock_acquired: &rq->lock (0.000 us)
 <...>-4787  [000]   202.652825: lock_acquired: &rq->lock (0.000 us)
 <...>-4787  [000]   202.652829: lock_acquired: &rq->lock (0.000 us)
  bash-4816  [000]   202.652833: lock_acquired: &sb->s_type->i_mutex_key (16.005 us)

As shown above, the "lock acquired" field is followed by the time
it has been waiting for the lock. Usually, a lock contended entry
is followed by a near lock_acquired entry with a non-zero time waited.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <1238975373-15739-1-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-04-10 12:50:56 +02:00
..
block.h tracing: replace TP<var> with TP_<var> 2009-03-10 00:35:04 -04:00
boot.h
irq_event_types.h tracing: tracepoints for softirq entry/exit - tracepoints 2009-03-12 21:20:58 -04:00
irq.h
kmemtrace.h kmemtrace: use tracepoints 2009-04-03 12:23:06 +02:00
lockdep_event_types.h tracing/lockdep: report the time waited for a lock 2009-04-10 12:50:56 +02:00
lockdep.h
power.h tracing: replace TP<var> with TP_<var> 2009-03-10 00:35:04 -04:00
sched_event_types.h tracing: flip the TP_printk and TP_fast_assign in the TRACE_EVENT macro 2009-03-10 12:41:38 -04:00
sched.h
skb.h tracing, net: fix net tree and tracing tree merge interaction 2009-04-02 00:50:30 +02:00
syscall.h tracing/syscalls: use a dedicated file header 2009-04-09 05:43:32 +02:00
trace_event_types.h
trace_events.h
workqueue.h tracing: replace TP<var> with TP_<var> 2009-03-10 00:35:04 -04:00