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>
Wed, 23 Sep 2015 19:55:52 +0000 (15: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 d231fb24f9f9339577b077157661a1dcae975679..e9f651ce2378bd6a6beaa8df025b6f10450ae3f1 100644 (file)
@@ -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) {
This page took 0.026852 seconds and 4 git commands to generate.