Partial revert: channel name and default output
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 27 Jun 2016 21:42:29 +0000 (17:42 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 5 Jul 2016 22:53:50 +0000 (18:53 -0400)
Since it loops on the attribute the second pass always triggered the name_set
check and directly return as an error.

commit a1dd770
Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Date:   Wed Jun 15 20:26:21 2016 -0400

    Make channel read timer interval optional in session.xsd

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
commit c2623b8
Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Date:   Wed Jun 15 20:25:48 2016 -0400

    Make channel output type optional in session.xsd

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/config/session-config.c

index 874a491f3d443fa40867b75f8caa0b81dfb781a6..f250a6743194ace3424000b2007e42be2e748077 100644 (file)
@@ -1803,8 +1803,6 @@ int process_channel_attr_node(xmlNodePtr attr_node, bool snapshot_mode,
                xmlNodePtr *contexts_node, xmlNodePtr *events_node)
 {
        int ret;
-       bool name_set = false;
-       bool output_type_set = false;
 
        assert(attr_node);
        assert(channel);
@@ -1832,7 +1830,6 @@ int process_channel_attr_node(xmlNodePtr attr_node, bool snapshot_mode,
 
                strncpy(channel->name, (const char *) content, name_len);
                free(content);
-               name_set = true;
        } else if (!strcmp((const char *) attr_node->name,
                        config_element_enabled)) {
                xmlChar *content;
@@ -1979,7 +1976,6 @@ int process_channel_attr_node(xmlNodePtr attr_node, bool snapshot_mode,
                }
 
                channel->attr.output = ret;
-               output_type_set = true;
        } else if (!strcmp((const char *) attr_node->name,
                        config_element_tracefile_size)) {
                xmlChar *content;
@@ -2050,18 +2046,6 @@ int process_channel_attr_node(xmlNodePtr attr_node, bool snapshot_mode,
                *contexts_node = attr_node;
        }
 
-       if (!name_set) {
-               ERR("Encountered a channel with no name attribute.");
-               ret = -LTTNG_ERR_LOAD_INVALID_CONFIG;
-               goto end;
-       }
-
-       if (!output_type_set) {
-               /* Set default output type associated with the domain. */
-               channel->attr.output =
-                               (domain == LTTNG_DOMAIN_KERNEL && !snapshot_mode) ?
-                               LTTNG_EVENT_SPLICE : LTTNG_EVENT_MMAP;
-       }
        ret = 0;
 end:
        return ret;
@@ -2376,6 +2360,12 @@ int process_domain_node(xmlNodePtr domain_node, const char *session_name,
                        }
                }
 
+               if (!channel.name) {
+                       ERR("Encountered a channel with no name attribute.");
+                       ret = -LTTNG_ERR_LOAD_INVALID_CONFIG;
+                       goto end;
+               }
+
                ret = lttng_enable_channel(handle, &channel);
                if (ret < 0) {
                        goto end;
This page took 0.028058 seconds and 5 git commands to generate.