2 * Copyright (C) 2021 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_EVENT_RULE_USER_TRACEPOINT_H
9 #define LTTNG_EVENT_RULE_USER_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 user 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_user_tracepoint_create(void);
31 * Set the name pattern of a user tracepoint event rule.
33 * Pattern can contain wildcard '*'. See man lttng-enable-event.
35 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
36 * if invalid parameters are passed.
38 extern enum lttng_event_rule_status
lttng_event_rule_user_tracepoint_set_name_pattern(
39 struct lttng_event_rule
*rule
, const char *pattern
);
42 * Get the name pattern of a user tracepoint event rule.
44 * The caller does not assume the ownership of the returned pattern. The
45 * pattern shall only only be used for the duration of the event rule's
46 * lifetime, or before a different pattern is set.
48 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's pattern
49 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
50 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern
51 * was not set prior to this call.
53 extern enum lttng_event_rule_status
lttng_event_rule_user_tracepoint_get_name_pattern(
54 const struct lttng_event_rule
*rule
, const char **pattern
);
57 * Set the filter expression of a user tracepoint event rule.
59 * The expression is copied internally.
61 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
62 * if invalid parameters are passed.
64 extern enum lttng_event_rule_status
lttng_event_rule_user_tracepoint_set_filter(
65 struct lttng_event_rule
*rule
, const char *expression
);
68 * Get the filter expression of a user tracepoint event rule.
70 * The caller does not assume the ownership of the returned filter expression.
71 * The filter expression shall only only be used for the duration of the event
72 * rule's lifetime, or before a different filter expression is set.
74 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's filter
75 * expression on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
76 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
77 * was not set prior to this call.
79 extern enum lttng_event_rule_status
lttng_event_rule_user_tracepoint_get_filter(
80 const struct lttng_event_rule
*rule
, const char **expression
);
83 * Set the log level rule of a user tracepoint event rule.
85 * The log level rule is copied internally.
87 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
88 * if invalid parameters are passed.
90 extern enum lttng_event_rule_status
91 lttng_event_rule_user_tracepoint_set_log_level_rule(struct lttng_event_rule
*rule
,
92 const struct lttng_log_level_rule
*log_level_rule
);
95 * Get the log level rule of a user tracepoint event rule.
97 * The caller does not assume the ownership of the returned log level rule. The
98 * log level rule shall only only be used for the duration of the event rule's
99 * lifetime, or before a different log level rule is set.
101 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the log level rule output
102 * parameter on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter
103 * is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a log level rule was not set prior
106 extern enum lttng_event_rule_status
107 lttng_event_rule_user_tracepoint_get_log_level_rule(
108 const struct lttng_event_rule
*rule
,
109 const struct lttng_log_level_rule
**log_level_rule
);
112 * Add a name pattern exclusion to the set of name pattern exclusion of an event rule.
114 * The passed exclusion will be copied to the event_rule.
116 * Returns LTTNG_EVENT_RULE_STATUS_OK on success,
117 * LTTNG_EVENT_RULE_STATUS_INVALID if invalid parameters are passed.
119 extern enum lttng_event_rule_status
lttng_event_rule_user_tracepoint_add_name_pattern_exclusion(
120 struct lttng_event_rule
*rule
,
121 const char *exclusion
);
124 * Get the name pattern exclusions property count of an event rule.
126 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the count output parameter
127 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is
130 extern enum lttng_event_rule_status
131 lttng_event_rule_user_tracepoint_get_name_pattern_exclusion_count(
132 const struct lttng_event_rule
*rule
, unsigned int *count
);
135 * Get the pattern name exclusion at the given index.
137 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the exclusion output parameter
138 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is
141 extern enum lttng_event_rule_status
142 lttng_event_rule_user_tracepoint_get_name_pattern_exclusion_at_index(
143 const struct lttng_event_rule
*rule
,
145 const char **exclusion
);
151 #endif /* LTTNG_EVENT_RULE_USER_TRACEPOINT_H */
This page took 0.03261 seconds and 4 git commands to generate.