From 8f51c684b1c9fde5d26b24515c03c04e8e4be515 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 8 Apr 2021 17:08:47 -0400 Subject: [PATCH] Move liblttng-ust-tracepoint to 'src/lib/' Change-Id: I589e48d787e4a72c0511746bde5d5f43d9d2633e Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- .gitignore | 1 + configure.ac | 1 + src/common/Makefile.am | 1 + src/common/tracepoint.h | 26 +++++++++++++++++++ src/lib/Makefile.am | 1 + src/lib/lttng-ust-tracepoint/Makefile.am | 16 ++++++++++++ .../tracepoint-weak-test.c | 2 +- .../tracepoint.c | 4 +-- .../tracepoint.h} | 16 ------------ src/lib/lttng-ust/Makefile.am | 23 ++++------------ src/lib/lttng-ust/lttng-context.c | 2 +- src/lib/lttng-ust/lttng-events.c | 2 +- src/lib/lttng-ust/lttng-probes.c | 2 +- src/lib/lttng-ust/lttng-ust-abi.c | 2 +- src/lib/lttng-ust/lttng-ust-comm.c | 2 +- 15 files changed, 59 insertions(+), 42 deletions(-) create mode 100644 src/common/tracepoint.h create mode 100644 src/lib/lttng-ust-tracepoint/Makefile.am rename src/lib/{lttng-ust => lttng-ust-tracepoint}/tracepoint-weak-test.c (93%) rename src/lib/{lttng-ust => lttng-ust-tracepoint}/tracepoint.c (99%) rename src/lib/{lttng-ust/tracepoint-internal.h => lttng-ust-tracepoint/tracepoint.h} (68%) diff --git a/.gitignore b/.gitignore index b836c4c2..f409ce70 100644 --- a/.gitignore +++ b/.gitignore @@ -143,6 +143,7 @@ cscope.* /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-tracepoint/Makefile /src/lib/lttng-ust-python-agent/Makefile /src/lib/Makefile /src/lib/lttng-ust/Makefile diff --git a/configure.ac b/configure.ac index 89b909af..be707b0f 100644 --- a/configure.ac +++ b/configure.ac @@ -537,6 +537,7 @@ AC_CONFIG_FILES([ src/lib/lttng-ust-java-agent/Makefile src/lib/lttng-ust-java/Makefile src/lib/lttng-ust-libc-wrapper/Makefile + src/lib/lttng-ust-tracepoint/Makefile src/lib/lttng-ust/Makefile src/lib/lttng-ust-python-agent/Makefile src/lib/Makefile diff --git a/src/common/Makefile.am b/src/common/Makefile.am index f5345041..078ec9ee 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -24,6 +24,7 @@ noinst_HEADERS = \ patient.h \ procname.h \ safe-snprintf.h \ + tracepoint.h \ wait.h noinst_HEADERS += \ diff --git a/src/common/tracepoint.h b/src/common/tracepoint.h new file mode 100644 index 00000000..11c2b8f3 --- /dev/null +++ b/src/common/tracepoint.h @@ -0,0 +1,26 @@ +/* + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (C) 2011 Mathieu Desnoyers + */ + +#ifndef _UST_COMMON_TRACEPOINT_H +#define _UST_COMMON_TRACEPOINT_H + +#define TRACE_DEFAULT TRACE_DEBUG_LINE + +/* + * These symbols are ABI between liblttng-ust-tracepoint and liblttng-ust, + * which is why they are not hidden and not part of the public API. + */ +int lttng_ust_tp_probe_register_queue_release(const char *name, + void (*func)(void), void *data, const char *signature); +int lttng_ust_tp_probe_unregister_queue_release(const char *name, + void (*func)(void), void *data); +void lttng_ust_tp_probe_prune_release_queue(void); + +void lttng_ust_tp_init(void); +void lttng_ust_tp_exit(void); + + +#endif /* _UST_COMMON_TRACEPOINT_H */ diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 0a27437b..49fbd75d 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -2,6 +2,7 @@ SUBDIRS = \ lttng-ust-common \ + lttng-ust-tracepoint \ lttng-ust \ lttng-ust-ctl \ lttng-ust-fd \ diff --git a/src/lib/lttng-ust-tracepoint/Makefile.am b/src/lib/lttng-ust-tracepoint/Makefile.am new file mode 100644 index 00000000..e4f274d8 --- /dev/null +++ b/src/lib/lttng-ust-tracepoint/Makefile.am @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: LGPL-2.1-only + +lib_LTLIBRARIES = liblttng-ust-tracepoint.la + +liblttng_ust_tracepoint_la_SOURCES = \ + tracepoint.c \ + tracepoint.h \ + tracepoint-weak-test.c + +liblttng_ust_tracepoint_la_LIBADD = \ + $(top_builddir)/src/lib/lttng-ust-common/liblttng-ust-common.la \ + $(top_builddir)/src/common/libcommon.la \ + $(DL_LIBS) + +liblttng_ust_tracepoint_la_LDFLAGS = -no-undefined -version-info $(LTTNG_UST_LIBRARY_VERSION) +liblttng_ust_tracepoint_la_CFLAGS = -DUST_COMPONENT="liblttng_ust_tracepoint" $(AM_CFLAGS) diff --git a/src/lib/lttng-ust/tracepoint-weak-test.c b/src/lib/lttng-ust-tracepoint/tracepoint-weak-test.c similarity index 93% rename from src/lib/lttng-ust/tracepoint-weak-test.c rename to src/lib/lttng-ust-tracepoint/tracepoint-weak-test.c index abca8319..fcfb5838 100644 --- a/src/lib/lttng-ust/tracepoint-weak-test.c +++ b/src/lib/lttng-ust-tracepoint/tracepoint-weak-test.c @@ -4,7 +4,7 @@ * Copyright (C) 2016 Mathieu Desnoyers */ -#include "tracepoint-internal.h" +#include "lib/lttng-ust-tracepoint/tracepoint.h" /* Test compiler support for weak symbols with hidden visibility. */ int __tracepoint_test_symbol1 __attribute__((weak, visibility("hidden"))); diff --git a/src/lib/lttng-ust/tracepoint.c b/src/lib/lttng-ust-tracepoint/tracepoint.c similarity index 99% rename from src/lib/lttng-ust/tracepoint.c rename to src/lib/lttng-ust-tracepoint/tracepoint.c index 8d89d144..03e1e0bb 100644 --- a/src/lib/lttng-ust/tracepoint.c +++ b/src/lib/lttng-ust-tracepoint/tracepoint.c @@ -26,8 +26,8 @@ #include "common/logging.h" #include "common/macros.h" -#include "tracepoint-internal.h" -#include "lttng-tracer-core.h" +#include "lib/lttng-ust-tracepoint/tracepoint.h" +#include "common/tracepoint.h" #include "common/jhash.h" #include "common/err-ptr.h" diff --git a/src/lib/lttng-ust/tracepoint-internal.h b/src/lib/lttng-ust-tracepoint/tracepoint.h similarity index 68% rename from src/lib/lttng-ust/tracepoint-internal.h rename to src/lib/lttng-ust-tracepoint/tracepoint.h index a4f8fc42..ebc25441 100644 --- a/src/lib/lttng-ust/tracepoint-internal.h +++ b/src/lib/lttng-ust-tracepoint/tracepoint.h @@ -11,8 +11,6 @@ #include #include -#define TRACE_DEFAULT TRACE_DEBUG_LINE - struct tracepoint_lib { struct cds_list_head list; /* list of registered libs */ struct lttng_ust_tracepoint * const *tracepoints_start; @@ -42,18 +40,4 @@ void *lttng_ust_tp_check_weak_hidden2(void) void *lttng_ust_tp_check_weak_hidden3(void) __attribute__((visibility("hidden"))); -/* - * These symbols are ABI between liblttng-ust-tracepoint and liblttng-ust, - * which is why they are not hidden and not part of the public API. - */ -int lttng_ust_tp_probe_register_queue_release(const char *name, - void (*func)(void), void *data, const char *signature); -int lttng_ust_tp_probe_unregister_queue_release(const char *name, - void (*func)(void), void *data); -void lttng_ust_tp_probe_prune_release_queue(void); - -void lttng_ust_tp_init(void); -void lttng_ust_tp_exit(void); - - #endif /* _LTTNG_TRACEPOINT_INTERNAL_H */ diff --git a/src/lib/lttng-ust/Makefile.am b/src/lib/lttng-ust/Makefile.am index 5fcfb5f5..a935bdbe 100644 --- a/src/lib/lttng-ust/Makefile.am +++ b/src/lib/lttng-ust/Makefile.am @@ -2,23 +2,11 @@ AM_CFLAGS += -I$(srcdir) -fno-strict-aliasing -noinst_LTLIBRARIES = liblttng-ust-runtime.la liblttng-ust-support.la +lib_LTLIBRARIES = liblttng-ust.la -lib_LTLIBRARIES = liblttng-ust-tracepoint.la liblttng-ust.la - -liblttng_ust_tracepoint_la_SOURCES = \ - tracepoint.c \ - tracepoint-weak-test.c \ - tracepoint-internal.h \ - lttng-tracer-core.h - -liblttng_ust_tracepoint_la_LIBADD = \ - $(top_builddir)/src/lib/lttng-ust-common/liblttng-ust-common.la \ - $(top_builddir)/src/common/libcommon.la \ - $(DL_LIBS) - -liblttng_ust_tracepoint_la_LDFLAGS = -no-undefined -version-info $(LTTNG_UST_LIBRARY_VERSION) -liblttng_ust_tracepoint_la_CFLAGS = -DUST_COMPONENT="liblttng_ust_tracepoint" $(AM_CFLAGS) +noinst_LTLIBRARIES = \ + liblttng-ust-runtime.la \ + liblttng-ust-support.la liblttng_ust_runtime_la_SOURCES = \ bytecode.h \ @@ -62,7 +50,6 @@ liblttng_ust_runtime_la_SOURCES = \ ust_lib.h \ context-internal.h \ context-provider-internal.h \ - tracepoint-internal.h \ events.h \ clock.h \ lttng-ust-uuid.h \ @@ -116,7 +103,7 @@ liblttng_ust_la_LIBADD = \ $(top_builddir)/src/lib/lttng-ust-common/liblttng-ust-common.la \ $(top_builddir)/src/common/libustcomm.la \ $(top_builddir)/src/common/libcommon.la \ - liblttng-ust-tracepoint.la \ + $(top_builddir)/src/lib/lttng-ust-tracepoint/liblttng-ust-tracepoint.la \ liblttng-ust-runtime.la liblttng-ust-support.la \ $(DL_LIBS) diff --git a/src/lib/lttng-ust/lttng-context.c b/src/lib/lttng-ust/lttng-context.c index aeafa9fc..26d458a8 100644 --- a/src/lib/lttng-ust/lttng-context.c +++ b/src/lib/lttng-ust/lttng-context.c @@ -18,7 +18,7 @@ #include #include #include -#include "tracepoint-internal.h" +#include "common/tracepoint.h" #include "context-internal.h" diff --git a/src/lib/lttng-ust/lttng-events.c b/src/lib/lttng-ust/lttng-events.c index bff03a8e..1981726f 100644 --- a/src/lib/lttng-ust/lttng-events.c +++ b/src/lib/lttng-ust/lttng-events.c @@ -41,7 +41,7 @@ #include "common/ust-context-provider.h" #include "lttng-ust-uuid.h" -#include "tracepoint-internal.h" +#include "common/tracepoint.h" #include "common/strutils.h" #include "lttng-bytecode.h" #include "lttng-tracer.h" diff --git a/src/lib/lttng-ust/lttng-probes.c b/src/lib/lttng-ust/lttng-probes.c index 7781811b..edc042f3 100644 --- a/src/lib/lttng-ust/lttng-probes.c +++ b/src/lib/lttng-ust/lttng-probes.c @@ -13,7 +13,7 @@ #include #include #include -#include "tracepoint-internal.h" +#include "common/tracepoint.h" #include #include "common/macros.h" #include diff --git a/src/lib/lttng-ust/lttng-ust-abi.c b/src/lib/lttng-ust/lttng-ust-abi.c index 4b876811..b6d49547 100644 --- a/src/lib/lttng-ust/lttng-ust-abi.c +++ b/src/lib/lttng-ust/lttng-ust-abi.c @@ -43,7 +43,7 @@ #include "common/ringbuffer/frontend.h" #include "common/ringbuffer/shm.h" #include "common/counter/counter.h" -#include "tracepoint-internal.h" +#include "common/tracepoint.h" #include "lttng-tracer.h" #include "common/strutils.h" #include "lib/lttng-ust/events.h" diff --git a/src/lib/lttng-ust/lttng-ust-comm.c b/src/lib/lttng-ust/lttng-ust-comm.c index 083de26d..e02cffd2 100644 --- a/src/lib/lttng-ust/lttng-ust-comm.c +++ b/src/lib/lttng-ust/lttng-ust-comm.c @@ -43,7 +43,7 @@ #include "common/ust-fd.h" #include "common/logging.h" #include "common/macros.h" -#include "tracepoint-internal.h" +#include "common/tracepoint.h" #include "lttng-tracer-core.h" #include "common/compat/pthread.h" #include "common/procname.h" -- 2.34.1