*
*/
-#include <assert.h>
#include <common/buffer-view.h>
#include <common/dynamic-buffer.h>
#include <common/error.h>
goto end;
}
- assert(*rate_policy);
+ LTTNG_ASSERT(*rate_policy);
consumed_len = sizeof(struct lttng_rate_policy_comm) +
specific_rate_policy_consumed_len;
goto end;
}
- assert(a->equal);
+ LTTNG_ASSERT(a->equal);
is_equal = a->equal(a, b);
end:
return is_equal;
static struct lttng_rate_policy_every_n *rate_policy_every_n_from_rate_policy(
struct lttng_rate_policy *policy)
{
- assert(policy);
+ LTTNG_ASSERT(policy);
return container_of(policy, struct lttng_rate_policy_every_n, parent);
}
rate_policy_every_n_from_rate_policy_const(
const struct lttng_rate_policy *policy)
{
- assert(policy);
+ LTTNG_ASSERT(policy);
return container_of(policy, struct lttng_rate_policy_every_n, parent);
}
struct lttng_rate_policy_every_n *every_n_policy;
struct lttng_rate_policy_every_n_comm comm = {};
- assert(policy);
- assert(payload);
+ LTTNG_ASSERT(policy);
+ LTTNG_ASSERT(payload);
every_n_policy = rate_policy_every_n_from_rate_policy(policy);
comm.interval = every_n_policy->interval;
enum lttng_error_code ret_code;
const struct lttng_rate_policy_every_n *every_n_policy = NULL;
- assert(rate_policy);
- assert(IS_EVERY_N_RATE_POLICY(rate_policy));
- assert(writer);
+ LTTNG_ASSERT(rate_policy);
+ LTTNG_ASSERT(IS_EVERY_N_RATE_POLICY(rate_policy));
+ LTTNG_ASSERT(writer);
every_n_policy = rate_policy_every_n_from_rate_policy_const(
rate_policy);
const struct lttng_rate_policy *policy, uint64_t counter)
{
const struct lttng_rate_policy_every_n *every_n_policy;
- assert(policy);
+ LTTNG_ASSERT(policy);
bool execute = false;
every_n_policy = rate_policy_every_n_from_rate_policy_const(policy);
static struct lttng_rate_policy_once_after_n *
rate_policy_once_after_n_from_rate_policy(struct lttng_rate_policy *policy)
{
- assert(policy);
+ LTTNG_ASSERT(policy);
return container_of(
policy, struct lttng_rate_policy_once_after_n, parent);
rate_policy_once_after_n_from_rate_policy_const(
const struct lttng_rate_policy *policy)
{
- assert(policy);
+ LTTNG_ASSERT(policy);
return container_of(
policy, struct lttng_rate_policy_once_after_n, parent);
struct lttng_rate_policy_once_after_n *once_after_n_policy;
struct lttng_rate_policy_once_after_n_comm comm = {};
- assert(policy);
- assert(payload);
+ LTTNG_ASSERT(policy);
+ LTTNG_ASSERT(payload);
once_after_n_policy = rate_policy_once_after_n_from_rate_policy(policy);
comm.threshold = once_after_n_policy->threshold;
enum lttng_error_code ret_code;
const struct lttng_rate_policy_once_after_n *once_after_n_policy = NULL;
- assert(rate_policy);
- assert(IS_ONCE_AFTER_N_RATE_POLICY(rate_policy));
- assert(writer);
+ LTTNG_ASSERT(rate_policy);
+ LTTNG_ASSERT(IS_ONCE_AFTER_N_RATE_POLICY(rate_policy));
+ LTTNG_ASSERT(writer);
once_after_n_policy = rate_policy_once_after_n_from_rate_policy_const(
rate_policy);
struct lttng_rate_policy *lttng_rate_policy_copy(
const struct lttng_rate_policy *source)
{
- assert(source->copy);
+ LTTNG_ASSERT(source->copy);
return source->copy(source);
}
{
const struct lttng_rate_policy_once_after_n *once_after_n_policy;
bool execute = false;
- assert(policy);
+ LTTNG_ASSERT(policy);
once_after_n_policy =
rate_policy_once_after_n_from_rate_policy_const(policy);
int ret;
enum lttng_error_code ret_code;
- assert(rate_policy);
- assert(writer);
- assert(rate_policy->mi_serialize);
+ LTTNG_ASSERT(rate_policy);
+ LTTNG_ASSERT(writer);
+ LTTNG_ASSERT(rate_policy->mi_serialize);
/* Open rate policy element. */
ret = mi_lttng_writer_open_element(