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>
*/
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
#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);
return -ENOSYS;
}
static inline
+int ust_app_register_done(int sock)
+{
+ return -ENOSYS;
+}
+static inline
void ust_app_unregister(int sock)
{
}