+static const char *get_notification_trigger_name(
+ struct lttng_notification *notification)
+{
+ const char *name = NULL;
+ enum lttng_evaluation_status status;
+ const struct lttng_evaluation *evaluation;
+ evaluation = lttng_notification_get_evaluation(notification);
+ if (evaluation == NULL) {
+ fail("lttng_notification_get_evaluation");
+ goto end;
+ }
+
+ switch (lttng_evaluation_get_type(evaluation)) {
+ case LTTNG_CONDITION_TYPE_EVENT_RULE_HIT:
+ {
+ status = lttng_evaluation_event_rule_get_trigger_name(
+ evaluation, &name);
+ if (status != LTTNG_EVALUATION_STATUS_OK) {
+ fail("lttng_evaluation_event_rule_get_trigger_name");
+ name = NULL;
+ goto end;
+ }
+ break;
+ }
+ default:
+ fail("Wrong notification evaluation type \n");
+ goto end;
+ }
+end:
+ return name;
+}
+
+static int validator_notification_trigger_name(
+ struct lttng_notification *notification,
+ const char *trigger_name)
+{
+ int ret;
+ bool name_is_equal;
+ const char *name;
+
+ assert(notification);
+ assert(trigger_name);
+
+ name = get_notification_trigger_name(notification);
+ if (name == NULL) {
+ ret = 1;
+ goto end;
+ }
+
+ name_is_equal = (strcmp(trigger_name, name) == 0);
+ ok(name_is_equal, "Expected trigger name: %s got %s", trigger_name,
+ name);
+
+ ret = !name_is_equal;
+
+end:
+ return ret;
+}
+