From 4e6581a7740c292be662d108a21a80e478b42a71 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Thu, 9 Jan 2020 19:34:16 -0500 Subject: [PATCH] Fix: build failures when `--without-lttng-ust` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The `--without-lttng-ust` configure option makes the build to fail due to 2 bugs 1. Missing object file for session unit tests causes the following errors: CCLD test_session ../../src/bin/lttng-sessiond/kernel.o: In function `kernel_track_id': /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/kernel.c:712: undefined reference to `lttng_tracker_id_lookup_string' /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/kernel.c:723: undefined reference to `lttng_tracker_id_get_list' /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/kernel.c:729: undefined reference to `lttng_tracker_list_add' /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/kernel.c:810: undefined reference to `lttng_tracker_id_set_list' ../../src/bin/lttng-sessiond/kernel.o: In function `kernel_untrack_id': /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/kernel.c:826: undefined reference to `lttng_tracker_id_lookup_string' /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/kernel.c:836: undefined reference to `lttng_tracker_id_get_list' /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/kernel.c:841: undefined reference to `lttng_tracker_list_remove' /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/kernel.c:925: undefined reference to `lttng_tracker_id_set_list' ../../src/bin/lttng-sessiond/kernel.o: In function `kernel_list_tracker_ids': /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/kernel.c:949: undefined reference to `lttng_tracker_id_get_list' ../../src/bin/lttng-sessiond/trace-kernel.o: In function `trace_kernel_create_session': /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/trace-kernel.c:167: undefined reference to `lttng_tracker_list_create' /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/trace-kernel.c:171: undefined reference to `lttng_tracker_list_create' /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/trace-kernel.c:175: undefined reference to `lttng_tracker_list_create' /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/trace-kernel.c:179: undefined reference to `lttng_tracker_list_create' /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/trace-kernel.c:183: undefined reference to `lttng_tracker_list_create' ../../src/bin/lttng-sessiond/trace-kernel.o:/home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/trace-kernel.c:187: more undefined references to `lttng_tracker_list_create' follow ../../src/bin/lttng-sessiond/trace-kernel.o: In function `trace_kernel_create_session': /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/trace-kernel.c:199: undefined reference to `lttng_tracker_list_destroy' /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/trace-kernel.c:200: undefined reference to `lttng_tracker_list_destroy' /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/trace-kernel.c:201: undefined reference to `lttng_tracker_list_destroy' /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/trace-kernel.c:202: undefined reference to `lttng_tracker_list_destroy' /home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/trace-kernel.c:203: undefined reference to `lttng_tracker_list_destroy' ../../src/bin/lttng-sessiond/trace-kernel.o:/home/frdeso/projets/lttng/tools/src/bin/lttng-sessiond/trace-kernel.c:204: more undefined references to `lttng_tracker_list_destroy' follow collect2: error: ld returned 1 exit status Makefile:1062: recipe for target 'test_session' failed make[1]: *** [test_session] Error 1 make[1]: Leaving directory '/home/frdeso/projets/lttng/tools/tests/unit' Makefile:1166: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1 2. An extra colon at the end of the `trace_ust_track_id()` stub function gives this error: CC utils.o In file included from ust-app.h:26:0, from lttng-sessiond.h:31, from utils.c:27: trace-ust.h:339:1: error: expected identifier or '(' before '{' token { ^ trace-ust.h:336:19: warning: 'trace_ust_track_id' declared 'static' but never defined [-Wunused-function] static inline int trace_ust_track_id(enum lttng_tracker_type tracker_type, ^~~~~~~~~~~~~~~~~~ Makefile:729: recipe for target 'utils.o' failed Both bugs are trivial to fix. Signed-off-by: Francis Deslauriers Change-Id: I66c57d206ad0142db057443374d28bbcf16c02f7 Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/trace-ust.h | 2 +- tests/unit/Makefile.am | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/lttng-sessiond/trace-ust.h b/src/bin/lttng-sessiond/trace-ust.h index 11486ddd0..216bccb80 100644 --- a/src/bin/lttng-sessiond/trace-ust.h +++ b/src/bin/lttng-sessiond/trace-ust.h @@ -335,7 +335,7 @@ struct agent *trace_ust_find_agent(struct ltt_ust_session *session, } static inline int trace_ust_track_id(enum lttng_tracker_type tracker_type, struct ltt_ust_session *session, - const struct lttng_tracker_id *id); + const struct lttng_tracker_id *id) { return 0; } diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index adc68406d..000687a07 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -79,6 +79,7 @@ SESSIOND_OBJS = $(top_builddir)/src/bin/lttng-sessiond/buffer-registry.$(OBJEXT) $(top_builddir)/src/bin/lttng-sessiond/thread-utils.$(OBJEXT) \ $(top_builddir)/src/bin/lttng-sessiond/process-utils.$(OBJEXT) \ $(top_builddir)/src/bin/lttng-sessiond/thread.$(OBJEXT) \ + $(top_builddir)/src/bin/lttng-sessiond/tracker.$(OBJEXT) \ $(top_builddir)/src/common/libcommon.la \ $(top_builddir)/src/common/testpoint/libtestpoint.la \ $(top_builddir)/src/common/compat/libcompat.la \ @@ -93,8 +94,7 @@ SESSIOND_OBJS += $(top_builddir)/src/bin/lttng-sessiond/trace-ust.$(OBJEXT) \ $(top_builddir)/src/bin/lttng-sessiond/notify-apps.$(OBJEXT) \ $(top_builddir)/src/bin/lttng-sessiond/ust-metadata.$(OBJEXT) \ $(top_builddir)/src/bin/lttng-sessiond/agent-thread.$(OBJEXT) \ - $(top_builddir)/src/bin/lttng-sessiond/ust-field-utils.$(OBJEXT) \ - $(top_builddir)/src/bin/lttng-sessiond/tracker.$(OBJEXT) + $(top_builddir)/src/bin/lttng-sessiond/ust-field-utils.$(OBJEXT) endif RELAYD_OBJS = $(top_builddir)/src/bin/lttng-relayd/backward-compatibility-group-by.$(OBJEXT) -- 2.34.1