trigger: implement is_equal
[lttng-tools.git] / src / common / trigger.c
index 5ae84f3d9e8f6ef28cb6323cd8b83c62101291f8..e6849fccfa52789a022de29b4344f2ead73fbffd 100644 (file)
@@ -263,6 +263,29 @@ end:
        return ret;
 }
 
+LTTNG_HIDDEN
+bool lttng_trigger_is_equal(
+               const struct lttng_trigger *a, const struct lttng_trigger *b)
+{
+       /*
+        * Name is not taken into account since it is cosmetic only.
+        */
+       if (!lttng_condition_is_equal(a->condition, b->condition)) {
+               return false;
+       }
+
+       if (!lttng_action_is_equal(a->action, b->action)) {
+               return false;
+       }
+
+       if (!lttng_credentials_is_equal(lttng_trigger_get_credentials(a),
+                       lttng_trigger_get_credentials(b))) {
+               return false;
+       }
+
+       return true;
+}
+
 LTTNG_HIDDEN
 void lttng_trigger_get(struct lttng_trigger *trigger)
 {
This page took 0.023123 seconds and 4 git commands to generate.