/*
- * Copyright (C) 2017 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License, version 2.1 only,
- * as published by the Free Software Foundation.
+ * SPDX-License-Identifier: LGPL-2.1-only
*
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <lttng/condition/condition-internal.h>
ERR("Invalid buffer condition: a threshold must be set.");
goto end;
}
+ if (!usage->domain.set) {
+ ERR("Invalid buffer usage condition: a domain must be set.");
+ goto end;
+ }
valid = true;
end:
}
}
- if ((a->session_name && !b->session_name) ||
- (!a->session_name && b->session_name)) {
+ /* Condition is not valid if this is not true. */
+ assert(a->session_name);
+ assert(b->session_name);
+ if (strcmp(a->session_name, b->session_name)) {
goto end;
}
- if (a->channel_name && b->channel_name) {
- if (strcmp(a->channel_name, b->channel_name)) {
- goto end;
- }
- } if ((a->channel_name && !b->channel_name) ||
- (!a->channel_name && b->channel_name)) {
+ assert(a->channel_name);
+ assert(b->channel_name);
+ if (strcmp(a->channel_name, b->channel_name)) {
goto end;
}
- if (a->channel_name && b->channel_name) {
- if (strcmp(a->channel_name, b->channel_name)) {
- goto end;
- }
- }
-
- if ((a->domain.set && !b->domain.set) ||
- (!a->domain.set && b->domain.set)) {
+ assert(a->domain.set);
+ assert(b->domain.set);
+ if (a->domain.type != b->domain.type) {
goto end;
}
-
- if (a->domain.set && b->domain.set) {
- if (a->domain.type != b->domain.type) {
- goto end;
- }
- }
is_equal = true;
end:
return is_equal;
static
int lttng_evaluation_buffer_usage_serialize(
- struct lttng_evaluation *evaluation,
+ const struct lttng_evaluation *evaluation,
struct lttng_dynamic_buffer *buf)
{
struct lttng_evaluation_buffer_usage *usage;