X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=liblttng-ust%2Fltt-events.c;h=dcc64a55044d6edadc9aacedec273fabe4545e81;hb=2253b139ffb6a4eca7291b60083cc5206a6e128d;hp=c9d35dde199e11929e6307cfe3eb31c1dc272406;hpb=578ce73a104b847b78790041bf30aa9aaa310dd0;p=lttng-ust.git diff --git a/liblttng-ust/ltt-events.c b/liblttng-ust/ltt-events.c index c9d35dde..dcc64a55 100644 --- a/liblttng-ust/ltt-events.c +++ b/liblttng-ust/ltt-events.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -36,6 +35,7 @@ #include #include "error.h" #include "compat.h" +#include "lttng-ust-uuid.h" #include "tracepoint-internal.h" #include "ltt-tracer.h" @@ -277,7 +277,7 @@ int pending_probe_fix_events(const struct lttng_event_desc *desc) remove_pending_probe(e); ret |= __tracepoint_probe_register(name, event->desc->probe_callback, - event); + event, event->desc->signature); if (ret) continue; event->id = chan->free_event_id++; @@ -295,6 +295,7 @@ void synchronize_trace(void) struct ltt_session *ltt_session_create(void) { struct ltt_session *session; + int ret; session = zmalloc(sizeof(struct ltt_session)); if (!session) @@ -302,7 +303,10 @@ struct ltt_session *ltt_session_create(void) CDS_INIT_LIST_HEAD(&session->chan); CDS_INIT_LIST_HEAD(&session->events); CDS_INIT_LIST_HEAD(&session->wildcards); - uuid_generate(session->uuid); + ret = lttng_ust_uuid_generate(session->uuid); + if (ret != 0) { + session->uuid[0] = '\0'; + } cds_list_add(&session->list, &sessions); return session; } @@ -548,7 +552,7 @@ int ltt_event_create(struct ltt_channel *chan, if (event->desc) { ret = __tracepoint_probe_register(event_param->name, event->desc->probe_callback, - event); + event, event->desc->signature); if (ret) goto register_error; event->id = chan->free_event_id++; @@ -1087,7 +1091,8 @@ static int _ltt_session_metadata_statedump(struct ltt_session *session) { unsigned char *uuid_c = session->uuid; - char uuid_s[37], clock_uuid_s[CLOCK_UUID_LEN]; + char uuid_s[LTTNG_UST_UUID_STR_LEN], + clock_uuid_s[LTTNG_UST_UUID_STR_LEN]; struct ltt_channel *chan; struct ltt_event *event; int ret = 0; @@ -1453,3 +1458,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[LTTNG_UST_UUID_STR_LEN]; + + (void) lttng_ust_uuid_generate(uuid); +}