提交 c965be10 编写于 作者: H Hitoshi Mitake 提交者: Ingo Molnar

perf lock: Enhance information of lock trace events

Add wait time and lock identification details.
Signed-off-by: NHitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1264851813-8413-11-git-send-email-mitake@dcl.info.waseda.ac.jp>
[ removed the file/line bits as we can do that better via IPs ]
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 18e97e06
...@@ -20,14 +20,17 @@ TRACE_EVENT(lock_acquire, ...@@ -20,14 +20,17 @@ TRACE_EVENT(lock_acquire,
TP_STRUCT__entry( TP_STRUCT__entry(
__field(unsigned int, flags) __field(unsigned int, flags)
__string(name, lock->name) __string(name, lock->name)
__field(void *, lockdep_addr)
), ),
TP_fast_assign( TP_fast_assign(
__entry->flags = (trylock ? 1 : 0) | (read ? 2 : 0); __entry->flags = (trylock ? 1 : 0) | (read ? 2 : 0);
__assign_str(name, lock->name); __assign_str(name, lock->name);
__entry->lockdep_addr = lock;
), ),
TP_printk("%s%s%s", (__entry->flags & 1) ? "try " : "", TP_printk("%p %s%s%s", __entry->lockdep_addr,
(__entry->flags & 1) ? "try " : "",
(__entry->flags & 2) ? "read " : "", (__entry->flags & 2) ? "read " : "",
__get_str(name)) __get_str(name))
); );
...@@ -40,13 +43,16 @@ TRACE_EVENT(lock_release, ...@@ -40,13 +43,16 @@ TRACE_EVENT(lock_release,
TP_STRUCT__entry( TP_STRUCT__entry(
__string(name, lock->name) __string(name, lock->name)
__field(void *, lockdep_addr)
), ),
TP_fast_assign( TP_fast_assign(
__assign_str(name, lock->name); __assign_str(name, lock->name);
__entry->lockdep_addr = lock;
), ),
TP_printk("%s", __get_str(name)) TP_printk("%p %s",
__entry->lockdep_addr, __get_str(name))
); );
#ifdef CONFIG_LOCK_STAT #ifdef CONFIG_LOCK_STAT
...@@ -59,13 +65,16 @@ TRACE_EVENT(lock_contended, ...@@ -59,13 +65,16 @@ TRACE_EVENT(lock_contended,
TP_STRUCT__entry( TP_STRUCT__entry(
__string(name, lock->name) __string(name, lock->name)
__field(void *, lockdep_addr)
), ),
TP_fast_assign( TP_fast_assign(
__assign_str(name, lock->name); __assign_str(name, lock->name);
__entry->lockdep_addr = lock;
), ),
TP_printk("%s", __get_str(name)) TP_printk("%p %s",
__entry->lockdep_addr, __get_str(name))
); );
TRACE_EVENT(lock_acquired, TRACE_EVENT(lock_acquired,
...@@ -75,16 +84,18 @@ TRACE_EVENT(lock_acquired, ...@@ -75,16 +84,18 @@ TRACE_EVENT(lock_acquired,
TP_STRUCT__entry( TP_STRUCT__entry(
__string(name, lock->name) __string(name, lock->name)
__field(unsigned long, wait_usec) __field(s64, wait_nsec)
__field(unsigned long, wait_nsec_rem) __field(void *, lockdep_addr)
), ),
TP_fast_assign( TP_fast_assign(
__assign_str(name, lock->name); __assign_str(name, lock->name);
__entry->wait_nsec_rem = do_div(waittime, NSEC_PER_USEC); __entry->wait_nsec = waittime;
__entry->wait_usec = (unsigned long) waittime; __entry->lockdep_addr = lock;
), ),
TP_printk("%s (%lu.%03lu us)", __get_str(name), __entry->wait_usec, TP_printk("%p %s (%llu ns)", __entry->lockdep_addr,
__entry->wait_nsec_rem) __get_str(name),
__entry->wait_nsec)
); );
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册