+
+static bool lttng_firing_policy_once_after_n_should_execute(
+ const struct lttng_firing_policy *policy, uint64_t counter)
+{
+ const struct lttng_firing_policy_once_after_n *once_after_n_policy;
+ bool execute = false;
+ assert(policy);
+
+ once_after_n_policy =
+ firing_policy_once_after_n_from_firing_policy_const(
+ policy);
+
+ execute = counter == once_after_n_policy->threshold;
+
+ DBG("Policy once after N = %" PRIu64
+ ": execution %s. Execution count: %" PRIu64,
+ once_after_n_policy->threshold,
+ execute ? "accepted" : "denied", counter);
+
+ return counter == once_after_n_policy->threshold;
+}