/src/lib/lttng-ust-java-agent/jni/log4j/Makefile
/src/lib/lttng-ust-java/Makefile
/src/lib/lttng-ust-libc-wrapper/Makefile
+/src/lib/lttng-ust-pthread-wrapper/Makefile
/src/lib/lttng-ust-tracepoint/Makefile
/src/lib/lttng-ust-python-agent/Makefile
/src/lib/Makefile
src/lib/lttng-ust-java-agent/Makefile
src/lib/lttng-ust-java/Makefile
src/lib/lttng-ust-libc-wrapper/Makefile
+ src/lib/lttng-ust-pthread-wrapper/Makefile
src/lib/lttng-ust-tracepoint/Makefile
src/lib/lttng-ust/Makefile
src/lib/lttng-ust-python-agent/Makefile
lttng-ust-fd \
lttng-ust-fork \
lttng-ust-cyg-profile \
- lttng-ust-libc-wrapper
+ lttng-ust-libc-wrapper \
+ lttng-ust-pthread-wrapper
if ENABLE_UST_DL
SUBDIRS += lttng-ust-dl
AM_CFLAGS += -I$(srcdir) -fno-strict-aliasing
-lib_LTLIBRARIES = liblttng-ust-libc-wrapper.la \
- liblttng-ust-pthread-wrapper.la
+lib_LTLIBRARIES = liblttng-ust-libc-wrapper.la
liblttng_ust_libc_wrapper_la_SOURCES = \
lttng-ust-malloc.c \
liblttng_ust_libc_wrapper_la_LDFLAGS = -version-info $(LTTNG_UST_LIBRARY_VERSION)
-liblttng_ust_pthread_wrapper_la_SOURCES = \
- lttng-ust-pthread.c \
- ust_pthread.h
-
-liblttng_ust_pthread_wrapper_la_LIBADD = \
- $(top_builddir)/src/lib/lttng-ust/liblttng-ust.la \
- $(DL_LIBS)
-
-liblttng_ust_pthread_wrapper_la_LDFLAGS = -version-info $(LTTNG_UST_LIBRARY_VERSION)
-
dist_noinst_SCRIPTS = run
EXTRA_DIST = README
+++ /dev/null
-/*
- * SPDX-License-Identifier: LGPL-2.1-or-later
- *
- * Copyright (C) 2013 Mentor Graphics
- */
-
-/*
- * Do _not_ define _LGPL_SOURCE because we don't want to create a
- * circular dependency loop between this malloc wrapper, liburcu and
- * libc.
- */
-
-/* Has to be included first to override dlfcn.h */
-#include <common/compat/dlfcn.h>
-
-#include "common/macros.h"
-#include <pthread.h>
-
-#define TRACEPOINT_DEFINE
-#define TRACEPOINT_CREATE_PROBES
-#define TP_IP_PARAM ip
-#include "ust_pthread.h"
-
-static __thread int thread_in_trace;
-
-int pthread_mutex_lock(pthread_mutex_t *mutex)
-{
- static int (*mutex_lock)(pthread_mutex_t *);
- int retval;
-
- if (!mutex_lock) {
- mutex_lock = dlsym(RTLD_NEXT, "pthread_mutex_lock");
- if (!mutex_lock) {
- if (thread_in_trace) {
- abort();
- }
- fprintf(stderr, "unable to initialize pthread wrapper library.\n");
- return EINVAL;
- }
- }
- if (thread_in_trace) {
- return mutex_lock(mutex);
- }
-
- thread_in_trace = 1;
- tracepoint(lttng_ust_pthread, pthread_mutex_lock_req, mutex,
- LTTNG_UST_CALLER_IP());
- retval = mutex_lock(mutex);
- tracepoint(lttng_ust_pthread, pthread_mutex_lock_acq, mutex,
- retval, LTTNG_UST_CALLER_IP());
- thread_in_trace = 0;
- return retval;
-}
-
-int pthread_mutex_trylock(pthread_mutex_t *mutex)
-{
- static int (*mutex_trylock)(pthread_mutex_t *);
- int retval;
-
- if (!mutex_trylock) {
- mutex_trylock = dlsym(RTLD_NEXT, "pthread_mutex_trylock");
- if (!mutex_trylock) {
- if (thread_in_trace) {
- abort();
- }
- fprintf(stderr, "unable to initialize pthread wrapper library.\n");
- return EINVAL;
- }
- }
- if (thread_in_trace) {
- return mutex_trylock(mutex);
- }
-
- thread_in_trace = 1;
- retval = mutex_trylock(mutex);
- tracepoint(lttng_ust_pthread, pthread_mutex_trylock, mutex,
- retval, LTTNG_UST_CALLER_IP());
- thread_in_trace = 0;
- return retval;
-}
-
-int pthread_mutex_unlock(pthread_mutex_t *mutex)
-{
- static int (*mutex_unlock)(pthread_mutex_t *);
- int retval;
-
- if (!mutex_unlock) {
- mutex_unlock = dlsym(RTLD_NEXT, "pthread_mutex_unlock");
- if (!mutex_unlock) {
- if (thread_in_trace) {
- abort();
- }
- fprintf(stderr, "unable to initialize pthread wrapper library.\n");
- return EINVAL;
- }
- }
- if (thread_in_trace) {
- return mutex_unlock(mutex);
- }
-
- thread_in_trace = 1;
- retval = mutex_unlock(mutex);
- tracepoint(lttng_ust_pthread, pthread_mutex_unlock, mutex,
- retval, LTTNG_UST_CALLER_IP());
- thread_in_trace = 0;
- return retval;
-}
+++ /dev/null
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright (C) 2013 Mentor Graphics
- */
-
-#undef TRACEPOINT_PROVIDER
-#define TRACEPOINT_PROVIDER lttng_ust_pthread
-
-#if !defined(_TRACEPOINT_UST_PTHREAD_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
-#define _TRACEPOINT_UST_PTHREAD_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <lttng/tracepoint.h>
-
-TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_lock_req,
- TP_ARGS(pthread_mutex_t *, mutex, void *, ip),
- TP_FIELDS(
- ctf_integer_hex(void *, mutex, mutex)
- ctf_unused(ip)
- )
-)
-
-TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_lock_acq,
- TP_ARGS(pthread_mutex_t *, mutex, int, status, void *, ip),
- TP_FIELDS(
- ctf_integer_hex(void *, mutex, mutex)
- ctf_integer(int, status, status)
- ctf_unused(ip)
- )
-)
-
-TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_trylock,
- TP_ARGS(pthread_mutex_t *, mutex, int, status, void *, ip),
- TP_FIELDS(
- ctf_integer_hex(void *, mutex, mutex)
- ctf_integer(int, status, status)
- ctf_unused(ip)
- )
-)
-
-TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_unlock,
- TP_ARGS(pthread_mutex_t *, mutex, int, status, void *, ip),
- TP_FIELDS(
- ctf_integer_hex(void *, mutex, mutex)
- ctf_integer(int, status, status)
- ctf_unused(ip)
- )
-)
-
-#endif /* _TRACEPOINT_UST_PTHREAD_H */
-
-#undef TRACEPOINT_INCLUDE
-#define TRACEPOINT_INCLUDE "./ust_pthread.h"
-
-/* This part must be outside ifdef protection */
-#include <lttng/tracepoint-event.h>
-
-#ifdef __cplusplus
-}
-#endif
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-only
+
+AM_CFLAGS += -I$(srcdir) -fno-strict-aliasing
+
+lib_LTLIBRARIES = liblttng-ust-pthread-wrapper.la
+
+liblttng_ust_pthread_wrapper_la_SOURCES = \
+ lttng-ust-pthread.c \
+ ust_pthread.h
+
+liblttng_ust_pthread_wrapper_la_LIBADD = \
+ $(top_builddir)/src/lib/lttng-ust/liblttng-ust.la \
+ $(DL_LIBS)
+
+liblttng_ust_pthread_wrapper_la_LDFLAGS = -version-info $(LTTNG_UST_LIBRARY_VERSION)
--- /dev/null
+/*
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ *
+ * Copyright (C) 2013 Mentor Graphics
+ */
+
+/*
+ * Do _not_ define _LGPL_SOURCE because we don't want to create a
+ * circular dependency loop between this malloc wrapper, liburcu and
+ * libc.
+ */
+
+/* Has to be included first to override dlfcn.h */
+#include <common/compat/dlfcn.h>
+
+#include "common/macros.h"
+#include <pthread.h>
+
+#define TRACEPOINT_DEFINE
+#define TRACEPOINT_CREATE_PROBES
+#define TP_IP_PARAM ip
+#include "ust_pthread.h"
+
+static __thread int thread_in_trace;
+
+int pthread_mutex_lock(pthread_mutex_t *mutex)
+{
+ static int (*mutex_lock)(pthread_mutex_t *);
+ int retval;
+
+ if (!mutex_lock) {
+ mutex_lock = dlsym(RTLD_NEXT, "pthread_mutex_lock");
+ if (!mutex_lock) {
+ if (thread_in_trace) {
+ abort();
+ }
+ fprintf(stderr, "unable to initialize pthread wrapper library.\n");
+ return EINVAL;
+ }
+ }
+ if (thread_in_trace) {
+ return mutex_lock(mutex);
+ }
+
+ thread_in_trace = 1;
+ tracepoint(lttng_ust_pthread, pthread_mutex_lock_req, mutex,
+ LTTNG_UST_CALLER_IP());
+ retval = mutex_lock(mutex);
+ tracepoint(lttng_ust_pthread, pthread_mutex_lock_acq, mutex,
+ retval, LTTNG_UST_CALLER_IP());
+ thread_in_trace = 0;
+ return retval;
+}
+
+int pthread_mutex_trylock(pthread_mutex_t *mutex)
+{
+ static int (*mutex_trylock)(pthread_mutex_t *);
+ int retval;
+
+ if (!mutex_trylock) {
+ mutex_trylock = dlsym(RTLD_NEXT, "pthread_mutex_trylock");
+ if (!mutex_trylock) {
+ if (thread_in_trace) {
+ abort();
+ }
+ fprintf(stderr, "unable to initialize pthread wrapper library.\n");
+ return EINVAL;
+ }
+ }
+ if (thread_in_trace) {
+ return mutex_trylock(mutex);
+ }
+
+ thread_in_trace = 1;
+ retval = mutex_trylock(mutex);
+ tracepoint(lttng_ust_pthread, pthread_mutex_trylock, mutex,
+ retval, LTTNG_UST_CALLER_IP());
+ thread_in_trace = 0;
+ return retval;
+}
+
+int pthread_mutex_unlock(pthread_mutex_t *mutex)
+{
+ static int (*mutex_unlock)(pthread_mutex_t *);
+ int retval;
+
+ if (!mutex_unlock) {
+ mutex_unlock = dlsym(RTLD_NEXT, "pthread_mutex_unlock");
+ if (!mutex_unlock) {
+ if (thread_in_trace) {
+ abort();
+ }
+ fprintf(stderr, "unable to initialize pthread wrapper library.\n");
+ return EINVAL;
+ }
+ }
+ if (thread_in_trace) {
+ return mutex_unlock(mutex);
+ }
+
+ thread_in_trace = 1;
+ retval = mutex_unlock(mutex);
+ tracepoint(lttng_ust_pthread, pthread_mutex_unlock, mutex,
+ retval, LTTNG_UST_CALLER_IP());
+ thread_in_trace = 0;
+ return retval;
+}
--- /dev/null
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2013 Mentor Graphics
+ */
+
+#undef TRACEPOINT_PROVIDER
+#define TRACEPOINT_PROVIDER lttng_ust_pthread
+
+#if !defined(_TRACEPOINT_UST_PTHREAD_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
+#define _TRACEPOINT_UST_PTHREAD_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <lttng/tracepoint.h>
+
+TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_lock_req,
+ TP_ARGS(pthread_mutex_t *, mutex, void *, ip),
+ TP_FIELDS(
+ ctf_integer_hex(void *, mutex, mutex)
+ ctf_unused(ip)
+ )
+)
+
+TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_lock_acq,
+ TP_ARGS(pthread_mutex_t *, mutex, int, status, void *, ip),
+ TP_FIELDS(
+ ctf_integer_hex(void *, mutex, mutex)
+ ctf_integer(int, status, status)
+ ctf_unused(ip)
+ )
+)
+
+TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_trylock,
+ TP_ARGS(pthread_mutex_t *, mutex, int, status, void *, ip),
+ TP_FIELDS(
+ ctf_integer_hex(void *, mutex, mutex)
+ ctf_integer(int, status, status)
+ ctf_unused(ip)
+ )
+)
+
+TRACEPOINT_EVENT(lttng_ust_pthread, pthread_mutex_unlock,
+ TP_ARGS(pthread_mutex_t *, mutex, int, status, void *, ip),
+ TP_FIELDS(
+ ctf_integer_hex(void *, mutex, mutex)
+ ctf_integer(int, status, status)
+ ctf_unused(ip)
+ )
+)
+
+#endif /* _TRACEPOINT_UST_PTHREAD_H */
+
+#undef TRACEPOINT_INCLUDE
+#define TRACEPOINT_INCLUDE "./ust_pthread.h"
+
+/* This part must be outside ifdef protection */
+#include <lttng/tracepoint-event.h>
+
+#ifdef __cplusplus
+}
+#endif