+
+ if (policy) {
+ enum lttng_firing_policy_type policy_type;
+ enum lttng_firing_policy_status policy_status;
+ uint64_t policy_value = 0;
+
+ policy_type = lttng_firing_policy_get_type(policy);
+
+ switch (policy_type) {
+ case LTTNG_FIRING_POLICY_TYPE_EVERY_N:
+ policy_status = lttng_firing_policy_every_n_get_interval(
+ policy, &policy_value);
+ if (policy_status != LTTNG_FIRING_POLICY_STATUS_OK) {
+ ERR("Failed to get action firing policy interval");
+ goto end;
+ }
+ if (policy_value > 1) {
+ /* The default is 1 so print only when it is a
+ * special case.
+ */
+ _MSG(", firing policy: after every %" PRIu64
+ " occurrences",
+ policy_value);
+ }
+ break;
+ case LTTNG_FIRING_POLICY_TYPE_ONCE_AFTER_N:
+ policy_status = lttng_firing_policy_once_after_n_get_threshold(
+ policy, &policy_value);
+ if (policy_status != LTTNG_FIRING_POLICY_STATUS_OK) {
+ ERR("Failed to get action firing policy interval");
+ goto end;
+ }
+ _MSG(", firing policy: once after %" PRIu64
+ " occurrences",
+ policy_value);
+ break;
+ default:
+ abort();
+ }
+ }
+
+ MSG("");
+end:
+ return;