Fix: sessiond: invalid session configuration on EXCLUDE_ALL policy
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 7 Apr 2020 04:14:00 +0000 (00:14 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 7 Apr 2020 14:24:22 +0000 (10:24 -0400)
Saving a session with a process attribute tracker that uses the
`EXCLUDE_ALL` policy results in an invalid session configuration.

Currently, a tracker of the following form is produced:
<process_attr_values>
  <vpid/>
</process_attr_values>

This is invalid as per the XSD as 'vpid' is not a list; it is an
individual tracked attribute.

The appropriate '<process_attr_values/>' empty node is now produced.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ia31e276fe7246a89e72d6808c9ed960fb04f1b3a

src/bin/lttng-sessiond/save.c

index 822662ef598330581cb333b4798e3236c51928dc..c5ea4c873d9df4981e8765068cf0e699173556a1 100644 (file)
@@ -1910,21 +1910,7 @@ static int save_process_attr_tracker(struct config_writer *writer,
                goto end;
        }
 
-       if (tracking_policy == LTTNG_TRACKING_POLICY_EXCLUDE_ALL) {
-               /* Tracking nothing; empty list. */
-               ret = config_writer_open_element(writer, element_target_id);
-               if (ret) {
-                       ret = LTTNG_ERR_SAVE_IO_FAIL;
-                       goto end;
-               }
-
-               /* /$element_target_id */
-               ret = config_writer_close_element(writer);
-               if (ret) {
-                       ret = LTTNG_ERR_SAVE_IO_FAIL;
-                       goto end;
-               }
-       } else {
+       if (tracking_policy == LTTNG_TRACKING_POLICY_INCLUDE_SET) {
                unsigned int i, count;
                enum process_attr_tracker_status status =
                                process_attr_tracker_get_inclusion_set(
@@ -2000,7 +1986,7 @@ static int save_process_attr_tracker(struct config_writer *writer,
                }
        }
 
-       /* /targets */
+       /* /values */
        ret = config_writer_close_element(writer);
        if (ret) {
                ret = LTTNG_ERR_SAVE_IO_FAIL;
This page took 0.034951 seconds and 4 git commands to generate.