From f046a95d1c0f66297332962fb5fd1b715367b69d Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 12 Sep 2014 14:39:50 -0400 Subject: [PATCH] Allow events with same name to be enabled for each channel Before, we refused to enable an event with the same name in two different channels at the same time within a session. Signed-off-by: Mathieu Desnoyers --- lttng-events.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lttng-events.c b/lttng-events.c index b2d0d754..135c8c52 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -379,8 +379,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); -- 2.34.1