Commit | Line | Data |
---|---|---|
077192fd 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 | ||
f2791161 JR |
8 | #ifndef LTTNG_EVENT_RULE_KERNEL_PROBE_H |
9 | #define LTTNG_EVENT_RULE_KERNEL_PROBE_H | |
077192fd JR |
10 | |
11 | #include <lttng/event-rule/event-rule.h> | |
12 | ||
13 | #ifdef __cplusplus | |
14 | extern "C" { | |
15 | #endif | |
16 | ||
17 | struct lttng_kernel_probe_location; | |
18 | ||
19 | /* | |
f2791161 | 20 | * Create a newly allocated kernel probe event rule. |
077192fd JR |
21 | * |
22 | * Returns a new event rule on success, NULL on failure. The returned event rule | |
23 | * must be destroyed using lttng_event_rule_destroy(). | |
24 | */ | |
f2791161 | 25 | extern struct lttng_event_rule *lttng_event_rule_kernel_probe_create(void); |
077192fd JR |
26 | |
27 | /* | |
f2791161 | 28 | * Set the kernel probe location of a kernel probe event rule. |
077192fd JR |
29 | * |
30 | * The location is copied internally. | |
31 | * | |
32 | * Returns LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID | |
33 | * if invalid parameters are passed. | |
34 | */ | |
f2791161 | 35 | extern enum lttng_event_rule_status lttng_event_rule_kernel_probe_set_location( |
077192fd JR |
36 | struct lttng_event_rule *rule, |
37 | const struct lttng_kernel_probe_location *location); | |
38 | ||
39 | /* | |
f2791161 | 40 | * Get the kernel probe location of a kernel probe event rule. |
077192fd JR |
41 | * |
42 | * The caller does not assume the ownership of the returned location. | |
43 | * The location shall only be used for the duration of the event | |
44 | * rule's lifetime, or before a different location is set. | |
45 | * | |
46 | * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's location | |
47 | * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is | |
48 | * passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a location was not set prior to | |
49 | * this call. | |
50 | */ | |
f2791161 | 51 | extern enum lttng_event_rule_status lttng_event_rule_kernel_probe_get_location( |
077192fd JR |
52 | const struct lttng_event_rule *rule, |
53 | const struct lttng_kernel_probe_location **location); | |
54 | ||
55 | /* | |
f2791161 | 56 | * Set the name of a kernel probe event rule. |
077192fd JR |
57 | * |
58 | * The name is copied internally. | |
59 | * | |
60 | * Returns LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID | |
61 | * if invalid parameters are passed. | |
62 | */ | |
f2791161 | 63 | extern enum lttng_event_rule_status lttng_event_rule_kernel_probe_set_name( |
077192fd JR |
64 | struct lttng_event_rule *rule, const char *name); |
65 | ||
66 | /* | |
f2791161 | 67 | * Get the name of a kernel probe event rule. |
077192fd JR |
68 | * |
69 | * The caller does not assume the ownership of the returned name. | |
70 | * The name shall only only be used for the duration of the event | |
71 | * rule's lifetime, or before a different name is set. | |
72 | * | |
73 | * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's name on | |
74 | * success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is passed, | |
75 | * or LTTNG_EVENT_RULE_STATUS_UNSET if a name was not set prior to this call. | |
76 | */ | |
f2791161 | 77 | extern enum lttng_event_rule_status lttng_event_rule_kernel_probe_get_name( |
077192fd JR |
78 | const struct lttng_event_rule *rule, const char **name); |
79 | ||
80 | #ifdef __cplusplus | |
81 | } | |
82 | #endif | |
83 | ||
f2791161 | 84 | #endif /* LTTNG_EVENT_RULE_KERNEL_PROBE_H */ |