From: David Goulet Date: Fri, 22 Jun 2012 15:02:51 +0000 (-0400) Subject: Fix: enable event loglevel match function X-Git-Tag: v2.1.0-rc1~105 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=51f1a3b9df60b6951e8748961893cb4129cf4832;p=lttng-tools.git Fix: enable event loglevel match function For the loglevel type ALL, the value set in an event inside the session daemon is -1 where the value received from the client is 0. For this loglevel type, the loglevel does not matter. This fixes the commit c0657016bbb98e1769edbaba8c00221f964c7402 done before version 2.0.2. (Closes #283 #287) Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/event.c b/src/bin/lttng-sessiond/event.c index 4bc8fb90d..24dd292a4 100644 --- a/src/bin/lttng-sessiond/event.c +++ b/src/bin/lttng-sessiond/event.c @@ -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;