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/log-level-rule.h>
14 #include <lttng/event.h>
21 * Create a newly allocated tracepoint event rule.
23 * The default pattern is '*'.
25 * Returns a new event rule on success, NULL on failure. This event rule must be
26 * destroyed using lttng_event_rule_destroy().
28 extern struct lttng_event_rule
*lttng_event_rule_tracepoint_create(
29 enum lttng_domain_type domain
);
32 * Set the name pattern of a tracepoint event rule.
34 * Pattern can contain wildcard '*'. See man lttng-enable-event.
36 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
37 * if invalid parameters are passed.
39 extern enum lttng_event_rule_status
lttng_event_rule_tracepoint_set_name_pattern(
40 struct lttng_event_rule
*rule
, const char *pattern
);
43 * Get the name pattern of a tracepoint event rule.
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.
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.
54 extern enum lttng_event_rule_status
lttng_event_rule_tracepoint_get_name_pattern(
55 const struct lttng_event_rule
*rule
, const char **pattern
);
58 * Get the domain type of a tracepoint event rule.
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
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
);
70 * Set the filter expression of a tracepoint event rule.
72 * The expression is copied internally.
74 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
75 * if invalid parameters are passed.
77 extern enum lttng_event_rule_status
lttng_event_rule_tracepoint_set_filter(
78 struct lttng_event_rule
*rule
, const char *expression
);
81 * Get the filter expression of a tracepoint event rule.
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.
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.
92 extern enum lttng_event_rule_status
lttng_event_rule_tracepoint_get_filter(
93 const struct lttng_event_rule
*rule
, const char **expression
);
96 * Set the log level rule of a tracepoint event rule.
98 * The log level rule is copied internally.
100 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
101 * if invalid parameters are passed.
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
);
108 * Get the log level rule of a tracepoint event rule.
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.
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
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
);
125 * Add a name pattern exclusion to the set of name pattern exclusion of an event rule.
127 * The passed exclusion will be copied to the event_rule.
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
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
);
139 * Get the name pattern exclusions property count of an event rule.
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
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
);
150 * Get the pattern name exclusion at the given index.
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
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
,
160 const char **exclusion
);
166 #endif /* LTTNG_EVENT_RULE_TRACEPOINT_H */
This page took 0.033447 seconds and 4 git commands to generate.