Don't save log level in session configuration when unneeded
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 28 Aug 2015 18:53:26 +0000 (14:53 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 8 Sep 2015 12:55:11 +0000 (08:55 -0400)
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 <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/save.c

index a485491780edf8fec00499559d86ce08b9d16aec..8c35d749e5272539c4703a5b8b104ab6c3a62a8c 100644 (file)
@@ -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) {
This page took 0.027505 seconds and 4 git commands to generate.