event-rule: introduce event rule syscall
[lttng-tools.git] / include / lttng / event-rule / syscall.h
1 /*
2 * Copyright (C) 2019 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8 #ifndef LTTNG_EVENT_RULE_SYSCALL_H
9 #define LTTNG_EVENT_RULE_SYSCALL_H
10
11 #include <lttng/event-rule/event-rule.h>
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 /*
18 * Create a newly allocated syscall event rule.
19 *
20 * Returns a new event rule on success, NULL on failure. This event rule must be
21 * destroyed using lttng_event_rule_destroy().
22 */
23 extern struct lttng_event_rule *lttng_event_rule_syscall_create(void);
24
25 /*
26 * Set the pattern of a syscall event rule.
27 *
28 * Pattern can contain wildcard '*'. See man lttng-enable-event.
29 *
30 * The pattern is copied internally.
31 *
32 * Returns LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
33 * if invalid parameters are passed.
34 */
35 extern enum lttng_event_rule_status lttng_event_rule_syscall_set_pattern(
36 struct lttng_event_rule *rule, const char *pattern);
37
38 /*
39 * Get the pattern of a syscall event rule.
40 *
41 * The caller does not assume the ownership of the returned pattern. The
42 * pattern shall only only be used for the duration of the event rule's
43 * lifetime, or before a different pattern is set.
44 *
45 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's pattern
46 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
47 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern
48 * was not set prior to this call.
49 */
50 extern enum lttng_event_rule_status lttng_event_rule_syscall_get_pattern(
51 const struct lttng_event_rule *rule, const char **pattern);
52
53 /*
54 * Set the filter expression of a syscall event rule.
55 *
56 * The expression is copied internally.
57 *
58 * Returns LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
59 * if invalid parameters are passed.
60 */
61 extern enum lttng_event_rule_status lttng_event_rule_syscall_set_filter(
62 struct lttng_event_rule *rule, const char *expression);
63
64 /*
65 * Get the filter expression of a syscall event rule.
66 *
67 * The caller does not assume the ownership of the returned filter expression.
68 * The filter expression shall only only be used for the duration of the event
69 * rule's lifetime, or before a different filter expression is set.
70 *
71 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's filter
72 * expression on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
73 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
74 * was not set prior to this call.
75 */
76 extern enum lttng_event_rule_status lttng_event_rule_syscall_get_filter(
77 const struct lttng_event_rule *rule, const char **expression);
78
79 #ifdef __cplusplus
80 }
81 #endif
82
83 #endif /* LTTNG_EVENT_RULE_SYSCALL_H */
This page took 0.030005 seconds and 4 git commands to generate.