LTTNG_HIDDEN
bool lttng_trigger_validate(struct lttng_trigger *trigger);
+LTTNG_HIDDEN
+bool lttng_trigger_is_equal(
+ const struct lttng_trigger *a, const struct lttng_trigger *b);
+
LTTNG_HIDDEN
void lttng_trigger_get(struct lttng_trigger *trigger);
#include <lttng/condition/session-consumed-size-internal.h>
#include <lttng/condition/session-rotation-internal.h>
#include <lttng/notification/channel-internal.h>
+#include <lttng/trigger/trigger-internal.h>
#include <time.h>
#include <unistd.h>
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)
{