From: Francis Deslauriers Date: Mon, 8 Mar 2021 21:11:37 +0000 (-0500) Subject: trigger: consider name in trigger _is_equal()` X-Git-Tag: v2.13.0-rc1~169 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1ca78886afb53f45d5ee76dfb48f08dd9991e4e2;p=lttng-tools.git trigger: consider name in trigger _is_equal()` For the moment, this is a breaking change since, before 2.13, users could not register two identical triggers. Triggers were previously unnamed, but a name is now generated automatically. This means that a pre-2.13 user that could expect a TRIGGER_ALREADY_EXISTS reply when registering a trigger that already existed will now get "OK". However, since it doesn't know about trigger names, it could now fail to unregister a trigger (if the instance used to register the trigger was not kept around). Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau Change-Id: I9549980677e2387a7cc0f275233a3b5717fb915e --- diff --git a/src/common/trigger.c b/src/common/trigger.c index ad0d5df1b..b79b9e044 100644 --- a/src/common/trigger.c +++ b/src/common/trigger.c @@ -393,9 +393,10 @@ bool lttng_trigger_is_equal( return false; } - /* - * Name is not taken into account since it is cosmetic only. - */ + if (strcmp(a->name, b->name) != 0) { + return false; + } + if (!lttng_condition_is_equal(a->condition, b->condition)) { return false; }