X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-context-provider.c;h=fe831366779a0332531fcfad63769742481549a0;hb=3046e0bf3ba02bb4d29db5410bfcb6d6aca9ae6f;hp=c580891a1ac93471f544fce2ddb66c31ffa622b2;hpb=3fbec7dc3645facd9e809cf161ba3435a377ce56;p=lttng-ust.git diff --git a/liblttng-ust/lttng-context-provider.c b/liblttng-ust/lttng-context-provider.c index c580891a..fe831366 100644 --- a/liblttng-ust/lttng-context-provider.c +++ b/liblttng-ust/lttng-context-provider.c @@ -21,11 +21,16 @@ */ #define _LGPL_SOURCE +#include +#include #include #include + #include + #include "lttng-tracer-core.h" #include "jhash.h" +#include "context-provider-internal.h" #include #define CONTEXT_PROVIDER_HT_BITS 12 @@ -68,10 +73,12 @@ int lttng_ust_context_provider_register(struct lttng_ust_context_provider *provi uint32_t hash; int ret = 0; + lttng_ust_fixup_tls(); + /* Provider name starts with "$app.". */ - if (strncmp("$app.", provider->name, strlen("$app.") != 0)) + if (strncmp("$app.", provider->name, strlen("$app.")) != 0) return -EINVAL; - /* Provider name cannot contain a column character. */ + /* Provider name cannot contain a colon character. */ if (strchr(provider->name, ':')) return -EINVAL; if (ust_lock()) { @@ -85,9 +92,14 @@ int lttng_ust_context_provider_register(struct lttng_ust_context_provider *provi hash = jhash(provider->name, name_len, 0); head = &context_provider_ht.table[hash & (CONTEXT_PROVIDER_HT_SIZE - 1)]; cds_hlist_add_head(&provider->node, head); + lttng_ust_context_set_session_provider(provider->name, provider->get_size, provider->record, provider->get_value); + + lttng_ust_context_set_event_notifier_group_provider(provider->name, + provider->get_size, provider->record, + provider->get_value); end: ust_unlock(); return ret; @@ -95,11 +107,18 @@ end: void lttng_ust_context_provider_unregister(struct lttng_ust_context_provider *provider) { + lttng_ust_fixup_tls(); + if (ust_lock()) goto end; lttng_ust_context_set_session_provider(provider->name, lttng_ust_dummy_get_size, lttng_ust_dummy_record, lttng_ust_dummy_get_value); + + lttng_ust_context_set_event_notifier_group_provider(provider->name, + lttng_ust_dummy_get_size, lttng_ust_dummy_record, + lttng_ust_dummy_get_value); + cds_hlist_del(&provider->node); end: ust_unlock();