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;
}
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,
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;
}
ust_event->enabled = agent_event->enabled;
ust_event->attr.instrumentation = LTTNG_UST_TRACEPOINT;
- strncpy(ust_event->attr.name, agent_event->name, LTTNG_SYMBOL_NAME_LEN);
+ if (lttng_strncpy(ust_event->attr.name, agent_event->name,
+ LTTNG_SYMBOL_NAME_LEN)) {
+ ret = -1;
+ goto end;
+ }
switch (agent_event->loglevel_type) {
case LTTNG_EVENT_LOGLEVEL_ALL:
ust_loglevel_type = LTTNG_UST_LOGLEVEL_ALL;
}
}
+ if (file_opened) {
+ ret = close(fd);
+ if (ret) {
+ PERROR("Closing XML session configuration");
+ }
+ }
+
return ret;
}