提交 2c193c73 编写于 作者: F Frederic Weisbecker

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: NFrederic 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>
上级 93135439
...@@ -35,15 +35,15 @@ TRACE_EVENT(lock_acquire, ...@@ -35,15 +35,15 @@ TRACE_EVENT(lock_acquire,
__get_str(name)) __get_str(name))
); );
TRACE_EVENT(lock_release, DECLARE_EVENT_CLASS(lock,
TP_PROTO(struct lockdep_map *lock, unsigned long ip), TP_PROTO(struct lockdep_map *lock, unsigned long ip),
TP_ARGS(lock, ip), TP_ARGS(lock, ip),
TP_STRUCT__entry( TP_STRUCT__entry(
__string(name, lock->name) __string( name, lock->name )
__field(void *, lockdep_addr) __field( void *, lockdep_addr )
), ),
TP_fast_assign( TP_fast_assign(
...@@ -51,48 +51,30 @@ TRACE_EVENT(lock_release, ...@@ -51,48 +51,30 @@ TRACE_EVENT(lock_release,
__entry->lockdep_addr = lock; __entry->lockdep_addr = lock;
), ),
TP_printk("%p %s", TP_printk("%p %s", __entry->lockdep_addr, __get_str(name))
__entry->lockdep_addr, __get_str(name))
); );
#ifdef CONFIG_LOCK_STAT DEFINE_EVENT(lock, lock_release,
TRACE_EVENT(lock_contended,
TP_PROTO(struct lockdep_map *lock, unsigned long ip), TP_PROTO(struct lockdep_map *lock, unsigned long ip),
TP_ARGS(lock, ip), TP_ARGS(lock, ip)
);
TP_STRUCT__entry(
__string(name, lock->name)
__field(void *, lockdep_addr)
),
TP_fast_assign( #ifdef CONFIG_LOCK_STAT
__assign_str(name, lock->name);
__entry->lockdep_addr = lock;
),
TP_printk("%p %s", DEFINE_EVENT(lock, lock_contended,
__entry->lockdep_addr, __get_str(name))
);
TRACE_EVENT(lock_acquired,
TP_PROTO(struct lockdep_map *lock, unsigned long ip), TP_PROTO(struct lockdep_map *lock, unsigned long ip),
TP_ARGS(lock, ip), TP_ARGS(lock, ip)
);
TP_STRUCT__entry( DEFINE_EVENT(lock, lock_acquired,
__string(name, lock->name)
__field(void *, lockdep_addr)
),
TP_fast_assign( TP_PROTO(struct lockdep_map *lock, unsigned long ip),
__assign_str(name, lock->name);
__entry->lockdep_addr = lock; TP_ARGS(lock, ip)
),
TP_printk("%p %s", __entry->lockdep_addr,
__get_str(name))
); );
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册