LTTng control library C API
Loading...
Searching...
No Matches
rate-policy.h
1/*
2 * SPDX-FileCopyrightText: 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_H
9#define LTTNG_RATE_POLICY_H
10
11#include <lttng/lttng-export.h>
12
13#include <inttypes.h>
14#include <sys/types.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
32
40
43
44 /* Unused for the moment */
45 LTTNG_RATE_POLICY_STATUS_ERROR = -1,
46 LTTNG_RATE_POLICY_STATUS_UNKNOWN = -2,
47 LTTNG_RATE_POLICY_STATUS_UNSET = -4,
48 LTTNG_RATE_POLICY_STATUS_UNSUPPORTED = -5,
49 LTTNG_RATE_POLICY_STATUS_PERMISSION_DENIED = -6,
50};
51
69
84LTTNG_EXPORT extern enum lttng_rate_policy_type
86
106LTTNG_EXPORT extern struct lttng_rate_policy *lttng_rate_policy_every_n_create(uint64_t n);
107
131LTTNG_EXPORT extern enum lttng_rate_policy_status
133
153LTTNG_EXPORT extern struct lttng_rate_policy *lttng_rate_policy_once_after_n_create(uint64_t n);
154
178LTTNG_EXPORT extern enum lttng_rate_policy_status
180
192LTTNG_EXPORT extern void lttng_rate_policy_destroy(struct lttng_rate_policy *policy);
193
195
196#ifdef __cplusplus
197}
198#endif
199
200#endif /* LTTNG_rate_policy_H */
enum lttng_rate_policy_status lttng_rate_policy_every_n_get_interval(const struct lttng_rate_policy *policy, uint64_t *n)
Sets *n to&#160;N of the “every&#160;N times” trigger action rate policy policy.
enum lttng_rate_policy_status lttng_rate_policy_once_after_n_get_threshold(const struct lttng_rate_policy *policy, uint64_t *n)
Sets *n to&#160;N of the “once after&#160;N times” trigger action rate policy policy.
struct lttng_rate_policy * lttng_rate_policy_every_n_create(uint64_t n)
Creates an “every&#160;N times” trigger action rate policy, setting&#160;N to n.
enum lttng_rate_policy_type lttng_rate_policy_get_type(const struct lttng_rate_policy *policy)
Returns the type of the trigger action rate policy policy.
lttng_rate_policy_status
Return type of trigger action rate policy API functions.
Definition rate-policy.h:37
void lttng_rate_policy_destroy(struct lttng_rate_policy *policy)
Destroys the trigger action rate policy policy.
struct lttng_rate_policy * lttng_rate_policy_once_after_n_create(uint64_t n)
Creates a “once after&#160;N times” trigger action rate policy, setting&#160;N to n.
lttng_rate_policy_type
Trigger action rate policy type.
Definition rate-policy.h:59
@ LTTNG_RATE_POLICY_STATUS_INVALID
Unsatisfied precondition.
Definition rate-policy.h:42
@ LTTNG_RATE_POLICY_STATUS_OK
Success.
Definition rate-policy.h:39
@ LTTNG_RATE_POLICY_TYPE_UNKNOWN
Unknown (error).
Definition rate-policy.h:67
@ LTTNG_RATE_POLICY_TYPE_EVERY_N
Every&#160;N times.
Definition rate-policy.h:61
@ LTTNG_RATE_POLICY_TYPE_ONCE_AFTER_N
Once after&#160;N times.
Definition rate-policy.h:64
Trigger action rate policy (opaque type).