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, 1 Sep 2015 16:03:08 +0000 (12:03 -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 2e3e3d68451db189ae7af0d8eba650ebb28a2233..f8911aa53adb1157a13385e79f7ae508d94650c8 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.036411 seconds and 4 git commands to generate.