7ee91ce79c15c5bdcfb2305a2689e108d676e24c
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/lttng-export.h>
15 #include <lttng/event.h>
22 * Create a newly allocated user tracepoint event rule.
24 * The default pattern is '*'.
26 * Returns a new event rule on success, NULL on failure. This event rule must be
27 * destroyed using lttng_event_rule_destroy().
29 LTTNG_EXPORT
extern struct lttng_event_rule
*lttng_event_rule_user_tracepoint_create(void);
32 * Set the name pattern of a user 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 LTTNG_EXPORT
extern enum lttng_event_rule_status
lttng_event_rule_user_tracepoint_set_name_pattern(
40 struct lttng_event_rule
*rule
, const char *pattern
);
43 * Get the name pattern of a user 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 LTTNG_EXPORT
extern enum lttng_event_rule_status
lttng_event_rule_user_tracepoint_get_name_pattern(
55 const struct lttng_event_rule
*rule
, const char **pattern
);
58 * Set the filter expression of a user tracepoint event rule.
60 * The expression is copied internally.
62 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
63 * if invalid parameters are passed.
65 LTTNG_EXPORT
extern enum lttng_event_rule_status
lttng_event_rule_user_tracepoint_set_filter(
66 struct lttng_event_rule
*rule
, const char *expression
);
69 * Get the filter expression of a user tracepoint event rule.
71 * The caller does not assume the ownership of the returned filter expression.
72 * The filter expression shall only only be used for the duration of the event
73 * rule's lifetime, or before a different filter expression is set.
75 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's filter
76 * expression on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
77 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
78 * was not set prior to this call.
80 LTTNG_EXPORT
extern enum lttng_event_rule_status
lttng_event_rule_user_tracepoint_get_filter(
81 const struct lttng_event_rule
*rule
, const char **expression
);
84 * Set the log level rule of a user tracepoint event rule.
86 * The log level rule is copied internally.
88 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
89 * if invalid parameters are passed.
91 LTTNG_EXPORT
extern enum lttng_event_rule_status
92 lttng_event_rule_user_tracepoint_set_log_level_rule(struct lttng_event_rule
*rule
,
93 const struct lttng_log_level_rule
*log_level_rule
);
96 * Get the log level rule of a user tracepoint event rule.
98 * The caller does not assume the ownership of the returned log level rule. The
99 * log level rule shall only only be used for the duration of the event rule's
100 * lifetime, or before a different log level rule is set.
102 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the log level rule output
103 * parameter on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter
104 * is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a log level rule was not set prior
107 LTTNG_EXPORT
extern enum lttng_event_rule_status
108 lttng_event_rule_user_tracepoint_get_log_level_rule(
109 const struct lttng_event_rule
*rule
,
110 const struct lttng_log_level_rule
**log_level_rule
);
113 * Add a name pattern exclusion to the set of name pattern exclusion of an event rule.
115 * The passed exclusion will be copied to the event_rule.
117 * Returns LTTNG_EVENT_RULE_STATUS_OK on success,
118 * LTTNG_EVENT_RULE_STATUS_INVALID if invalid parameters are passed.
120 LTTNG_EXPORT
extern enum lttng_event_rule_status
lttng_event_rule_user_tracepoint_add_name_pattern_exclusion(
121 struct lttng_event_rule
*rule
,
122 const char *exclusion
);
125 * Get the name pattern exclusions property count of an event rule.
127 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the count output parameter
128 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is
131 LTTNG_EXPORT
extern enum lttng_event_rule_status
132 lttng_event_rule_user_tracepoint_get_name_pattern_exclusion_count(
133 const struct lttng_event_rule
*rule
, unsigned int *count
);
136 * Get the pattern name exclusion at the given index.
138 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the exclusion output parameter
139 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is
142 LTTNG_EXPORT
extern enum lttng_event_rule_status
143 lttng_event_rule_user_tracepoint_get_name_pattern_exclusion_at_index(
144 const struct lttng_event_rule
*rule
,
146 const char **exclusion
);
152 #endif /* LTTNG_EVENT_RULE_USER_TRACEPOINT_H */
This page took 0.032197 seconds and 3 git commands to generate.