X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fsave.c;h=b9bcc666d797cf0bb97fc0ec88c5eff2e508a141;hb=4fc2b12601cd1bd62a6bbdb75f08f1d32cdb781f;hp=1a98515fa0c73f0272c82b346aa102ff5f5117f8;hpb=9897fbc95aea23f996b7543d86363a3dd72a0c53;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c index 1a98515fa..b9bcc666d 100644 --- a/src/bin/lttng-sessiond/save.c +++ b/src/bin/lttng-sessiond/save.c @@ -104,6 +104,19 @@ 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; + } + } + end: return ret ? LTTNG_ERR_SAVE_IO_FAIL : 0; } @@ -113,6 +126,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 +170,19 @@ int save_ust_channel_attributes(struct config_writer *writer, 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; } @@ -232,6 +259,18 @@ const char *get_kernel_context_type_string( case LTTNG_KERNEL_CONTEXT_HOSTNAME: context_type_string = config_event_context_hostname; break; + case LTTNG_KERNEL_CONTEXT_INTERRUPTIBLE: + context_type_string = config_event_context_interruptible; + break; + case LTTNG_KERNEL_CONTEXT_PREEMPTIBLE: + context_type_string = config_event_context_preemptible; + break; + case LTTNG_KERNEL_CONTEXT_NEED_RESCHEDULE: + context_type_string = config_event_context_need_reschedule; + break; + case LTTNG_KERNEL_CONTEXT_MIGRATABLE: + context_type_string = config_event_context_migratable; + break; default: context_type_string = NULL; } @@ -696,7 +735,11 @@ int init_ust_event_from_agent_event(struct ltt_ust_event *ust_event, 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; @@ -2037,6 +2080,13 @@ end: } } + if (file_opened) { + ret = close(fd); + if (ret) { + PERROR("Closing XML session configuration"); + } + } + return ret; }