SoW-2019-0002: Dynamic Snapshot
[lttng-tools.git] / include / lttng / event-rule / uprobe.h
1 /*
2 * Copyright (C) 2019 - Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
3 *
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License, version 2.1 only,
6 * as published by the Free Software Foundation.
7 *
8 * This library is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17
18 #ifndef LTTNG_EVENT_RULE_UPROBE_H
19 #define LTTNG_EVENT_RULE_UPROBE_H
20
21 #include <lttng/event-rule/event-rule.h>
22 #include <lttng/userspace-probe.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /*
29 * TODO:
30 */
31 extern struct lttng_event_rule *lttng_event_rule_uprobe_create(void);
32
33 /*
34 * Set the location of a uprobe event rule.
35 *
36 * The location is copied internally.
37 *
38 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
39 * if invalid parameters are passed.
40 */
41 extern enum lttng_event_rule_status lttng_event_rule_uprobe_set_location(
42 struct lttng_event_rule *rule, const struct lttng_userspace_probe_location *location);
43
44 /*
45 * Get the location of a uprobe event rule.
46 *
47 * The caller does not assume the ownership of the returned location.
48 * The location shall only be used for the duration of the event
49 * rule's lifetime, or before a different location is set.
50 *
51 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's location
52 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is passed,
53 * or LTTNG_EVENT_RULE_STATUS_UNSET if a location was not set prior to this call.
54 */
55 extern enum lttng_event_rule_status lttng_event_rule_uprobe_get_location(
56 const struct lttng_event_rule *rule,
57 const struct lttng_userspace_probe_location **location);
58
59 /*
60 * Set the name of a uprobe event rule.
61 *
62 * The name is copied.
63 *
64 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
65 * if invalid parameters are passed.
66 */
67 extern enum lttng_event_rule_status lttng_event_rule_uprobe_set_name(
68 struct lttng_event_rule *rule, const char *name);
69
70 /*
71 * Get the name of a uprobe event rule.
72 *
73 * The caller does not assume the ownership of the returned name.
74 * The name shall only only be used for the duration of the event
75 * rule's lifetime, or before a different name is set.
76 *
77 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's name on
78 * success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is passed,
79 * or LTTNG_EVENT_RULE_STATUS_UNSET if a name was not set prior to this call.
80 */
81 extern enum lttng_event_rule_status lttng_event_rule_uprobe_get_name(
82 const struct lttng_event_rule *rule, const char **name);
83
84 #ifdef __cplusplus
85 }
86 #endif
87
88 #endif /* LTTNG_EVENT_RULE_UPROBE_H */
This page took 0.045661 seconds and 5 git commands to generate.