X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Ftrigger.c;h=e6849fccfa52789a022de29b4344f2ead73fbffd;hp=5ae84f3d9e8f6ef28cb6323cd8b83c62101291f8;hb=85c06c443aa9b896639681ec6a536e4b80a2bd02;hpb=64eafdf60552bbd7e22fb1c8fc8fc2b42a3cf68b diff --git a/src/common/trigger.c b/src/common/trigger.c index 5ae84f3d9..e6849fccf 100644 --- a/src/common/trigger.c +++ b/src/common/trigger.c @@ -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) {