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