Fix: Wrong returned error code on UST enable event
[lttng-tools.git] / src / bin / lttng-sessiond / event.c
index 4bc8fb90df81f6b722d5ef50d282a6c4cf15d597..f8255e1231eb33850eb82e15a2a60fa6c7fcd345 100644 (file)
@@ -51,6 +51,15 @@ static void init_syscalls_kernel_event(struct lttng_event *event)
 static int loglevel_match(struct ltt_ust_event *uevent,
                enum lttng_ust_loglevel_type log_type, int loglevel)
 {
+       /*
+        * For the loglevel type ALL, the loglevel is set to -1 but the event
+        * received by the session daemon is 0 which does not match the negative
+        * value in the existing event.
+        */
+       if (log_type == LTTNG_UST_LOGLEVEL_ALL) {
+               loglevel = -1;
+       }
+
        if (uevent == NULL || uevent->attr.loglevel_type != log_type ||
                        uevent->attr.loglevel != loglevel) {
                goto no_match;
@@ -405,7 +414,7 @@ int event_ust_enable_tracepoint(struct ltt_ust_session *usess, int domain,
        if (uevent == NULL) {
                uevent = trace_ust_create_event(event);
                if (uevent == NULL) {
-                       ret = LTTCOMM_FATAL;
+                       ret = LTTCOMM_UST_ENABLE_FAIL;
                        goto error;
                }
                /* Valid to set it after the goto error since uevent is still NULL */
This page took 0.02276 seconds and 4 git commands to generate.