#include <lttng/action/action-internal.h>
#include <lttng/action/notify-internal.h>
+#include <common/error.h>
#include <assert.h>
enum lttng_action_type lttng_action_get_type(struct lttng_action *action)
goto end;
}
+ DBG("Deserializing action from buffer");
switch (action_comm->action_type) {
case LTTNG_ACTION_TYPE_NOTIFY:
action = lttng_action_notify_create();
#include <lttng/condition/condition-internal.h>
#include <lttng/condition/buffer-usage-internal.h>
#include <common/macros.h>
+#include <common/error.h>
#include <assert.h>
static
usage = container_of(condition, struct lttng_condition_buffer_usage,
parent);
if (!usage->session_name) {
+ ERR("Invalid buffer condition: a target session name must be set.");
goto end;
}
if (!usage->channel_name) {
+ ERR("Invalid buffer condition: a target channel name must be set.");
goto end;
}
if (!usage->threshold_percent.set && !usage->threshold_bytes.set) {
+ ERR("Invalid buffer condition: a threshold must be set.");
goto end;
}
goto end;
}
+ DBG("Serializing buffer usage condition");
usage = container_of(condition, struct lttng_condition_buffer_usage,
parent);
size = sizeof(struct lttng_condition_buffer_usage_comm);
condition, condition_comm->threshold.percent);
}
if (status != LTTNG_CONDITION_STATUS_OK) {
+ ERR("Failed to initialize buffer usage condition threshold");
ret = -1;
goto end;
}
if (condition_comm->domain_type <= LTTNG_DOMAIN_NONE ||
condition_comm->domain_type > LTTNG_DOMAIN_PYTHON) {
/* Invalid domain value. */
+ ERR("Invalid domain type value (%i) found in condition buffer",
+ (int) condition_comm->domain_type);
ret = -1;
goto end;
}
status = lttng_condition_buffer_usage_set_domain_type(condition,
domain_type);
if (status != LTTNG_CONDITION_STATUS_OK) {
+ ERR("Failed to set buffer usage condition domain");
ret = -1;
goto end;
}
status = lttng_condition_buffer_usage_set_session_name(condition,
session_name);
if (status != LTTNG_CONDITION_STATUS_OK) {
+ ERR("Failed to set buffer usage session name");
ret = -1;
goto end;
}
status = lttng_condition_buffer_usage_set_channel_name(condition,
channel_name);
if (status != LTTNG_CONDITION_STATUS_OK) {
+ ERR("Failed to set buffer usage channel name");
ret = -1;
goto end;
}
goto error;
}
+ DBG("Initializing low buffer usage condition from buffer");
ret = init_from_buffer(condition, buf);
if (ret < 0) {
goto error;
goto error;
}
+ DBG("Initializing high buffer usage condition from buffer");
ret = init_from_buffer(condition, buf);
if (ret < 0) {
goto error;
#include <lttng/condition/condition-internal.h>
#include <lttng/condition/buffer-usage-internal.h>
#include <common/macros.h>
+#include <common/error.h>
#include <stdbool.h>
#include <assert.h>
goto end;
}
+ DBG("Deserializing condition from buffer");
condition_size += sizeof(*condition_comm);
buf += condition_size;
condition_size += ret;
break;
default:
+ ERR("Attempted to create condition of unknown type (%i)",
+ (int) condition_comm->condition_type);
ret = -1;
goto end;
}