X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng-events.c;h=2820a0e4d1f9045017dd772d08b7f9325be85cc9;hb=73c9645a8e4ac6aa02d297b98f1b40b3aeba1269;hp=1fecff8efc279a76de3c8344f23236d485f7e5b8;hpb=de23d59d5992b7354b57a533b4d582809ef8d43c;p=lttng-modules.git diff --git a/lttng-events.c b/lttng-events.c index 1fecff8e..2820a0e4 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -20,6 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +/* + * This page_alloc.h wrapper needs to be included before gfpflags.h because it + * overrides a function with a define. + */ +#include "wrapper/page_alloc.h" + #include #include #include @@ -98,6 +104,8 @@ struct lttng_session *lttng_session_create(void) kref_init(&metadata_cache->refcount); session->metadata_cache = metadata_cache; INIT_LIST_HEAD(&metadata_cache->metadata_stream); + memcpy(&metadata_cache->uuid, &session->uuid, + sizeof(metadata_cache->uuid)); list_add(&session->list, &sessions); mutex_unlock(&sessions_mutex); return session; @@ -377,8 +385,14 @@ struct lttng_event *lttng_event_create(struct lttng_channel *chan, */ list_for_each_entry(event, &chan->session->events, list) { if (!strcmp(event->desc->name, event_param->name)) { - ret = -EEXIST; - goto exist; + /* + * Allow events with the same name to appear in + * different channels. + */ + if (event->chan == chan) { + ret = -EEXIST; + goto exist; + } } } event = kmem_cache_zalloc(event_cache, GFP_KERNEL); @@ -1263,7 +1277,9 @@ static int __init lttng_events_init(void) ret = wrapper_lttng_fixup_sig(THIS_MODULE); if (ret) return ret; - + ret = wrapper_get_pfnblock_flags_mask_init(); + if (ret) + return ret; ret = lttng_tracepoint_init(); if (ret) return ret;