Commit | Line | Data |
---|---|---|
7a3dcaf6 JR |
1 | /* |
2 | * Copyright (C) 2019 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> | |
3 | * | |
4 | * SPDX-License-Identifier: LGPL-2.1-only | |
5 | * | |
6 | */ | |
7 | ||
8 | #ifndef LTTNG_EVENT_RULE_H | |
9 | #define LTTNG_EVENT_RULE_H | |
10 | ||
11 | #ifdef __cplusplus | |
12 | extern "C" { | |
13 | #endif | |
14 | ||
15 | struct lttng_event_rule; | |
16 | ||
17 | enum lttng_event_rule_type { | |
18 | LTTNG_EVENT_RULE_TYPE_UNKNOWN = -1, | |
19 | LTTNG_EVENT_RULE_TYPE_TRACEPOINT = 0, | |
213efb0c | 20 | LTTNG_EVENT_RULE_TYPE_KERNEL_SYSCALL = 1, |
d84633c4 | 21 | LTTNG_EVENT_RULE_TYPE_KERNEL_KPROBE = 2, |
f2d09181 | 22 | LTTNG_EVENT_RULE_TYPE_KERNEL_FUNCTION = 3, |
b25b2570 JR |
23 | LTTNG_EVENT_RULE_TYPE_KERNEL_TRACEPOINT = 4, |
24 | LTTNG_EVENT_RULE_TYPE_KERNEL_UPROBE = 5, | |
7a3dcaf6 JR |
25 | }; |
26 | ||
27 | enum lttng_event_rule_status { | |
28 | LTTNG_EVENT_RULE_STATUS_OK = 0, | |
29 | LTTNG_EVENT_RULE_STATUS_ERROR = -1, | |
30 | LTTNG_EVENT_RULE_STATUS_UNKNOWN = -2, | |
31 | LTTNG_EVENT_RULE_STATUS_INVALID = -3, | |
32 | LTTNG_EVENT_RULE_STATUS_UNSET = -4, | |
33 | LTTNG_EVENT_RULE_STATUS_UNSUPPORTED = -5, | |
34 | }; | |
35 | ||
36 | /** | |
37 | * An event rule describes a set of criteria to be used as a discriminant in | |
38 | * regards to a set of events. | |
39 | */ | |
40 | ||
41 | /* | |
42 | * Get the event rule type. | |
43 | * | |
44 | * Returns the type of an event rule on success, LTTNG_EVENT_RULE_UNKNOWN on | |
45 | * error. | |
46 | */ | |
47 | extern enum lttng_event_rule_type lttng_event_rule_get_type( | |
48 | const struct lttng_event_rule *event_rule); | |
49 | ||
50 | /* | |
51 | * Destroy an event rule object. | |
52 | */ | |
53 | extern void lttng_event_rule_destroy(struct lttng_event_rule *rule); | |
54 | ||
55 | #ifdef __cplusplus | |
56 | } | |
57 | #endif | |
58 | ||
59 | #endif /* LTTNG_EVENT_RULE_H */ |