aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2010-05-08 00:36:02 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2010-05-09 07:45:35 -0400
commit2c193c736803ceb547daec725e5c5d992d039f20 (patch)
tree3ae8b7a21ef6397ab626d192c8e90895469052be /include/trace
parent93135439459920c4d856f4ab8f068c030085c8df (diff)
tracing: Factorize lock events in a lock class
lock_acquired, lock_contended and lock_release now share the same prototype and format. Let's factorize them into a lock event class. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> Cc: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/lock.h48
1 files changed, 15 insertions, 33 deletions
diff --git a/include/trace/events/lock.h b/include/trace/events/lock.h
index fde4c3853391..2821b86de63b 100644
--- a/include/trace/events/lock.h
+++ b/include/trace/events/lock.h
@@ -35,15 +35,15 @@ TRACE_EVENT(lock_acquire,
35 __get_str(name)) 35 __get_str(name))
36); 36);
37 37
38TRACE_EVENT(lock_release, 38DECLARE_EVENT_CLASS(lock,
39 39
40 TP_PROTO(struct lockdep_map *lock, unsigned long ip), 40 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
41 41
42 TP_ARGS(lock, ip), 42 TP_ARGS(lock, ip),
43 43
44 TP_STRUCT__entry( 44 TP_STRUCT__entry(
45 __string(name, lock->name) 45 __string( name, lock->name )
46 __field(void *, lockdep_addr) 46 __field( void *, lockdep_addr )
47 ), 47 ),
48 48
49 TP_fast_assign( 49 TP_fast_assign(
@@ -51,48 +51,30 @@ TRACE_EVENT(lock_release,
51 __entry->lockdep_addr = lock; 51 __entry->lockdep_addr = lock;
52 ), 52 ),
53 53
54 TP_printk("%p %s", 54 TP_printk("%p %s", __entry->lockdep_addr, __get_str(name))
55 __entry->lockdep_addr, __get_str(name))
56); 55);
57 56
58#ifdef CONFIG_LOCK_STAT 57DEFINE_EVENT(lock, lock_release,
59
60TRACE_EVENT(lock_contended,
61 58
62 TP_PROTO(struct lockdep_map *lock, unsigned long ip), 59 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
63 60
64 TP_ARGS(lock, ip), 61 TP_ARGS(lock, ip)
65 62);
66 TP_STRUCT__entry(
67 __string(name, lock->name)
68 __field(void *, lockdep_addr)
69 ),
70 63
71 TP_fast_assign( 64#ifdef CONFIG_LOCK_STAT
72 __assign_str(name, lock->name);
73 __entry->lockdep_addr = lock;
74 ),
75 65
76 TP_printk("%p %s", 66DEFINE_EVENT(lock, lock_contended,
77 __entry->lockdep_addr, __get_str(name))
78);
79 67
80TRACE_EVENT(lock_acquired,
81 TP_PROTO(struct lockdep_map *lock, unsigned long ip), 68 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
82 69
83 TP_ARGS(lock, ip), 70 TP_ARGS(lock, ip)
71);
84 72
85 TP_STRUCT__entry( 73DEFINE_EVENT(lock, lock_acquired,
86 __string(name, lock->name)
87 __field(void *, lockdep_addr)
88 ),
89 74
90 TP_fast_assign( 75 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
91 __assign_str(name, lock->name); 76
92 __entry->lockdep_addr = lock; 77 TP_ARGS(lock, ip)
93 ),
94 TP_printk("%p %s", __entry->lockdep_addr,
95 __get_str(name))
96); 78);
97 79
98#endif 80#endif