2 * Copyright (C) 2019 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_EVENT_RULE_SYSCALL_H
9 #define LTTNG_EVENT_RULE_SYSCALL_H
11 #include <lttng/event-rule/event-rule.h>
17 enum lttng_event_rule_syscall_emission_site
{
18 LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY_EXIT
= 0,
19 LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY
= 1,
20 LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_EXIT
= 2,
21 LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_UNKNOWN
= -1,
25 * Create a newly allocated syscall event rule.
27 * The default pattern is '*'.
28 * The default emission site is LTTNG_EVENT_RULE_SYSCALL_EMISSION_SITE_ENTRY_EXIT.
30 * Returns a new event rule on success, NULL on failure. This event rule must be
31 * destroyed using lttng_event_rule_destroy().
33 extern struct lttng_event_rule
*lttng_event_rule_syscall_create(enum
34 lttng_event_rule_syscall_emission_site emission_site
);
37 * Set the name pattern of a syscall event rule.
39 * Pattern can contain wildcard '*'. See man lttng-enable-event.
41 * The pattern is copied internally.
43 * Returns LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
44 * if invalid parameters are passed.
46 extern enum lttng_event_rule_status
lttng_event_rule_syscall_set_name_pattern(
47 struct lttng_event_rule
*rule
, const char *pattern
);
50 * Get the name pattern of a syscall event rule.
52 * The caller does not assume the ownership of the returned pattern. The
53 * pattern shall only only be used for the duration of the event rule's
54 * lifetime, or before a different pattern is set.
56 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's pattern
57 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
58 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a pattern
59 * was not set prior to this call.
61 extern enum lttng_event_rule_status
lttng_event_rule_syscall_get_name_pattern(
62 const struct lttng_event_rule
*rule
, const char **pattern
);
65 * Set the filter expression of a syscall event rule.
67 * The expression is copied internally.
69 * Returns LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
70 * if invalid parameters are passed.
72 extern enum lttng_event_rule_status
lttng_event_rule_syscall_set_filter(
73 struct lttng_event_rule
*rule
, const char *expression
);
76 * Get the filter expression of a syscall event rule.
78 * The caller does not assume the ownership of the returned filter expression.
79 * The filter expression shall only only be used for the duration of the event
80 * rule's lifetime, or before a different filter expression is set.
82 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's filter
83 * expression on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid
84 * parameter is passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a filter expression
85 * was not set prior to this call.
87 extern enum lttng_event_rule_status
lttng_event_rule_syscall_get_filter(
88 const struct lttng_event_rule
*rule
, const char **expression
);
91 * Get the emission site of a syscall event rule.
93 * Returns a enum lttng_event_rule_syscall_emission_site.
95 extern enum lttng_event_rule_syscall_emission_site
96 lttng_event_rule_syscall_get_emission_site(
97 const struct lttng_event_rule
*rule
);
103 #endif /* LTTNG_EVENT_RULE_SYSCALL_H */