From: Jérémie Galarneau Date: Fri, 28 Aug 2015 18:53:26 +0000 (-0400) Subject: Don't save log level in session configuration when unneeded X-Git-Tag: v2.8.0-rc1~451 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1adbdb1045a79cd4a02941c5994820ccb17a68c3;p=lttng-tools.git Don't save log level in session configuration when unneeded Saving the log level of events in session configurations when "ALL" log levels are enabled may confuse both users and programs working with session configurations. Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c index 2e3e3d684..f8911aa53 100644 --- a/src/bin/lttng-sessiond/save.c +++ b/src/bin/lttng-sessiond/save.c @@ -642,11 +642,14 @@ int save_ust_event(struct config_writer *writer, goto end; } - ret = config_writer_write_element_signed_int(writer, - config_element_loglevel, event->attr.loglevel); - if (ret) { - ret = LTTNG_ERR_SAVE_IO_FAIL; - goto end; + /* The log level is irrelevant if no "filtering" is enabled */ + if (event->attr.loglevel_type != LTTNG_UST_LOGLEVEL_ALL) { + ret = config_writer_write_element_signed_int(writer, + config_element_loglevel, event->attr.loglevel); + if (ret) { + ret = LTTNG_ERR_SAVE_IO_FAIL; + goto end; + } } if (event->filter_expression) {