consumed = container_of(condition, struct lttng_condition_session_consumed_size,
parent);
if (!consumed->session_name) {
- ERR("Invalid buffer condition: a target session name must be set.");
+ ERR("Invalid session consumed size condition: a target session name must be set.");
goto end;
}
if (!consumed->consumed_threshold_bytes.set) {
- ERR("Invalid session condition: a threshold must be set.");
+ ERR("Invalid session consumed size condition: a threshold must be set.");
goto end;
}
}
}
- if ((a->session_name && !b->session_name) ||
- (!a->session_name && b->session_name)) {
+ assert(a->session_name);
+ assert(b->session_name);
+ if (strcmp(a->session_name, b->session_name)) {
goto end;
}
status = lttng_condition_session_consumed_size_set_threshold(condition,
condition_comm->consumed_threshold_bytes);
if (status != LTTNG_CONDITION_STATUS_OK) {
- ERR("Failed to initialize session consumed condition threshold");
+ ERR("Failed to initialize session consumed size condition threshold");
ret = -1;
goto end;
}
status = lttng_condition_session_consumed_size_set_session_name(condition,
session_name);
if (status != LTTNG_CONDITION_STATUS_OK) {
- ERR("Failed to set buffer consumed session name");
+ ERR("Failed to set session consumed size condition's session name");
ret = -1;
goto end;
}
static
struct lttng_evaluation *create_evaluation_from_buffer(
- enum lttng_condition_type type,
const struct lttng_buffer_view *view)
{
const struct lttng_evaluation_session_consumed_size_comm *comm =
goto end;
}
- evaluation = lttng_evaluation_session_consumed_size_create(type,
+ evaluation = lttng_evaluation_session_consumed_size_create(
comm->session_consumed);
end:
return evaluation;
goto error;
}
- evaluation = create_evaluation_from_buffer(
- LTTNG_CONDITION_TYPE_SESSION_CONSUMED_SIZE, view);
+ evaluation = create_evaluation_from_buffer(view);
if (!evaluation) {
ret = -1;
goto error;
static
int lttng_evaluation_session_consumed_size_serialize(
- struct lttng_evaluation *evaluation,
+ const struct lttng_evaluation *evaluation,
struct lttng_dynamic_buffer *buf)
{
struct lttng_evaluation_session_consumed_size *consumed;
LTTNG_HIDDEN
struct lttng_evaluation *lttng_evaluation_session_consumed_size_create(
- enum lttng_condition_type type, uint64_t consumed)
+ uint64_t consumed)
{
struct lttng_evaluation_session_consumed_size *consumed_eval;
goto end;
}
- consumed_eval->parent.type = type;
+ consumed_eval->parent.type = LTTNG_CONDITION_TYPE_SESSION_CONSUMED_SIZE;
consumed_eval->session_consumed = consumed;
consumed_eval->parent.serialize = lttng_evaluation_session_consumed_size_serialize;
consumed_eval->parent.destroy = lttng_evaluation_session_consumed_size_destroy;