The session daemon correctly expects that a recording event-rule that
specifies a filter must have both a bytecode and an expression (or
neither of them).
However, it shouldn't assert as those elements are user-specified. The
handling is changed to return an "invalid parameter" error to the
client.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I3df6ce79bc6ce1fa9dadb184a7fd2b528dc2a597
LTTNG_ASSERT(event);
LTTNG_ASSERT(channel_name);
- /* If we have a filter, we must have its filter expression */
- LTTNG_ASSERT(!(!!filter_expression ^ !!filter));
-
/* Normalize event name as a globbing pattern */
strutils_normalize_star_glob_pattern(event->name);
const lttng::urcu::read_lock_guard read_lock;
+ /* If we have a filter, we must have its filter expression. */
+ if (!!filter_expression ^ !!filter) {
+ DBG("Refusing to enable recording event rule as it has an inconsistent filter expression and bytecode specification");
+ ret = LTTNG_ERR_INVALID;
+ goto error;
+ }
+
switch (domain->type) {
case LTTNG_DOMAIN_KERNEL:
{