Commit | Line | Data |
---|---|---|
1831ae68 FD |
1 | /* |
2 | * Copyright (C) 2019 - Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com> | |
3 | * | |
4 | * This library is free software; you can redistribute it and/or modify it | |
5 | * under the terms of the GNU Lesser General Public License, version 2.1 only, | |
6 | * as published by the Free Software Foundation. | |
7 | * | |
8 | * This library is distributed in the hope that it will be useful, but WITHOUT | |
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License | |
11 | * for more details. | |
12 | * | |
13 | * You should have received a copy of the GNU Lesser General Public License | |
14 | * along with this library; if not, write to the Free Software Foundation, | |
15 | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
16 | */ | |
17 | ||
18 | #ifndef LTTNG_EVENT_RULE_SYSCALL_H | |
19 | #define LTTNG_EVENT_RULE_SYSCALL_H | |
20 | ||
21 | #include <lttng/event-rule/event-rule.h> | |
22 | ||
23 | #ifdef __cplusplus | |
24 | extern "C" { | |
25 | #endif | |
26 | ||
27 | /* | |
28 | * TODO: | |
29 | */ | |
30 | extern struct lttng_event_rule *lttng_event_rule_syscall_create(void); | |
31 | ||
32 | /* | |
33 | * Set the pattern of a syscall event rule. | |
34 | * | |
35 | * Pattern can contains wildcard '*'. See man lttng-enable-event. | |
36 | * | |
37 | * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID | |
38 | * if invalid parameters are passed. | |
39 | */ | |
40 | extern enum lttng_event_rule_status lttng_event_rule_syscall_set_pattern( | |
41 | struct lttng_event_rule *rule, const char *pattern); | |
42 | ||
43 | /* | |
44 | * Get the pattern of a tracecpoint event rule. | |
45 | * | |
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. | |
49 | * | |
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. | |
54 | */ | |
55 | extern enum lttng_event_rule_status lttng_event_rule_syscall_get_pattern( | |
56 | const struct lttng_event_rule *rule, const char **pattern); | |
57 | ||
58 | /* | |
59 | * Set the filter expression of a syscall event rule. | |
60 | * | |
61 | * The expression is copied. | |
62 | * | |
63 | * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID | |
64 | * if invalid parameters are passed. | |
65 | */ | |
66 | extern enum lttng_event_rule_status lttng_event_rule_syscall_set_filter( | |
67 | struct lttng_event_rule *rule, const char *expression); | |
68 | ||
69 | /* | |
70 | * Get the filter expression of a syscall event rule. | |
71 | * | |
72 | * The caller does not assume the ownership of the returned filter expression. | |
73 | * The filter expression shall only only be used for the duration of the event | |
74 | * rule's lifetime, or before a different filter expression is set. | |
75 | * | |
76 | * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's filter | |
77 | * expression on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid | |
78 | * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression | |
79 | * was not set prior to this call. | |
80 | */ | |
81 | extern enum lttng_event_rule_status lttng_event_rule_syscall_get_filter( | |
82 | const struct lttng_event_rule *rule, const char **expression); | |
83 | ||
84 | #ifdef __cplusplus | |
85 | } | |
86 | #endif | |
87 | ||
88 | #endif /* LTTNG_EVENT_RULE_H */ |