[lttng-dev] [PATCH lttng-tools v2 2/2] save/load: add blocking_timeout attribute to channel

Jonathan Rajotte jonathan.rajotte-julien at efficios.com
Thu Jul 6 15:08:43 UTC 2017


Fixes #1119

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
---
 src/bin/lttng-sessiond/save.c      | 14 ++++++++++++++
 src/common/config/session-config.c | 25 +++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c
index 3c34c856..542225e4 100644
--- a/src/bin/lttng-sessiond/save.c
+++ b/src/bin/lttng-sessiond/save.c
@@ -114,6 +114,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:
@@ -170,6 +177,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
diff --git a/src/common/config/session-config.c b/src/common/config/session-config.c
index 6042f1dc..36793a6c 100644
--- a/src/common/config/session-config.c
+++ b/src/common/config/session-config.c
@@ -2112,6 +2112,31 @@ int process_channel_attr_node(xmlNodePtr attr_node,
 			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 */
 		*events_node = attr_node;
-- 
2.11.0



More information about the lttng-dev mailing list