From: Jérémie Galarneau Date: Tue, 7 Apr 2020 04:14:00 +0000 (-0400) Subject: Fix: sessiond: invalid session configuration on EXCLUDE_ALL policy X-Git-Tag: v2.12.0~6 X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=1dd5162676a969bc3d3dafc53c920e8c7b0da2f1;p=lttng-tools.git Fix: sessiond: invalid session configuration on EXCLUDE_ALL policy 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: This is invalid as per the XSD as 'vpid' is not a list; it is an individual tracked attribute. The appropriate '' empty node is now produced. Signed-off-by: Jérémie Galarneau Change-Id: Ia31e276fe7246a89e72d6808c9ed960fb04f1b3a --- diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c index 822662ef5..c5ea4c873 100644 --- a/src/bin/lttng-sessiond/save.c +++ b/src/bin/lttng-sessiond/save.c @@ -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;