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