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>
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
$(LIBMSG) $(LIBAUTH) \
$(LIBCRUSH) $(LIBJSON_SPIRIT) $(LIBLOG) $(LIBARCH)
-if WITH_LTTNG
-LIBCOMMON_DEPS += $(LIBCOMMON_TP)
-endif
-
if LINUX
LIBCOMMON_DEPS += -lrt
endif # LINUX
#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) :
utime_t start;
int r;
- tracepoint(mutex, lock_enter, this, name);
-
if (lockdep && g_lockdep && !no_lockdep) _will_lock();
if (TryLock()) {
_post_lock();
out:
- tracepoint(mutex, lock_exit, this, name);
+ ;
}
void Mutex::Unlock() {
if (lockdep && g_lockdep) _will_unlock();
int r = pthread_mutex_unlock(&_m);
assert(r == 0);
- tracepoint(mutex, unlock, this, name);
}
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 \
libos_tp_la_LDFLAGS =
noinst_LTLIBRARIES = \
- libcommon_tp.la \
libosd_tp.la \
librados_tp.la \
librbd_tp.la \
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) \
+++ /dev/null
-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)
- )
-)