liblttng-ctl: use export list to define exported symbols
[lttng-tools.git] / src / common / actions / rate-policy.c
index 8b3065767cd015890c402179db8f04d7a8b63bc5..c47e17018debebb7a27bdb2d4371c40b188c4bbf 100644 (file)
@@ -5,7 +5,6 @@
  *
  */
 
-#include <assert.h>
 #include <common/buffer-view.h>
 #include <common/dynamic-buffer.h>
 #include <common/error.h>
@@ -89,7 +88,6 @@ static bool lttng_rate_policy_every_n_should_execute(
 static bool lttng_rate_policy_once_after_n_should_execute(
                const struct lttng_rate_policy *policy, uint64_t counter);
 
-LTTNG_HIDDEN
 const char *lttng_rate_policy_type_string(
                enum lttng_rate_policy_type rate_policy_type)
 {
@@ -109,7 +107,6 @@ enum lttng_rate_policy_type lttng_rate_policy_get_type(
        return policy ? policy->type : LTTNG_RATE_POLICY_TYPE_UNKNOWN;
 }
 
-LTTNG_HIDDEN
 void lttng_rate_policy_init(struct lttng_rate_policy *rate_policy,
                enum lttng_rate_policy_type type,
                rate_policy_serialize_cb serialize,
@@ -135,7 +132,6 @@ void lttng_rate_policy_destroy(struct lttng_rate_policy *rate_policy)
        rate_policy->destroy(rate_policy);
 }
 
-LTTNG_HIDDEN
 int lttng_rate_policy_serialize(struct lttng_rate_policy *rate_policy,
                struct lttng_payload *payload)
 {
@@ -232,7 +228,6 @@ end:
        return consumed_len;
 }
 
-LTTNG_HIDDEN
 ssize_t lttng_rate_policy_create_from_payload(struct lttng_payload_view *view,
                struct lttng_rate_policy **rate_policy)
 {
@@ -296,7 +291,7 @@ ssize_t lttng_rate_policy_create_from_payload(struct lttng_payload_view *view,
                goto end;
        }
 
-       assert(*rate_policy);
+       LTTNG_ASSERT(*rate_policy);
 
        consumed_len = sizeof(struct lttng_rate_policy_comm) +
                        specific_rate_policy_consumed_len;
@@ -305,7 +300,6 @@ end:
        return consumed_len;
 }
 
-LTTNG_HIDDEN
 bool lttng_rate_policy_is_equal(const struct lttng_rate_policy *a,
                const struct lttng_rate_policy *b)
 {
@@ -324,13 +318,12 @@ bool lttng_rate_policy_is_equal(const struct lttng_rate_policy *a,
                goto end;
        }
 
-       assert(a->equal);
+       LTTNG_ASSERT(a->equal);
        is_equal = a->equal(a, b);
 end:
        return is_equal;
 }
 
-LTTNG_HIDDEN
 bool lttng_rate_policy_should_execute(
                const struct lttng_rate_policy *policy, uint64_t counter)
 {
@@ -351,7 +344,7 @@ bool lttng_rate_policy_should_execute(
 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);
 }
@@ -360,7 +353,7 @@ static const struct lttng_rate_policy_every_n *
 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);
 }
@@ -373,8 +366,8 @@ static int lttng_rate_policy_every_n_serialize(
        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;
@@ -445,9 +438,9 @@ static enum lttng_error_code lttng_rate_policy_every_n_mi_serialize(
        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);
@@ -539,7 +532,7 @@ static bool lttng_rate_policy_every_n_should_execute(
                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);
@@ -563,7 +556,7 @@ static bool lttng_rate_policy_every_n_should_execute(
 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);
@@ -573,7 +566,7 @@ static const struct lttng_rate_policy_once_after_n *
 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);
@@ -586,8 +579,8 @@ static int lttng_rate_policy_once_after_n_serialize(
        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;
@@ -661,9 +654,9 @@ static enum lttng_error_code lttng_rate_policy_once_after_n_mi_serialize(
        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);
@@ -752,11 +745,10 @@ end:
        return status;
 }
 
-LTTNG_HIDDEN
 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);
 }
 
@@ -765,7 +757,7 @@ static bool lttng_rate_policy_once_after_n_should_execute(
 {
        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);
@@ -780,7 +772,6 @@ static bool lttng_rate_policy_once_after_n_should_execute(
        return counter == once_after_n_policy->threshold;
 }
 
-LTTNG_HIDDEN
 enum lttng_error_code lttng_rate_policy_mi_serialize(
                const struct lttng_rate_policy *rate_policy,
                struct mi_writer *writer)
@@ -788,9 +779,9 @@ enum lttng_error_code lttng_rate_policy_mi_serialize(
        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(
This page took 0.02614 seconds and 4 git commands to generate.