From 1ca78886afb53f45d5ee76dfb48f08dd9991e4e2 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Mon, 8 Mar 2021 16:11:37 -0500 Subject: [PATCH] trigger: consider name in trigger _is_equal()` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/common/trigger.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; } -- 2.34.1