Fix: Parenthesize previous statement when adding conditions to a filter
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 28 Aug 2014 16:53:43 +0000 (12:53 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 3 Sep 2014 19:00:22 +0000 (15:00 -0400)
commit262c79ae38080b98923e64f40c2c0788a452e410
tree1289d904e606ff3abd9f0a49d799f91be1d50044
parentfbdb7e15cbe6235cadaaa7c1b2213f128e747e47
Fix: Parenthesize previous statement when adding conditions to a filter

Not parenthesizing the clauses in a filter string causes JUL events to be
traced even though they are not enabled when an enable-event command is
issued with a filter and the --loglevel-only option.

For instance,

lttng enable-event -j "my_event" --loglevel-only JUL_CONFIG -f "int_loglevel > 0 || int_loglevel < 0"

results in the following filter being applied:

int_loglevel > 0 || int_loglevel < 0 && logger_name == "my_event" && int_loglevel == 700

The resulting expression will always evaluate to true, regardless of the logger
name.

This fix parenthesizes each clause to ensure they are all independently
evaluated and not unintuitively affected by operator precedence.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/lib/lttng-ctl/lttng-ctl.c
This page took 0.025223 seconds and 4 git commands to generate.