X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=liblttng-ust%2Fltt-events.c;h=72e315ec8593bb229f83788a681f84aae3e36147;hb=4158a15a59fc6efbbbc99d66107fb4e1f27f9664;hp=fb3d721e4cbcb43151f309419baf2e69ff52bc22;hpb=48621a4272bdeb1e8fced511ca6bf3c4c2240c15;p=lttng-ust.git diff --git a/liblttng-ust/ltt-events.c b/liblttng-ust/ltt-events.c index fb3d721e..72e315ec 100644 --- a/liblttng-ust/ltt-events.c +++ b/liblttng-ust/ltt-events.c @@ -10,6 +10,7 @@ #define _GNU_SOURCE #include +#include #include #include #include @@ -21,7 +22,7 @@ #include #include #include -#include +#include #include "clock.h" #include @@ -35,7 +36,6 @@ #include #include #include "error.h" -#include "compat.h" #include "tracepoint-internal.h" #include "ltt-tracer.h" @@ -44,6 +44,8 @@ #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 @@ -491,7 +493,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; } @@ -1091,7 +1093,7 @@ int _ltt_session_metadata_statedump(struct ltt_session *session) struct ltt_channel *chan; struct ltt_event *event; int ret = 0; - char procname[LTTNG_UST_PROCNAME_LEN] = ""; + char procname[PROCNAME_LEN] = ""; if (!CMM_ACCESS_ONCE(session->active)) return 0; @@ -1145,8 +1147,8 @@ int _ltt_session_metadata_statedump(struct ltt_session *session) goto end; /* ignore error, just use empty string if error. */ - lttng_ust_getprocname(procname); - procname[LTTNG_UST_PROCNAME_LEN - 1] = '\0'; + (void) prctl(PR_GET_NAME, (unsigned long) procname, 0, 0, 0); + procname[PROCNAME_LEN - 1] = '\0'; ret = lttng_metadata_printf(session, "env {\n" " vpid = %d;\n" @@ -1453,3 +1455,16 @@ int ltt_wildcard_disable(struct session_wildcard *wildcard) wildcard->enabled = 0; return 0; } + +/* + * Take the TLS "fault" in libuuid if dlopen'd, which can take the + * dynamic linker mutex, outside of the UST lock, since the UST lock is + * taken in constructors, which are called with dynamic linker mutex + * held. + */ +void lttng_fixup_event_tls(void) +{ + unsigned char uuid[37]; + + (void) uuid_generate(uuid); +}