Observed issue
==============
The lttng-sessiond process aborts when an lttng error query is performed
against a trigger that uses a condition other than "event-match".
Cause
=====
The trigger's condition is a LTTNG_CONDITION_TYPE_SESSION_CONSUMED_SIZE
which does not have a "domain type".
This results in the call to `abort()` in
`event_notifier_error_accounting_get_count` of the default case.
Solution
========
Check if the trigger "needs" or at least "depends" on tracer notifier.
Known drawbacks
=========
None
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I3d5f09617f95315060a611b464d1df95cb80c5bd
return event_notifier_error_accounting_ust_get_count(trigger,
count);
#else
+ *count = 0;
return EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK;
#endif /* HAVE_LIBLTTNG_UST_CTL */
default:
&trigger_owner);
assert(status == LTTNG_TRIGGER_STATUS_OK);
+ /* Only add discarded tracer messages count for applicable triggers. */
+ if (!lttng_trigger_needs_tracer_notifier(trigger)) {
+ status = LTTNG_TRIGGER_STATUS_OK;
+ goto end;
+ }
+
error_accounting_status = event_notifier_error_accounting_get_count(
trigger, &discarded_tracer_messages_count);
if (error_accounting_status != EVENT_NOTIFIER_ERROR_ACCOUNTING_STATUS_OK) {