-static
-int condition_on_event_update_error_count(struct lttng_trigger *trigger)
-{
- int ret = 0;
- uint64_t error_count = 0;
- struct lttng_condition *condition;
- enum event_notifier_error_accounting_status status;
-
- condition = lttng_trigger_get_condition(trigger);
- assert(lttng_condition_get_type(condition) ==
- LTTNG_CONDITION_TYPE_ON_EVENT);
-
- status = event_notifier_error_accounting_get_count(trigger, &error_count);
- if (status != EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK) {
- uid_t trigger_owner_uid;
- const char *trigger_name;
- const enum lttng_trigger_status trigger_status =
- lttng_trigger_get_owner_uid(
- trigger, &trigger_owner_uid);
-
- assert(trigger_status == LTTNG_TRIGGER_STATUS_OK);
- if (lttng_trigger_get_name(trigger, &trigger_name) != LTTNG_TRIGGER_STATUS_OK) {
- trigger_name = "(unnamed)";
- }
-
- ERR("Failed to get event notifier error count of trigger for update: trigger owner = %d, trigger name = '%s'",
- trigger_owner_uid, trigger_name);
- ret = -1;
- }
-
- lttng_condition_on_event_set_error_count(condition, error_count);
- return ret;
-}
-