trigger: consider name in trigger _is_equal()`
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Mon, 8 Mar 2021 21:11:37 +0000 (16:11 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 2 Apr 2021 19:38:59 +0000 (15:38 -0400)
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 <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I9549980677e2387a7cc0f275233a3b5717fb915e

src/common/trigger.c

index ad0d5df1ba9c26644f8ee08bb61245c0d244392b..b79b9e0448c6e624e6e819dc3a1b9fe254dc8382 100644 (file)
@@ -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;
        }
This page took 0.032875 seconds and 4 git commands to generate.