e24b0fbe103e986ba7551c094c38d604d606ca6e
2 * Copyright (C) 2019 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_EVENT_RULE_TRACEPOINT_H
9 #define LTTNG_EVENT_RULE_TRACEPOINT_H
11 #include <lttng/domain.h>
12 #include <lttng/event-rule/event-rule.h>
13 #include <lttng/event.h>
20 * Create a newly allocated tracepoint event rule.
22 * Returns a new event rule on success, NULL on failure. This event rule must be
23 * destroyed using lttng_event_rule_destroy().
25 extern struct lttng_event_rule
*lttng_event_rule_tracepoint_create(
26 enum lttng_domain_type domain
);
29 * Set the pattern of a tracepoint event rule.
31 * Pattern can contain wildcard '*'. See man lttng-enable-event.
33 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
34 * if invalid parameters are passed.
36 extern enum lttng_event_rule_status
lttng_event_rule_tracepoint_set_pattern(
37 struct lttng_event_rule
*rule
, const char *pattern
);
40 * Get the pattern of a tracepoint event rule.
42 * The caller does not assume the ownership of the returned pattern. The
43 * pattern shall only only be used for the duration of the event rule's
44 * lifetime, or before a different pattern is set.
46 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's pattern
47 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
48 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern
49 * was not set prior to this call.
51 extern enum lttng_event_rule_status
lttng_event_rule_tracepoint_get_pattern(
52 const struct lttng_event_rule
*rule
, const char **pattern
);
55 * Get the domain type of a tracepoint event rule.
57 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the domain type output parameter
58 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is
59 * passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern was not set prior to
62 extern enum lttng_event_rule_status
lttng_event_rule_tracepoint_get_domain_type(
63 const struct lttng_event_rule
*rule
,
64 enum lttng_domain_type
*type
);
67 * Set the filter expression of a tracepoint event rule.
69 * The expression is copied internally.
71 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
72 * if invalid parameters are passed.
74 extern enum lttng_event_rule_status
lttng_event_rule_tracepoint_set_filter(
75 struct lttng_event_rule
*rule
, const char *expression
);
78 * Get the filter expression of a tracepoint event rule.
80 * The caller does not assume the ownership of the returned filter expression.
81 * The filter expression shall only only be used for the duration of the event
82 * rule's lifetime, or before a different filter expression is set.
84 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's filter
85 * expression on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
86 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
87 * was not set prior to this call.
89 extern enum lttng_event_rule_status
lttng_event_rule_tracepoint_get_filter(
90 const struct lttng_event_rule
*rule
, const char **expression
);
93 * Set the single log level of a tracepoint event rule.
95 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
96 * if invalid parameters are passed.
98 extern enum lttng_event_rule_status
lttng_event_rule_tracepoint_set_log_level(
99 struct lttng_event_rule
*rule
, int level
);
102 * Set the log level range lower bound of a tracepoint event rule.
104 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
105 * if invalid parameters are passed.
107 extern enum lttng_event_rule_status
108 lttng_event_rule_tracepoint_set_log_level_range_lower_bound(
109 struct lttng_event_rule
*rule
, int level
);
112 * Set the log level to all of a tracepoint event rule.
114 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
115 * if invalid parameters are passed.
117 extern enum lttng_event_rule_status
118 lttng_event_rule_tracepoint_set_log_level_all(struct lttng_event_rule
*rule
);
121 * Get the log level type of a tracepoint event rule.
123 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the log level type output
124 * parameter on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter
125 * is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a log level was not set prior
128 extern enum lttng_event_rule_status
129 lttng_event_rule_tracepoint_get_log_level_type(
130 const struct lttng_event_rule
*rule
,
131 enum lttng_loglevel_type
*type
);
134 * Get the log level of a tracepoint event rule.
136 * For range log level , the lower bound log level is returned.
138 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the log level output parameter
139 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is
140 * passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a log level was not set prior to
143 extern enum lttng_event_rule_status
lttng_event_rule_tracepoint_get_log_level(
144 const struct lttng_event_rule
*rule
, int *level
);
147 * Add an exclusion to the set of exclusion of an event rule.
149 * The passed exclusion will be copied to the event_rule.
151 * Returns LTTNG_EVENT_RULE_STATUS_OK on success,
152 * LTTNG_EVENT_RULE_STATUS_INVALID if invalid parameters are passed, or
153 * LTTNG_EVENT_RULE_STATUS_UNSUPPORTED if this property is not supported by the
156 extern enum lttng_event_rule_status
lttng_event_rule_tracepoint_add_exclusion(
157 struct lttng_event_rule
*rule
,
158 const char *exclusion
);
161 * Get the exclusions property count of an event rule.
163 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the count output parameter
164 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is
167 extern enum lttng_event_rule_status
168 lttng_event_rule_tracepoint_get_exclusions_count(
169 const struct lttng_event_rule
*rule
, unsigned int *count
);
172 * Get the event rule exclusion at the given index.
174 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the exclusion output parameter
175 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is
178 extern enum lttng_event_rule_status
179 lttng_event_rule_tracepoint_get_exclusion_at_index(
180 const struct lttng_event_rule
*rule
,
182 const char **exclusion
);
188 #endif /* LTTNG_EVENT_RULE_TRACEPOINT_H */
This page took 0.031978 seconds and 4 git commands to generate.