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/event.h>
14 #include <lttng/log-level-rule.h>
15 #include <lttng/lttng-export.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
40 lttng_event_rule_user_tracepoint_set_name_pattern(struct lttng_event_rule
*rule
,
44 * Get the name pattern of a user tracepoint event rule.
46 * The caller does not assume the ownership of the returned pattern. The
47 * pattern shall only only be used for the duration of the event rule's
48 * lifetime, or before a different pattern is set.
50 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's pattern
51 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
52 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern
53 * was not set prior to this call.
55 LTTNG_EXPORT
extern enum lttng_event_rule_status
56 lttng_event_rule_user_tracepoint_get_name_pattern(const struct lttng_event_rule
*rule
,
57 const char **pattern
);
60 * Set the filter expression of a user tracepoint event rule.
62 * The expression is copied internally.
64 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
65 * if invalid parameters are passed.
67 LTTNG_EXPORT
extern enum lttng_event_rule_status
68 lttng_event_rule_user_tracepoint_set_filter(struct lttng_event_rule
*rule
, const char *expression
);
71 * Get the filter expression of a user tracepoint event rule.
73 * The caller does not assume the ownership of the returned filter expression.
74 * The filter expression shall only only be used for the duration of the event
75 * rule's lifetime, or before a different filter expression is set.
77 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's filter
78 * expression on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
79 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
80 * was not set prior to this call.
82 LTTNG_EXPORT
extern enum lttng_event_rule_status
83 lttng_event_rule_user_tracepoint_get_filter(const struct lttng_event_rule
*rule
,
84 const char **expression
);
87 * Set the log level rule of a user tracepoint event rule.
89 * The log level rule is copied internally.
91 * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
92 * if invalid parameters are passed.
94 LTTNG_EXPORT
extern enum lttng_event_rule_status
95 lttng_event_rule_user_tracepoint_set_log_level_rule(
96 struct lttng_event_rule
*rule
, const struct lttng_log_level_rule
*log_level_rule
);
99 * Get the log level rule of a user tracepoint event rule.
101 * The caller does not assume the ownership of the returned log level rule. The
102 * log level rule shall only only be used for the duration of the event rule's
103 * lifetime, or before a different log level rule is set.
105 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the log level rule output
106 * parameter on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter
107 * is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a log level rule was not set prior
110 LTTNG_EXPORT
extern enum lttng_event_rule_status
111 lttng_event_rule_user_tracepoint_get_log_level_rule(
112 const struct lttng_event_rule
*rule
, const struct lttng_log_level_rule
**log_level_rule
);
115 * Add a name pattern exclusion to the set of name pattern exclusion of an event rule.
117 * The passed exclusion will be copied to the event_rule.
119 * Returns LTTNG_EVENT_RULE_STATUS_OK on success,
120 * LTTNG_EVENT_RULE_STATUS_INVALID if invalid parameters are passed.
122 LTTNG_EXPORT
extern enum lttng_event_rule_status
123 lttng_event_rule_user_tracepoint_add_name_pattern_exclusion(struct lttng_event_rule
*rule
,
124 const char *exclusion
);
127 * Get the name pattern exclusions property count of an event rule.
129 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the count output parameter
130 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is
133 LTTNG_EXPORT
extern enum lttng_event_rule_status
134 lttng_event_rule_user_tracepoint_get_name_pattern_exclusion_count(
135 const struct lttng_event_rule
*rule
, unsigned int *count
);
138 * Get the pattern name exclusion at the given index.
140 * Returns LTTNG_EVENT_RULE_STATUS_OK and sets the exclusion output parameter
141 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is
144 LTTNG_EXPORT
extern enum lttng_event_rule_status
145 lttng_event_rule_user_tracepoint_get_name_pattern_exclusion_at_index(
146 const struct lttng_event_rule
*rule
, unsigned int index
, const char **exclusion
);
152 #endif /* LTTNG_EVENT_RULE_USER_TRACEPOINT_H */
This page took 0.032022 seconds and 4 git commands to generate.