save/load: add blocking_timeout attribute to channel
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 6 Jul 2017 15:08:43 +0000 (11:08 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 24 Jul 2017 21:56:07 +0000 (17:56 -0400)
Fixes #1119

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/save.c
src/common/config/session-config.c

index b9bcc666d797cf0bb97fc0ec88c5eff2e508a141..3c6b5b8a01931540cbd050a9600f969e0076b471 100644 (file)
@@ -115,6 +115,13 @@ int save_kernel_channel_attributes(struct config_writer *writer,
                if (ret) {
                        goto end;
                }
+
+               ret = config_writer_write_element_signed_int(writer,
+                               config_element_blocking_timeout,
+                               ext->blocking_timeout);
+               if (ret) {
+                       goto end;
+               }
        }
 
 end:
@@ -171,6 +178,13 @@ int save_ust_channel_attributes(struct config_writer *writer,
                goto end;
        }
 
+       ret = config_writer_write_element_signed_int(writer,
+                       config_element_blocking_timeout,
+                       attr->u.s.blocking_timeout);
+       if (ret) {
+               goto end;
+       }
+
        /*
         * Fetch the monitor timer which is located in the parent of
         * lttng_ust_channel_attr
index 389d05427692210e5c483b8c62fb9ae465ee0d83..9f8640359fc14505f7e31b78af52195e878a9434 100644 (file)
@@ -2105,6 +2105,31 @@ int process_channel_attr_node(xmlNodePtr attr_node,
                        ret = -LTTNG_ERR_LOAD_INVALID_CONFIG;
                        goto end;
                }
+       } else if (!strcmp((const char *) attr_node->name,
+                       config_element_blocking_timeout)) {
+               xmlChar *content;
+               int64_t blocking_timeout = 0;
+
+               /* blocking_timeout */
+               content = xmlNodeGetContent(attr_node);
+               if (!content) {
+                       ret = -LTTNG_ERR_NOMEM;
+                       goto end;
+               }
+
+               ret = parse_int(content, &blocking_timeout);
+               free(content);
+               if (ret) {
+                       ret = -LTTNG_ERR_LOAD_INVALID_CONFIG;
+                       goto end;
+               }
+
+               ret = lttng_channel_set_blocking_timeout(channel,
+                       blocking_timeout);
+               if (ret) {
+                       ret = -LTTNG_ERR_LOAD_INVALID_CONFIG;
+                       goto end;
+               }
        } else if (!strcmp((const char *) attr_node->name,
                        config_element_events)) {
                /* events */
This page took 0.027371 seconds and 4 git commands to generate.