[lttng-dev] [PATCH lttng-tools] Use pkgconfig to detect and configure liblttng-ust
Signed-off-by: Michael Jeanson --- configure.ac | 25 +-- src/bin/lttng-consumerd/Makefile.am | 2 +- src/bin/lttng-sessiond/Makefile.am| 2 +- src/common/ust-consumer/Makefile.am | 2 +- tests/regression/tools/filtering/Makefile.am | 2 +- .../ust/baddr-statedump/Makefile.am | 2 +- tests/regression/ust/daemon/Makefile.am | 2 +- tests/regression/ust/exit-fast/Makefile.am| 2 +- tests/regression/ust/fork/Makefile.am | 4 +-- .../ust/high-throughput/Makefile.am | 2 +- tests/regression/ust/libc-wrapper/Makefile.am | 2 +- tests/regression/ust/linking/Makefile.am | 10 .../regression/ust/low-throughput/Makefile.am | 2 +- tests/regression/ust/multi-lib/Makefile.am| 6 ++--- .../regression/ust/multi-session/Makefile.am | 2 +- tests/regression/ust/overlap/demo/Makefile.am | 4 +-- .../ust/type-declarations/Makefile.am | 3 ++- tests/unit/Makefile.am| 4 +-- .../testapp/gen-ust-events-ns/Makefile.am | 2 +- .../utils/testapp/gen-ust-events/Makefile.am | 2 +- .../testapp/gen-ust-nevents-str/Makefile.am | 2 +- .../utils/testapp/gen-ust-nevents/Makefile.am | 2 +- .../utils/testapp/gen-ust-tracef/Makefile.am | 2 +- 23 files changed, 44 insertions(+), 44 deletions(-) diff --git a/configure.ac b/configure.ac index e57f53631..dd708883b 100644 --- a/configure.ac +++ b/configure.ac @@ -560,19 +560,18 @@ AC_ARG_WITH([lttng-ust], [with_lttng_ust=yes] ) -AS_IF([test "x$with_lttng_ust" = "xyes"], - [ -AC_CHECK_LIB([lttng-ust-ctl], [ustctl_recv_channel_from_consumer], - [ -AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1]) - ], - [ -AC_MSG_FAILURE([Cannot find LTTng-UST >= 2.2.x. Use [LDFLAGS]=-Ldir and [CPPFLAGS]=-Idir to specify its location, or specify --without-lttng-ust to build lttng-tools without LTTng-UST support.]) - ], - [-lurcu-common -lurcu-bp -lurcu-cds -lrt -ldl] -) - ] -) +AS_IF([test "x$with_lttng_ust" = "xyes"], [ + AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1]) + + # Check for liblttng-ust + PKG_CHECK_MODULES([UST], [lttng-ust >= $major_version.$minor_version]) + + # Check for liblttng-ust-ctl + PKG_CHECK_MODULES([UST_CTL], [lttng-ust-ctl >= $major_version.$minor_version]) + + AM_CPPFLAGS="$AM_CPPFLAGS $UST_CFLAGS" +]) + AM_CONDITIONAL([HAVE_LIBLTTNG_UST_CTL], [test "x$with_lttng_ust" = "xyes"]) diff --git a/src/bin/lttng-consumerd/Makefile.am b/src/bin/lttng-consumerd/Makefile.am index 9d54309cf..0659a34a0 100644 --- a/src/bin/lttng-consumerd/Makefile.am +++ b/src/bin/lttng-consumerd/Makefile.am @@ -16,5 +16,5 @@ lttng_consumerd_LDADD = \ lttng_consumerd_LDFLAGS = -rdynamic if HAVE_LIBLTTNG_UST_CTL -lttng_consumerd_LDADD += -llttng-ust-ctl +lttng_consumerd_LDADD += $(UST_CTL_LIBS) endif diff --git a/src/bin/lttng-sessiond/Makefile.am b/src/bin/lttng-sessiond/Makefile.am index 296ec148b..ebb8cb284 100644 --- a/src/bin/lttng-sessiond/Makefile.am +++ b/src/bin/lttng-sessiond/Makefile.am @@ -78,5 +78,5 @@ lttng_sessiond_LDADD = -lurcu-common -lurcu $(KMOD_LIBS) \ if HAVE_LIBLTTNG_UST_CTL -lttng_sessiond_LDADD += -llttng-ust-ctl +lttng_sessiond_LDADD += $(UST_CTL_LIBS) endif diff --git a/src/common/ust-consumer/Makefile.am b/src/common/ust-consumer/Makefile.am index 1acdc7f12..1df8b53c0 100644 --- a/src/common/ust-consumer/Makefile.am +++ b/src/common/ust-consumer/Makefile.am @@ -5,7 +5,7 @@ noinst_LTLIBRARIES = libust-consumer.la libust_consumer_la_SOURCES = ust-consumer.c ust-consumer.h libust_consumer_la_LIBADD = \ - -llttng-ust-ctl \ + $(UST_CTL_LIBS) \ $(top_builddir)/src/common/relayd/librelayd.la endif diff --git a/tests/regression/tools/filtering/Makefile.am b/tests/regression/tools/filtering/Makefile.am index b214fc1d6..5900a2093 100644 --- a/tests/regression/tools/filtering/Makefile.am +++ b/tests/regression/tools/filtering/Makefile.am @@ -3,7 +3,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/tests -I$(srcdir) if HAVE_LIBLTTNG_UST_CTL noinst_PROGRAMS = gen-ust-events gen_ust_events_SOURCES = gen-ust-events.c tp.c tp.h -gen_ust_events_LDADD = -llttng-ust -lurcu-bp $(DL_LIBS) +gen_ust_events_LDADD = $(UST_LIBS) $(DL_LIBS) endif noinst_SCRIPTS = test_unsupported_op test_invalid_filter test_valid_filter diff --git a/tests/regression/ust/baddr-statedump/Makefile.am b/tests/regression/ust/baddr-statedump/Makefile.am index bf51f9483..253c9029f 100644 --- a/tests/regression/ust/baddr-statedump/Makefile.am +++ b/tests/regression/ust/baddr-statedump/Makefile.am @@ -6,7 +6,7 @@ AM_CPPFLAGS += -I$(srcdir) -g noinst_PROGRAMS = prog prog_SOURCES = prog.c tp.c tp.h -prog_LDADD = -llttng-ust $(DL_LIBS) +prog_LDADD = $(UST_LIBS) $(DL_LIBS) noinst_SCRIPTS = test_baddr-statedump test_baddr-statedump.py EXTRA_DIST = test_baddr-statedump test_baddr-statedump.py diff --git
[lttng-dev] [PATCH lttng-tools] Replace libuuid with internal implementation
We use a very small subset of libuuid features to transform UUIDs between their string and binary representation. Plus we have a lot of compat code for different platforms with some unspecified default behavior regarding the use of upper/lower case. Drop the dependency on libuuid and replace it with a minimal internal implementation that respects RFC4122. Signed-off-by: Michael Jeanson --- .gitignore | 1 + configure.ac | 42 src/bin/lttng-relayd/cmd-2-11.h | 2 +- src/bin/lttng-relayd/main.c | 6 +- src/bin/lttng-relayd/session.c | 4 +- src/bin/lttng-relayd/session.h | 2 +- src/bin/lttng-relayd/sessiond-trace-chunks.c | 16 +- src/bin/lttng-relayd/sessiond-trace-chunks.h | 2 +- src/bin/lttng-sessiond/globals.c | 2 +- src/bin/lttng-sessiond/lttng-sessiond.h | 2 +- src/bin/lttng-sessiond/main.c| 2 +- src/bin/lttng-sessiond/ust-app.h | 2 +- src/bin/lttng-sessiond/ust-clock.h | 2 +- src/bin/lttng-sessiond/ust-metadata.c| 4 +- src/bin/lttng-sessiond/ust-registry.h| 4 +- src/common/Makefile.am | 6 +- src/common/compat/Makefile.am| 2 +- src/common/compat/uuid.c | 48 - src/common/consumer/consumer.c | 2 +- src/common/consumer/consumer.h | 4 +- src/common/sessiond-comm/relayd.h| 2 +- src/common/sessiond-comm/sessiond-comm.h | 4 +- src/common/uuid.c| 130 + src/common/{compat => }/uuid.h | 66 +++ tests/unit/Makefile.am | 6 +- tests/unit/test_uuid.c | 193 +++ 26 files changed, 393 insertions(+), 163 deletions(-) delete mode 100644 src/common/compat/uuid.c create mode 100644 src/common/uuid.c rename src/common/{compat => }/uuid.h (58%) create mode 100644 tests/unit/test_uuid.c diff --git a/.gitignore b/.gitignore index 00a68d427..1bdbacb5c 100644 --- a/.gitignore +++ b/.gitignore @@ -83,6 +83,7 @@ compile_commands.json /tests/unit/test_utils_parse_size_suffix /tests/unit/test_utils_parse_time_suffix /tests/unit/test_utils_expand_path +/tests/unit/test_uuid /tests/unit/test_notification /tests/unit/test_directory_handle kernel_all_events_basic diff --git a/configure.ac b/configure.ac index dd708883b..8c0683fe2 100644 --- a/configure.ac +++ b/configure.ac @@ -448,48 +448,6 @@ AC_SUBST(POPT_LIBS) PKG_CHECK_MODULES([libxml2], [libxml-2.0 >= 2.7.6]) -# First, check for uuid in system libs -AH_TEMPLATE([LTTNG_HAVE_LIBUUID], [Define if you have libuuid support]) -AC_CHECK_FUNCS([uuid_generate], - [ -AC_DEFINE([LTTNG_HAVE_LIBUUID], [1]) -UUID_LIBS="" - ], - [ -# Then, check if the pkg-config module is available, otherwise explicitly check -# for libuuid, or uuid support in the C-library. -PKG_CHECK_MODULES([UUID], [uuid], - [ -AC_DEFINE([LTTNG_HAVE_LIBUUID], [1]) -dnl PKG_CHECK_MODULES defines UUID_LIBS - ], - [ -AC_MSG_WARN([pkg-config was unable to find a valid .pc for libuuid. Set PKG_CONFIG_PATH to specify the pkgconfig configuration file location]) -AC_MSG_WARN([Finding libuuid without pkg-config.]) -AC_CHECK_LIB([uuid], [uuid_generate], - [ -AC_DEFINE([LTTNG_HAVE_LIBUUID], [1]) -UUID_LIBS="-luuid" - ], - [ -# libuuid not found, check for uuid_create in libc. -AC_CHECK_LIB([c], [uuid_create], - [ -AC_DEFINE([LTTNG_HAVE_LIBUUID], [1]) -UUID_LIBS="-lc" - ], - [ -AC_MSG_FAILURE([Cannot find libuuid uuid_generate nor libc uuid_create. Either set PKG_CONFIG_PATH to the configuration file location or use LDFLAGS=-Ldir to specify the library location]) - ] -) - ] -) - ] -) - ] -) -AC_SUBST(UUID_LIBS) - AC_CHECK_FUNC([clock_gettime], [AC_DEFINE_UNQUOTED([LTTNG_HAVE_CLOCK_GETTIME], 1, [Has clock_gettime() support.])]) # URCU library version needed or newer diff --git a/src/bin/lttng-relayd/cmd-2-11.h b/src/bin/lttng-relayd/cmd-2-11.h index fc9021024..8ac089482 100644 --- a/src/bin/lttng-relayd/cmd-2-11.h +++ b/src/bin/lttng-relayd/cmd-2-11.h @@ -19,7 +19,7 @@ #include "lttng-relayd.h" #include -#include +#include int cmd_create_session_2_11(const struct lttng_buffer_view *payload, char *session_name, char *hostname, char *base_path, diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 5f72c32a9..66505bfd5 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -2265,7 +2265,7 @@ static int relay_rotate_session_streams( session->sessi
[lttng-dev] [PATCH lttng-tools] fix: Use DL_LIBS variable in ust multi-lib test
Signed-off-by: Michael Jeanson --- tests/regression/ust/multi-lib/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/regression/ust/multi-lib/Makefile.am b/tests/regression/ust/multi-lib/Makefile.am index 0ce46a7ff..52a1635c2 100644 --- a/tests/regression/ust/multi-lib/Makefile.am +++ b/tests/regression/ust/multi-lib/Makefile.am @@ -3,11 +3,11 @@ EXTRA_DIST = test_multi_lib noinst_PROGRAMS = exec-with-callsites exec-without-callsites exec_with_callsites_SOURCES = multi-lib-test.c callsites.c -exec_with_callsites_LDFLAGS = -ldl $(POPT_LIBS) +exec_with_callsites_LDFLAGS = $(DL_LIBS) $(POPT_LIBS) exec_with_callsites_CFLAGS = $(POPT_CFLAGS) $(AM_CFLAGS) -DHAS_CALLSITES=1 exec_without_callsites_SOURCES = multi-lib-test.c -exec_without_callsites_LDFLAGS = -ldl $(POPT_LIBS) $(UST_LIBS) +exec_without_callsites_LDFLAGS = $(DL_LIBS) $(POPT_LIBS) $(UST_LIBS) exec_without_callsites_LDADD = probes.o exec_without_callsites_CFLAGS = $(POPT_CFLAGS) $(AM_CFLAGS) -DHAS_CALLSITES=0 -- 2.17.1 ___ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
[lttng-dev] [PATCH lttng-ust] Docs: LTTNG-UST(3): missing references to some namespace man pages
The LTTNG-UST(3) manual page is missing references to the mount, network, ipc, and uts namespace man pages. Signed-off-by: Jérémie Galarneau --- doc/man/lttng-ust.3.txt | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/man/lttng-ust.3.txt b/doc/man/lttng-ust.3.txt index 1bd4d1e0..2534612a 100644 --- a/doc/man/lttng-ust.3.txt +++ b/doc/man/lttng-ust.3.txt @@ -804,15 +804,15 @@ The following man:namespaces(7) context fields are supported by LTTng-UST: `ipc_ns`:: System V IPC, POSIX message queues namespace: inode number of the -current IPC namespace in the proc filesystem. +current man:ipc_namespaces(7) namespace in the proc filesystem. `mnt_ns`:: -Mount points namespace: inode number of the current Mount namespace -in the proc filesystem. +Mount points namespace: inode number of the current +man:mount_namespaces(7) in the proc filesystem. `net_ns`:: Network devices, stacks, ports namespace: inode number of the -current Network namespace in the proc filesystem. +current man:network_namespaces(7) in the proc filesystem. `pid_ns`:: Process IDs namespace: inode number of the current @@ -824,7 +824,7 @@ The following man:namespaces(7) context fields are supported by LTTng-UST: `uts_ns`:: Hostname and NIS domain name namespace: inode number of the -current UTS namespace in the proc filesystem. +current man:uts_namespaces(7) in the proc filesystem. The following man:credentials(7) context fields are supported by LTTng-UST: -- 2.23.0 ___ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Re: [lttng-dev] [PATCH lttng-ust] Docs: LTTNG-UST(3): missing references to some namespace man pages
On 2019-10-24 3:08 p.m., Jérémie Galarneau wrote: > The LTTNG-UST(3) manual page is missing references to the mount, > network, ipc, and uts namespace man pages. > > Signed-off-by: Jérémie Galarneau > --- > doc/man/lttng-ust.3.txt | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/doc/man/lttng-ust.3.txt b/doc/man/lttng-ust.3.txt > index 1bd4d1e0..2534612a 100644 > --- a/doc/man/lttng-ust.3.txt > +++ b/doc/man/lttng-ust.3.txt > @@ -804,15 +804,15 @@ The following man:namespaces(7) context fields are > supported by LTTng-UST: > > `ipc_ns`:: > System V IPC, POSIX message queues namespace: inode number of the > -current IPC namespace in the proc filesystem. > +current man:ipc_namespaces(7) namespace in the proc filesystem. > > `mnt_ns`:: > -Mount points namespace: inode number of the current Mount namespace > -in the proc filesystem. > +Mount points namespace: inode number of the current > +man:mount_namespaces(7) in the proc filesystem. > > `net_ns`:: > Network devices, stacks, ports namespace: inode number of the > -current Network namespace in the proc filesystem. > +current man:network_namespaces(7) in the proc filesystem. > > `pid_ns`:: > Process IDs namespace: inode number of the current > @@ -824,7 +824,7 @@ The following man:namespaces(7) context fields are > supported by LTTng-UST: > > `uts_ns`:: > Hostname and NIS domain name namespace: inode number of the > -current UTS namespace in the proc filesystem. > +current man:uts_namespaces(7) in the proc filesystem. > > The following man:credentials(7) context fields are supported by LTTng-UST: > > The 'ipc_namespaces(7)' and 'uts_namespaces(7)' aren't present on my system, do you have them on Arch? ___ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Re: [lttng-dev] [PATCH lttng-ust] Docs: LTTNG-UST(3): missing references to some namespace man pages
On Thu, 24 Oct 2019 at 15:12, Michael Jeanson wrote: > > On 2019-10-24 3:08 p.m., Jérémie Galarneau wrote: > > The LTTNG-UST(3) manual page is missing references to the mount, > > network, ipc, and uts namespace man pages. > > > > Signed-off-by: Jérémie Galarneau > > --- > > doc/man/lttng-ust.3.txt | 10 +- > > 1 file changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/doc/man/lttng-ust.3.txt b/doc/man/lttng-ust.3.txt > > index 1bd4d1e0..2534612a 100644 > > --- a/doc/man/lttng-ust.3.txt > > +++ b/doc/man/lttng-ust.3.txt > > @@ -804,15 +804,15 @@ The following man:namespaces(7) context fields are > > supported by LTTng-UST: > > > > `ipc_ns`:: > > System V IPC, POSIX message queues namespace: inode number of the > > -current IPC namespace in the proc filesystem. > > +current man:ipc_namespaces(7) namespace in the proc filesystem. > > > > `mnt_ns`:: > > -Mount points namespace: inode number of the current Mount namespace > > -in the proc filesystem. > > +Mount points namespace: inode number of the current > > +man:mount_namespaces(7) in the proc filesystem. > > > > `net_ns`:: > > Network devices, stacks, ports namespace: inode number of the > > -current Network namespace in the proc filesystem. > > +current man:network_namespaces(7) in the proc filesystem. > > > > `pid_ns`:: > > Process IDs namespace: inode number of the current > > @@ -824,7 +824,7 @@ The following man:namespaces(7) context fields are > > supported by LTTng-UST: > > > > `uts_ns`:: > > Hostname and NIS domain name namespace: inode number of the > > -current UTS namespace in the proc filesystem. > > +current man:uts_namespaces(7) in the proc filesystem. > > > > The following man:credentials(7) context fields are supported by LTTng-UST: > > > > > > The 'ipc_namespaces(7)' and 'uts_namespaces(7)' aren't present on my > system, do you have them on Arch? Yes, of course! ;-) Jérémie -- Jérémie Galarneau EfficiOS Inc. http://www.efficios.com ___ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Re: [lttng-dev] [PATCH lttng-ust] Docs: LTTNG-UST(3): missing references to some namespace man pages
merged into ust master, thanks! Mathieu - On Oct 24, 2019, at 3:08 PM, Jeremie Galarneau jeremie.galarn...@efficios.com wrote: > The LTTNG-UST(3) manual page is missing references to the mount, > network, ipc, and uts namespace man pages. > > Signed-off-by: Jérémie Galarneau > --- > doc/man/lttng-ust.3.txt | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/doc/man/lttng-ust.3.txt b/doc/man/lttng-ust.3.txt > index 1bd4d1e0..2534612a 100644 > --- a/doc/man/lttng-ust.3.txt > +++ b/doc/man/lttng-ust.3.txt > @@ -804,15 +804,15 @@ The following man:namespaces(7) context fields are > supported by LTTng-UST: > > `ipc_ns`:: > System V IPC, POSIX message queues namespace: inode number of the > -current IPC namespace in the proc filesystem. > +current man:ipc_namespaces(7) namespace in the proc filesystem. > > `mnt_ns`:: > -Mount points namespace: inode number of the current Mount namespace > -in the proc filesystem. > +Mount points namespace: inode number of the current > +man:mount_namespaces(7) in the proc filesystem. > > `net_ns`:: > Network devices, stacks, ports namespace: inode number of the > -current Network namespace in the proc filesystem. > +current man:network_namespaces(7) in the proc filesystem. > > `pid_ns`:: > Process IDs namespace: inode number of the current > @@ -824,7 +824,7 @@ The following man:namespaces(7) context fields are > supported > by LTTng-UST: > > `uts_ns`:: > Hostname and NIS domain name namespace: inode number of the > -current UTS namespace in the proc filesystem. > +current man:uts_namespaces(7) in the proc filesystem. > > The following man:credentials(7) context fields are supported by LTTng-UST: > > -- > 2.23.0 -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com ___ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Re: [lttng-dev] [PATCH lttng-tools stable-2.11] fix: check for lttng-ust >= 2.11 at configure
Merged in master and stable-2.11. Thanks! Jérémie On Wed, Oct 23, 2019 at 11:08:34AM -0400, Michael Jeanson wrote: > We don't support building lttng-tools against an older version of > lttng-ust, make this check explicitly at configure. > > Signed-off-by: Michael Jeanson > --- > configure.ac | 7 +++ > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/configure.ac b/configure.ac > index 5c4073ef8..357e2b888 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -562,14 +562,13 @@ AC_ARG_WITH([lttng-ust], > > AS_IF([test "x$with_lttng_ust" = "xyes"], >[ > -AC_CHECK_LIB([lttng-ust-ctl], [ustctl_recv_channel_from_consumer], > +AC_CHECK_LIB([lttng-ust-ctl], [lttng_ust_enum_get_from_desc], >[ > AC_DEFINE([HAVE_LIBLTTNG_UST_CTL], [1]) >], >[ > -AC_MSG_FAILURE([Cannot find LTTng-UST >= 2.2.x. Use [LDFLAGS]=-Ldir > and [CPPFLAGS]=-Idir to specify its location, or specify --without-lttng-ust > to build lttng-tools without LTTng-UST support.]) > - ], > - [-lurcu-common -lurcu-bp -lurcu-cds -lrt -ldl] > +AC_MSG_FAILURE([Cannot find LTTng-UST >= 2.11.x. Use [LDFLAGS]=-Ldir > and [CPPFLAGS]=-Idir to specify its location, or specify --without-lttng-ust > to build lttng-tools without LTTng-UST support.]) > + ] > ) >] > ) > -- > 2.17.1 > ___ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev