Commit | Line | Data |
---|---|---|
a58c490f | 1 | /* |
ab5be9fa | 2 | * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
a58c490f | 3 | * |
ab5be9fa | 4 | * SPDX-License-Identifier: LGPL-2.1-only |
a58c490f | 5 | * |
a58c490f JG |
6 | */ |
7 | ||
8 | #ifndef LTTNG_CONDITION_H | |
9 | #define LTTNG_CONDITION_H | |
10 | ||
4bd69c5f SM |
11 | #include <lttng/lttng-export.h> |
12 | ||
a58c490f JG |
13 | #ifdef __cplusplus |
14 | extern "C" { | |
15 | #endif | |
16 | ||
17 | struct lttng_condition; | |
18 | ||
19 | enum lttng_condition_type { | |
20 | LTTNG_CONDITION_TYPE_UNKNOWN = -1, | |
e8360425 | 21 | LTTNG_CONDITION_TYPE_SESSION_CONSUMED_SIZE = 100, |
c19092cd JG |
22 | LTTNG_CONDITION_TYPE_BUFFER_USAGE_HIGH = 101, |
23 | LTTNG_CONDITION_TYPE_BUFFER_USAGE_LOW = 102, | |
24 | LTTNG_CONDITION_TYPE_SESSION_ROTATION_ONGOING = 103, | |
25 | LTTNG_CONDITION_TYPE_SESSION_ROTATION_COMPLETED = 104, | |
8dbb86b8 | 26 | LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES = 105, |
a58c490f JG |
27 | }; |
28 | ||
29 | enum lttng_condition_status { | |
30 | LTTNG_CONDITION_STATUS_OK = 0, | |
31 | LTTNG_CONDITION_STATUS_ERROR = -1, | |
32 | LTTNG_CONDITION_STATUS_UNKNOWN = -2, | |
33 | LTTNG_CONDITION_STATUS_INVALID = -3, | |
34 | LTTNG_CONDITION_STATUS_UNSET = -4, | |
81d566c9 | 35 | LTTNG_CONDITION_STATUS_UNSUPPORTED = -5, |
a58c490f JG |
36 | }; |
37 | ||
a6d9b795 JG |
38 | /* |
39 | * Get the type of a condition. | |
40 | * | |
41 | * Returns the type of a condition on success, LTTNG_CONDITION_TYPE_UNKNOWN on | |
42 | * error. | |
43 | */ | |
28f23191 JG |
44 | LTTNG_EXPORT extern enum lttng_condition_type |
45 | lttng_condition_get_type(const struct lttng_condition *condition); | |
a58c490f | 46 | |
a6d9b795 | 47 | /* |
706ef699 | 48 | * Destroy (release) a condition object. |
a6d9b795 | 49 | */ |
4bd69c5f | 50 | LTTNG_EXPORT extern void lttng_condition_destroy(struct lttng_condition *condition); |
a58c490f JG |
51 | |
52 | #ifdef __cplusplus | |
53 | } | |
54 | #endif | |
55 | ||
56 | #endif /* LTTNG_CONDITION_H */ |