Fix: build failures when `--without-lttng-ust`
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 10 Jan 2020 00:34:16 +0000 (19:34 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 13 Jan 2020 20:42:14 +0000 (15:42 -0500)
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 <francis.deslauriers@efficios.com>
Change-Id: I66c57d206ad0142db057443374d28bbcf16c02f7
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/trace-ust.h
tests/unit/Makefile.am

index 11486ddd04a59df8a29afe5ecf4d16313818a89e..216bccb80f6bc75f28e88e4891d092d0621d47ed 100644 (file)
@@ -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;
 }
index adc68406d4c0848767318a4b248300c0b7b40c53..000687a07518651a081feb9b2d29904266b4e7e2 100644 (file)
@@ -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)
This page took 0.031446 seconds and 4 git commands to generate.