From: Noah Watkins Date: Sat, 31 May 2014 22:59:27 +0000 (-0700) Subject: lttng: trace mutex::unlock X-Git-Tag: v0.86~231^2~79 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7fa513ea30a9c1c1161262da79ffd71930a09d1c;p=ceph.git lttng: trace mutex::unlock Signed-off-by: Noah Watkins --- diff --git a/src/common/Mutex.cc b/src/common/Mutex.cc index a79d6ade5d9f..0a407f9fd2dc 100644 --- a/src/common/Mutex.cc +++ b/src/common/Mutex.cc @@ -102,3 +102,11 @@ void Mutex::Lock(bool no_lockdep) { out: tracepoint(mutex, lock_exit, this, name); } + +void Mutex::Unlock() { + _pre_unlock(); + if (lockdep && g_lockdep) _will_unlock(); + int r = pthread_mutex_unlock(&_m); + assert(r == 0); + tracepoint(mutex, unlock, this, name); +} diff --git a/src/common/Mutex.h b/src/common/Mutex.h index e26a090703d2..e2ebe1fa6e8f 100644 --- a/src/common/Mutex.h +++ b/src/common/Mutex.h @@ -101,12 +101,7 @@ public: assert(nlock == 0); } } - void Unlock() { - _pre_unlock(); - if (lockdep && g_lockdep) _will_unlock(); - int r = pthread_mutex_unlock(&_m); - assert(r == 0); - } + void Unlock(); friend class Cond; diff --git a/src/tracing/Makefile.am b/src/tracing/Makefile.am index 8da61a843e7f..f759a6a46e99 100644 --- a/src/tracing/Makefile.am +++ b/src/tracing/Makefile.am @@ -3,6 +3,6 @@ libtracepoints_la_SOURCES = \ mutex.tp.h libtracepoints_la_LIBADD = -llttng-ust -ldl -libtracepoints_la_CPPFLAGS = -DTRACEPOINT_DEFINE -DTRACEPOINT_PROBE_DYNAMIC_LINKAGE +libtracepoints_la_CPPFLAGS = -DTRACEPOINT_PROBE_DYNAMIC_LINKAGE libtracepoints_la_LDFLAGS = noinst_LTLIBRARIES = libtracepoints.la diff --git a/src/tracing/mutex.tp b/src/tracing/mutex.tp index 82bdf15a5220..7cdfdb35064c 100644 --- a/src/tracing/mutex.tp +++ b/src/tracing/mutex.tp @@ -17,3 +17,13 @@ TRACEPOINT_EVENT(mutex, lock_exit, ctf_string(name, name) ) ) + +TRACEPOINT_EVENT(mutex, unlock, + TP_ARGS( + const void *, addr, + const char *, name), + TP_FIELDS( + ctf_integer_hex(unsigned long, addr, addr) + ctf_string(name, name) + ) +) diff --git a/src/tracing/mutex.tp.h b/src/tracing/mutex.tp.h index 24d45543863b..e26e86d1f588 100644 --- a/src/tracing/mutex.tp.h +++ b/src/tracing/mutex.tp.h @@ -30,6 +30,16 @@ TRACEPOINT_EVENT(mutex, lock_exit, ) ) +TRACEPOINT_EVENT(mutex, unlock, + TP_ARGS( + const void *, addr, + const char *, name), + TP_FIELDS( + ctf_integer_hex(unsigned long, addr, addr) + ctf_string(name, name) + ) +) + #endif /* MUTEX_TP_H */ #include