X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-events.c;h=2820a0e4d1f9045017dd772d08b7f9325be85cc9;hb=3579179e8028a10a3298c7b712a9fc6f8c0d721a;hp=b2d0d754907d863903566921d0ac3521619978df;hpb=a36580d58f21f305c1f2465acba726c1e9b82ae8;p=lttng-modules.git diff --git a/lttng-events.c b/lttng-events.c index b2d0d754..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 @@ -379,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); @@ -1265,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;