X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fsave.c;h=1a879b21429892e1f1af1465af9c790b5f7270b5;hb=e99f9447b5be2deee54dde16b404a12b3fcd88ee;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..1a879b214 100644 --- a/src/bin/lttng-sessiond/save.c +++ b/src/bin/lttng-sessiond/save.c @@ -232,6 +232,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 +708,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 +2053,13 @@ end: } } + if (file_opened) { + ret = close(fd); + if (ret) { + PERROR("Closing XML session configuration"); + } + } + return ret; }