Commit | Line | Data |
---|---|---|
7f4d5b07 JR |
1 | /* |
2 | * Copyright (C) 2021 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> | |
3 | * | |
4 | * SPDX-License-Identifier: LGPL-2.1-only | |
5 | * | |
6 | */ | |
7 | ||
8 | #ifndef LTTNG_RATE_POLICY_INTERNAL_H | |
9 | #define LTTNG_RATE_POLICY_INTERNAL_H | |
10 | ||
c9e313bc SM |
11 | #include <common/macros.hpp> |
12 | #include <common/payload-view.hpp> | |
28f23191 | 13 | |
7f4d5b07 | 14 | #include <lttng/action/rate-policy.h> |
740da7d5 | 15 | #include <lttng/lttng-error.h> |
7f4d5b07 | 16 | |
28f23191 | 17 | #include <stdbool.h> |
488dbb60 | 18 | |
6a751b95 JR |
19 | struct mi_writer; |
20 | ||
28f23191 | 21 | int lttng_rate_policy_serialize(struct lttng_rate_policy *rate_policy, struct lttng_payload *buf); |
7f4d5b07 | 22 | |
7f4d5b07 | 23 | ssize_t lttng_rate_policy_create_from_payload(struct lttng_payload_view *view, |
28f23191 | 24 | struct lttng_rate_policy **rate_policy); |
7f4d5b07 | 25 | |
7f4d5b07 | 26 | bool lttng_rate_policy_is_equal(const struct lttng_rate_policy *a, |
28f23191 | 27 | const struct lttng_rate_policy *b); |
7f4d5b07 | 28 | |
28f23191 | 29 | const char *lttng_rate_policy_type_string(enum lttng_rate_policy_type rate_policy_type); |
7f4d5b07 | 30 | |
28f23191 | 31 | struct lttng_rate_policy *lttng_rate_policy_copy(const struct lttng_rate_policy *source); |
7f4d5b07 | 32 | |
28f23191 | 33 | bool lttng_rate_policy_should_execute(const struct lttng_rate_policy *policy, uint64_t counter); |
7f4d5b07 | 34 | |
28f23191 JG |
35 | enum lttng_error_code lttng_rate_policy_mi_serialize(const struct lttng_rate_policy *policy, |
36 | struct mi_writer *writer); | |
6a751b95 | 37 | |
7f4d5b07 | 38 | #endif /* LTTNG_RATE_POLICY */ |