X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fsave.c;h=3c6b5b8a01931540cbd050a9600f969e0076b471;hp=9ac7712cb114968fdb8c3c4605a4f2f10419037b;hb=e6142f2e647e83238b1e399b1264e8adb05409f9;hpb=d333bdaaa9d3c61cf67bbc4582c216c4af3b69b4 diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c index 9ac7712cb..3c6b5b8a0 100644 --- a/src/bin/lttng-sessiond/save.c +++ b/src/bin/lttng-sessiond/save.c @@ -104,6 +104,26 @@ int save_kernel_channel_attributes(struct config_writer *writer, if (ret) { goto end; } + + if (attr->extended.ptr) { + struct lttng_channel_extended *ext = NULL; + + ext = (struct lttng_channel_extended *) attr->extended.ptr; + ret = config_writer_write_element_unsigned_int(writer, + config_element_monitor_timer_interval, + ext->monitor_timer_interval); + if (ret) { + goto end; + } + + ret = config_writer_write_element_signed_int(writer, + config_element_blocking_timeout, + ext->blocking_timeout); + if (ret) { + goto end; + } + } + end: return ret ? LTTNG_ERR_SAVE_IO_FAIL : 0; } @@ -113,6 +133,7 @@ int save_ust_channel_attributes(struct config_writer *writer, struct lttng_ust_channel_attr *attr) { int ret; + struct ltt_ust_channel *channel = NULL; ret = config_writer_write_element_string(writer, config_element_overwrite_mode, @@ -156,6 +177,26 @@ int save_ust_channel_attributes(struct config_writer *writer, if (ret) { 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 + */ + channel = caa_container_of(attr, struct ltt_ust_channel, attr); + ret = config_writer_write_element_unsigned_int(writer, + config_element_monitor_timer_interval, + channel->monitor_timer_interval); + if (ret) { + goto end; + } + end: return ret ? LTTNG_ERR_SAVE_IO_FAIL : 0; } @@ -2053,6 +2094,13 @@ end: } } + if (file_opened) { + ret = close(fd); + if (ret) { + PERROR("Closing XML session configuration"); + } + } + return ret; }