2 * Copyright (C) 2021 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_RATE_POLICY_INTERNAL_H
9 #define LTTNG_RATE_POLICY_INTERNAL_H
11 #include <common/macros.h>
12 #include <common/payload-view.h>
13 #include <lttng/action/rate-policy.h>
14 #include <lttng/lttng-error.h>
20 int lttng_rate_policy_serialize(struct lttng_rate_policy
*rate_policy
,
21 struct lttng_payload
*buf
);
23 ssize_t
lttng_rate_policy_create_from_payload(struct lttng_payload_view
*view
,
24 struct lttng_rate_policy
**rate_policy
);
26 bool lttng_rate_policy_is_equal(const struct lttng_rate_policy
*a
,
27 const struct lttng_rate_policy
*b
);
29 const char *lttng_rate_policy_type_string(
30 enum lttng_rate_policy_type rate_policy_type
);
32 struct lttng_rate_policy
*lttng_rate_policy_copy(
33 const struct lttng_rate_policy
*source
);
35 bool lttng_rate_policy_should_execute(
36 const struct lttng_rate_policy
*policy
, uint64_t counter
);
38 enum lttng_error_code
lttng_rate_policy_mi_serialize(
39 const struct lttng_rate_policy
*policy
,
40 struct mi_writer
*writer
);
42 #endif /* LTTNG_RATE_POLICY */