Fix: "Any" loglevel's value is -1 and not 0
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 28 Nov 2014 23:08:30 +0000 (18:08 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 1 Dec 2014 02:22:02 +0000 (21:22 -0500)
lttng_disable_event_ext() was erroring-out on loglevel != 0.
loglevel 0 is a valid level whereas "-1" is used an unknown/unspecified
in the rest of the code.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.c
src/bin/lttng/commands/disable_events.c
src/lib/lttng-ctl/lttng-ctl.c

index 33ab492daf330eacacc239646b866b612d5975e8..696e650debb70e6c0f9724b506a1b1413f0bd3a7 100644 (file)
@@ -1042,7 +1042,8 @@ int cmd_disable_event(struct ltt_session *session, int domain,
 
        event_name = event->name;
 
-       if (event->loglevel_type || event->loglevel || event->enabled
+       /* Error out on unhandled search criteria */
+       if (event->loglevel_type || event->loglevel != -1 || event->enabled
                        || event->pid || event->filter || event->exclusion) {
                return LTTNG_ERR_UNK;
        }
index 9ab8bf0b2972f244a4e9223105e7543b0c8025cf..45e91a8bbfe7c3e5ec49b975a219187f002d2a15 100644 (file)
@@ -222,6 +222,9 @@ static int disable_events(char *session_name)
        }
 
        memset(&event, 0, sizeof(event));
+       /* Set default loglevel to any/unknown */
+       event.loglevel = -1;
+
        switch (opt_event_type) {
        case LTTNG_EVENT_SYSCALL:
                event.type = LTTNG_EVENT_SYSCALL;
index 0041969657e18089c8a957c941924363a752daaf..4a0a07b14ec1a08faba8c2b94199f2ef7a6e7f54 100644 (file)
@@ -1216,6 +1216,7 @@ int lttng_disable_event(struct lttng_handle *handle, const char *name,
        struct lttng_event ev;
 
        memset(&ev, 0, sizeof(ev));
+       ev.loglevel = -1;
        ev.type = LTTNG_EVENT_ALL;
        lttng_ctl_copy_string(ev.name, name, sizeof(ev.name));
        return lttng_disable_event_ext(handle, &ev, channel_name, NULL);
This page took 0.029428 seconds and 4 git commands to generate.