]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
lttng: Remove tracing from libcommon
authorAdam Crume <adamcrume@gmail.com>
Wed, 13 Aug 2014 18:42:00 +0000 (11:42 -0700)
committerSage Weil <sage@redhat.com>
Thu, 21 Aug 2014 17:57:33 +0000 (10:57 -0700)
This is a short-term fix for issues caused by tracepoints in libcommon.
Code crashes at runtime if the same tracepoints are linked into the
program multiple times.  This happens with libcommon because it is
statically linked into dynamic libraries such as librados, then
statically linked into executables because symbols from libcommon are
not exposed in librados.  Therefore, any programs that use librados and
libcommon would crash because of duplicate tracepoints.

Signed-off-by: Adam Crume <adamcrume@gmail.com>
src/Makefile-env.am
src/common/Makefile.am
src/common/Mutex.cc
src/tracing/Makefile.am
src/tracing/mutex.tp [deleted file]

index a2a9fc3384033ed927a7ecc7d2f15d0245f2df46..f2ab6558bc8457279d5b8de836bc7137ec8901d1 100644 (file)
@@ -156,7 +156,6 @@ LIBRBD = librbd.la
 LIBKRBD = libkrbd.la
 LIBCEPHFS = libcephfs.la
 LIBERASURE_CODE = liberasure_code.la
-LIBCOMMON_TP = tracing/libcommon_tp.la
 LIBOSD_TP = tracing/libosd_tp.la
 LIBRADOS_TP = tracing/librados_tp.la
 LIBRBD_TP = tracing/librbd_tp.la
index 52d6db8d84103b82288234238fe1ab52aa52c8a4..0b99c6e3f1589dd8121364c4dc42f6fddf2ad485 100644 (file)
@@ -114,10 +114,6 @@ LIBCOMMON_DEPS += \
        $(LIBMSG) $(LIBAUTH) \
        $(LIBCRUSH) $(LIBJSON_SPIRIT) $(LIBLOG) $(LIBARCH)
 
-if WITH_LTTNG
-LIBCOMMON_DEPS += $(LIBCOMMON_TP)
-endif
-
 if LINUX
 LIBCOMMON_DEPS += -lrt
 endif # LINUX
index 4b87819667c15f96a4ebdaaa39a7505b0652198b..a0c1202183dcdc0ac42c74df8893a59539289bb3 100644 (file)
 #include "include/utime.h"
 #include "common/Clock.h"
 
-#ifdef WITH_LTTNG
-#include "tracing/mutex.h"
-#endif
-
 Mutex::Mutex(const char *n, bool r, bool ld,
             bool bt,
             CephContext *cct) :
@@ -84,8 +80,6 @@ void Mutex::Lock(bool no_lockdep) {
   utime_t start;
   int r;
 
-  tracepoint(mutex, lock_enter, this, name);
-
   if (lockdep && g_lockdep && !no_lockdep) _will_lock();
 
   if (TryLock()) {
@@ -103,7 +97,7 @@ void Mutex::Lock(bool no_lockdep) {
   _post_lock();
 
 out:
-  tracepoint(mutex, lock_exit, this, name);
+  ;
 }
 
 void Mutex::Unlock() {
@@ -111,5 +105,4 @@ void Mutex::Unlock() {
   if (lockdep && g_lockdep) _will_unlock();
   int r = pthread_mutex_unlock(&_m);
   assert(r == 0);
-  tracepoint(mutex, unlock, this, name);
 }
index d9eceaf8b7c852b8aab83627f62e05e99c60e688..5da5e45d7d85362ddd719eb89681691897c3deb8 100644 (file)
@@ -6,19 +6,11 @@ if WITH_LTTNG
 dist_noinst_DATA = \
        librados.tp \
        librbd.tp \
-       mutex.tp \
        oprequest.tp \
        osd.tp \
        pg.tp \
        objectstore.tp
 
-libcommon_tp_la_SOURCES = \
-       mutex.c \
-       mutex.h
-libcommon_tp_la_LIBADD = -llttng-ust -ldl
-libcommon_tp_la_CPPFLAGS = -DTRACEPOINT_PROBE_DYNAMIC_LINKAGE
-libcommon_tp_la_LDFLAGS =
-
 libosd_tp_la_SOURCES = \
        oprequest.c \
        oprequest.h \
@@ -52,7 +44,6 @@ libos_tp_la_CPPFLAGS = -DTRACEPOINT_PROBE_DYNAMIC_LINKAGE
 libos_tp_la_LDFLAGS =
 
 noinst_LTLIBRARIES = \
-       libcommon_tp.la \
        libosd_tp.la \
        librados_tp.la \
        librbd_tp.la \
@@ -61,14 +52,12 @@ noinst_LTLIBRARIES = \
 BUILT_SOURCES = \
        librados.h \
        librbd.h \
-       mutex.h \
        oprequest.h \
        osd.h \
        pg.h \
        objectstore.h
 
 CLEANFILES = \
-       $(libcommon_tp_la_SOURCES) \
        $(libosd_tp_la_SOURCES) \
        $(librados_tp_la_SOURCES) \
        $(librbd_tp_la_SOURCES) \
diff --git a/src/tracing/mutex.tp b/src/tracing/mutex.tp
deleted file mode 100644 (file)
index 7cdfdb3..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-TRACEPOINT_EVENT(mutex, lock_enter,
-    TP_ARGS(
-        const void *, addr,
-        const char *, name),
-    TP_FIELDS(
-        ctf_integer_hex(unsigned long, addr, addr)
-        ctf_string(name, name)
-    )
-)
-
-TRACEPOINT_EVENT(mutex, lock_exit,
-    TP_ARGS(
-        const void *, addr,
-        const char *, name),
-    TP_FIELDS(
-        ctf_integer_hex(unsigned long, addr, addr)
-        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)
-    )
-)