lttng-sessiond: do not call ustctl_register_done()
authorGerlando Falauto <gerlando.falauto@keymile.com>
Thu, 5 Jan 2012 11:25:29 +0000 (12:25 +0100)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 9 Jan 2012 19:19:35 +0000 (14:19 -0500)
When lttng-ust support is not enabled, compilation might fail with:
lttng-tools.git/lttng-sessiond/main.c:1167: undefined reference to
`ustctl_register_done'

Actually when HAVE_LIBLTTNG_UST_CTL is not defined, the function call is
normally optimized out by the compiler because ust_app_register() is a
static inline alway returning a negative value, leaving the call within
unreachable code.

Depending on the compiler version and optimization flags, this may
however not always happen, leading to the above error.

Therefore replace ustctl_register_done() with ustapp_register_done(),
which calls the original function when lttng-ust is enabled, and returns
an error otherwise (it is unreachable code anyway).

Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
lttng-sessiond/main.c
lttng-sessiond/ust-app.h

index 845ec0684ba69b2a85848d2c3a450889cd078d2c..91db9677abdfd24a6d781db11bd47951f95fbed9 100644 (file)
@@ -1157,7 +1157,7 @@ static void *thread_manage_apps(void *data)
                                         */
                                        update_ust_app(ust_cmd.sock);
 
-                                       ret = ustctl_register_done(ust_cmd.sock);
+                                       ret = ust_app_register_done(ust_cmd.sock);
                                        if (ret < 0) {
                                                /*
                                                 * If the registration is not possible, we simply
index 8cc049aefb9b12ad4c9b0146a8a739120823337d..071ad0d90d0189c93ebfc3427a256cf820cd5e8d 100644 (file)
@@ -119,6 +119,11 @@ struct ust_app {
 #ifdef HAVE_LIBLTTNG_UST_CTL
 
 int ust_app_register(struct ust_register_msg *msg, int sock);
+static inline
+int ust_app_register_done(int sock)
+{
+       return ustctl_register_done(sock);
+}
 void ust_app_unregister(int sock);
 unsigned long ust_app_list_count(void);
 int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app);
@@ -195,6 +200,11 @@ int ust_app_register(struct ust_register_msg *msg, int sock)
        return -ENOSYS;
 }
 static inline
+int ust_app_register_done(int sock)
+{
+       return -ENOSYS;
+}
+static inline
 void ust_app_unregister(int sock)
 {
 }
This page took 0.030295 seconds and 4 git commands to generate.