Rename lttng_event_rule_userspace_probe to lttng_event_rule_kernel_uprobe
[lttng-tools.git] / include / lttng / event-rule / tracepoint.h
1 /*
2 * Copyright (C) 2019 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8 #ifndef LTTNG_EVENT_RULE_TRACEPOINT_H
9 #define LTTNG_EVENT_RULE_TRACEPOINT_H
10
11 #include <lttng/domain.h>
12 #include <lttng/event-rule/event-rule.h>
13 #include <lttng/log-level-rule.h>
14 #include <lttng/event.h>
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 /*
21 * Create a newly allocated tracepoint event rule.
22 *
23 * The default pattern is '*'.
24 *
25 * Returns a new event rule on success, NULL on failure. This event rule must be
26 * destroyed using lttng_event_rule_destroy().
27 */
28 extern struct lttng_event_rule *lttng_event_rule_tracepoint_create(
29 enum lttng_domain_type domain);
30
31 /*
32 * Set the name pattern of a tracepoint event rule.
33 *
34 * Pattern can contain wildcard '*'. See man lttng-enable-event.
35 *
36 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
37 * if invalid parameters are passed.
38 */
39 extern enum lttng_event_rule_status lttng_event_rule_tracepoint_set_name_pattern(
40 struct lttng_event_rule *rule, const char *pattern);
41
42 /*
43 * Get the name pattern of a tracepoint event rule.
44 *
45 * The caller does not assume the ownership of the returned pattern. The
46 * pattern shall only only be used for the duration of the event rule's
47 * lifetime, or before a different pattern is set.
48 *
49 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's pattern
50 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
51 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern
52 * was not set prior to this call.
53 */
54 extern enum lttng_event_rule_status lttng_event_rule_tracepoint_get_name_pattern(
55 const struct lttng_event_rule *rule, const char **pattern);
56
57 /*
58 * Get the domain type of a tracepoint event rule.
59 *
60 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the domain type output parameter
61 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is
62 * passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern was not set prior to
63 * this call.
64 */
65 extern enum lttng_event_rule_status lttng_event_rule_tracepoint_get_domain_type(
66 const struct lttng_event_rule *rule,
67 enum lttng_domain_type *type);
68
69 /*
70 * Set the filter expression of a tracepoint event rule.
71 *
72 * The expression is copied internally.
73 *
74 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
75 * if invalid parameters are passed.
76 */
77 extern enum lttng_event_rule_status lttng_event_rule_tracepoint_set_filter(
78 struct lttng_event_rule *rule, const char *expression);
79
80 /*
81 * Get the filter expression of a tracepoint event rule.
82 *
83 * The caller does not assume the ownership of the returned filter expression.
84 * The filter expression shall only only be used for the duration of the event
85 * rule's lifetime, or before a different filter expression is set.
86 *
87 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's filter
88 * expression on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
89 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
90 * was not set prior to this call.
91 */
92 extern enum lttng_event_rule_status lttng_event_rule_tracepoint_get_filter(
93 const struct lttng_event_rule *rule, const char **expression);
94
95 /*
96 * Set the log level rule of a tracepoint event rule.
97 *
98 * The log level rule is copied internally.
99 *
100 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
101 * if invalid parameters are passed.
102 */
103 extern enum lttng_event_rule_status
104 lttng_event_rule_tracepoint_set_log_level_rule(struct lttng_event_rule *rule,
105 const struct lttng_log_level_rule *log_level_rule);
106
107 /*
108 * Get the log level rule of a tracepoint event rule.
109 *
110 * The caller does not assume the ownership of the returned log level rule. The
111 * log level rule shall only only be used for the duration of the event rule's
112 * lifetime, or before a different log level rule is set.
113 *
114 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the log level rule output
115 * parameter on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter
116 * is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a log level rule was not set prior
117 * to this call.
118 */
119 extern enum lttng_event_rule_status
120 lttng_event_rule_tracepoint_get_log_level_rule(
121 const struct lttng_event_rule *rule,
122 const struct lttng_log_level_rule **log_level_rule);
123
124 /*
125 * Add a name pattern exclusion to the set of name pattern exclusion of an event rule.
126 *
127 * The passed exclusion will be copied to the event_rule.
128 *
129 * Returns LTTNG_EVENT_RULE_STATUS_OK on success,
130 * LTTNG_EVENT_RULE_STATUS_INVALID if invalid parameters are passed, or
131 * LTTNG_EVENT_RULE_STATUS_UNSUPPORTED if this property is not supported by the
132 * domain.
133 */
134 extern enum lttng_event_rule_status lttng_event_rule_tracepoint_add_name_pattern_exclusion(
135 struct lttng_event_rule *rule,
136 const char *exclusion);
137
138 /*
139 * Get the name pattern exclusions property count of an event rule.
140 *
141 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the count output parameter
142 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is
143 * passed.
144 */
145 extern enum lttng_event_rule_status
146 lttng_event_rule_tracepoint_get_name_pattern_exclusion_count(
147 const struct lttng_event_rule *rule, unsigned int *count);
148
149 /*
150 * Get the pattern name exclusion at the given index.
151 *
152 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the exclusion output parameter
153 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is
154 * passed.
155 */
156 extern enum lttng_event_rule_status
157 lttng_event_rule_tracepoint_get_name_pattern_exclusion_at_index(
158 const struct lttng_event_rule *rule,
159 unsigned int index,
160 const char **exclusion);
161
162 #ifdef __cplusplus
163 }
164 #endif
165
166 #endif /* LTTNG_EVENT_RULE_TRACEPOINT_H */
This page took 0.033447 seconds and 4 git commands to generate.