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>
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;
}
}
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;
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);