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.6.1~67 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e6112cc674b7a50daaefd34b5d4fc2f72404a0ec;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 d231fb24f..e9f651ce2 100644 --- a/src/bin/lttng-sessiond/save.c +++ b/src/bin/lttng-sessiond/save.c @@ -624,11 +624,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) {