X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=liblttng-ust%2Fltt-events.c;h=c9d35dde199e11929e6307cfe3eb31c1dc272406;hb=578ce73a104b847b78790041bf30aa9aaa310dd0;hp=c4b67c6be04d8274048fa1c77a85e67e51eaf02d;hpb=8155c5e81ae9d83764056746aee85b3a17d7db38;p=lttng-ust.git diff --git a/liblttng-ust/ltt-events.c b/liblttng-ust/ltt-events.c index c4b67c6b..c9d35dde 100644 --- a/liblttng-ust/ltt-events.c +++ b/liblttng-ust/ltt-events.c @@ -10,7 +10,6 @@ #define _GNU_SOURCE #include -#include #include #include #include @@ -22,7 +21,7 @@ #include #include #include -#include +#include #include "clock.h" #include @@ -36,6 +35,7 @@ #include #include #include "error.h" +#include "compat.h" #include "tracepoint-internal.h" #include "ltt-tracer.h" @@ -44,8 +44,6 @@ #include "../libringbuffer/shm.h" #include "jhash.h" -#define PROCNAME_LEN 17 - /* * The sessions mutex is the centralized mutex across UST tracing * control and probe registration. All operations within this file are @@ -493,7 +491,7 @@ int ltt_event_create(struct ltt_channel *chan, struct ltt_event *event; int ret = 0; - if (chan->used_event_id == -1UL) { + if (chan->used_event_id == -1U) { ret = -ENOMEM; goto full; } @@ -1093,7 +1091,7 @@ int _ltt_session_metadata_statedump(struct ltt_session *session) struct ltt_channel *chan; struct ltt_event *event; int ret = 0; - char procname[PROCNAME_LEN] = ""; + char procname[LTTNG_UST_PROCNAME_LEN] = ""; if (!CMM_ACCESS_ONCE(session->active)) return 0; @@ -1134,8 +1132,8 @@ int _ltt_session_metadata_statedump(struct ltt_session *session) lttng_alignof(uint16_t) * CHAR_BIT, lttng_alignof(uint32_t) * CHAR_BIT, lttng_alignof(uint64_t) * CHAR_BIT, - CTF_VERSION_MAJOR, - CTF_VERSION_MINOR, + CTF_SPEC_MAJOR, + CTF_SPEC_MINOR, uuid_s, #if (BYTE_ORDER == BIG_ENDIAN) "be" @@ -1147,17 +1145,23 @@ int _ltt_session_metadata_statedump(struct ltt_session *session) goto end; /* ignore error, just use empty string if error. */ - (void) prctl(PR_GET_NAME, (unsigned long) procname, 0, 0, 0); - procname[PROCNAME_LEN - 1] = '\0'; + lttng_ust_getprocname(procname); + procname[LTTNG_UST_PROCNAME_LEN - 1] = '\0'; ret = lttng_metadata_printf(session, "env {\n" " vpid = %d;\n" " procname = \"%s\";\n" - " domain = %s;\n" + " domain = \"ust\";\n" + " tracer_name = \"lttng-ust\";\n" + " tracer_major = %u;\n" + " tracer_minor = %u;\n" + " tracer_patchlevel = %u;\n" "};\n\n", (int) getpid(), procname, - "ust" + LTTNG_UST_MAJOR_VERSION, + LTTNG_UST_MINOR_VERSION, + LTTNG_UST_PATCHLEVEL_VERSION ); if (ret) goto end;