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.7.0-rc2~122 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e006eedf213940a503129393b3b0a28dbb2098f6;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 a48549178..8c35d749e 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) {