lkml.org 
[lkml]   [2010]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 04/11] tracing: Add lock class id in lock_acquire event
Date
Add the lock class id to lock_acquire event. This will let us
remove the name copy from every lock events (except lock_class_init)
as we'll be able to retrieve the name of the lock class with
the class id.

The class id is represented by the lock name address, which is
the same in the corresponding lock class.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
---
include/trace/events/lock.h | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/include/trace/events/lock.h b/include/trace/events/lock.h
index 6999f16..3c4a5c1 100644
--- a/include/trace/events/lock.h
+++ b/include/trace/events/lock.h
@@ -52,15 +52,18 @@ TRACE_EVENT(lock_acquire,
__field(unsigned int, flags)
__string(name, lock->name)
__field(void *, lockdep_addr)
+ __field(void *, class_id)
),

TP_fast_assign(
__entry->flags = (trylock ? 1 : 0) | (read ? 2 : 0);
__assign_str(name, lock->name);
__entry->lockdep_addr = lock;
+ __entry->class_id = (void *)lock->name;
),

- TP_printk("%p %s%s%s", __entry->lockdep_addr,
+ TP_printk("%p %p %s%s%s", __entry->lockdep_addr,
+ __entry->class_id,
(__entry->flags & 1) ? "try " : "",
(__entry->flags & 2) ? "read " : "",
__get_str(name))
--
1.6.2.3


\
 
 \ /
  Last update: 2010-02-03 10:19    [W:0.172 / U:9.816 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site