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