Commit | Line | Data |
---|---|---|
077192fd | 1 | /* |
ebdb334b | 2 | * Copyright (C) 2021 Francis Deslauriers <francis.deslauriers@efficios.com> |
077192fd JR |
3 | * |
4 | * SPDX-License-Identifier: LGPL-2.1-only | |
5 | * | |
6 | */ | |
7 | ||
ebdb334b JR |
8 | #ifndef LTTNG_EVENT_RULE_KERNEL_FUNCTION_H |
9 | #define LTTNG_EVENT_RULE_KERNEL_FUNCTION_H | |
077192fd JR |
10 | |
11 | #include <lttng/event-rule/event-rule.h> | |
12 | ||
13 | #ifdef __cplusplus | |
14 | extern "C" { | |
15 | #endif | |
16 | ||
ebdb334b | 17 | struct lttng_kernel_function_location; |
077192fd JR |
18 | |
19 | /* | |
ebdb334b | 20 | * Create a newly allocated kernel function event rule. |
077192fd JR |
21 | * |
22 | * The location is copied internally. | |
23 | * | |
ebdb334b JR |
24 | * Returns a new event rule on success, NULL on failure. The returned event rule |
25 | * must be destroyed using lttng_event_rule_destroy(). | |
077192fd | 26 | */ |
ebdb334b JR |
27 | extern struct lttng_event_rule *lttng_event_rule_kernel_function_create( |
28 | const struct lttng_kernel_function_location *location); | |
077192fd JR |
29 | |
30 | /* | |
ebdb334b | 31 | * Get the kernel function location of a kernel function event rule. |
077192fd JR |
32 | * |
33 | * The caller does not assume the ownership of the returned location. | |
34 | * The location shall only be used for the duration of the event | |
35 | * rule's lifetime, or before a different location is set. | |
36 | * | |
37 | * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's location | |
38 | * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is | |
39 | * passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a location was not set prior to | |
40 | * this call. | |
41 | */ | |
ebdb334b | 42 | extern enum lttng_event_rule_status lttng_event_rule_kernel_function_get_location( |
077192fd | 43 | const struct lttng_event_rule *rule, |
ebdb334b | 44 | const struct lttng_kernel_function_location **location); |
077192fd JR |
45 | |
46 | /* | |
ebdb334b | 47 | * Set the name of a kernel function event rule. |
077192fd JR |
48 | * |
49 | * The name is copied internally. | |
50 | * | |
51 | * Returns LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID | |
52 | * if invalid parameters are passed. | |
53 | */ | |
ebdb334b | 54 | extern enum lttng_event_rule_status lttng_event_rule_kernel_function_set_event_name( |
077192fd JR |
55 | struct lttng_event_rule *rule, const char *name); |
56 | ||
57 | /* | |
ebdb334b | 58 | * Get the name of a kernel function event rule. |
077192fd JR |
59 | * |
60 | * The caller does not assume the ownership of the returned name. | |
61 | * The name shall only only be used for the duration of the event | |
62 | * rule's lifetime, or before a different name is set. | |
63 | * | |
64 | * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's name on | |
65 | * success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is passed, | |
66 | * or LTTNG_EVENT_RULE_STATUS_UNSET if a name was not set prior to this call. | |
67 | */ | |
ebdb334b | 68 | extern enum lttng_event_rule_status lttng_event_rule_kernel_function_get_event_name( |
077192fd JR |
69 | const struct lttng_event_rule *rule, const char **name); |
70 | ||
71 | #ifdef __cplusplus | |
72 | } | |
73 | #endif | |
74 | ||
ebdb334b | 75 | #endif /* LTTNG_EVENT_RULE_KERNEL_FUNCTION_H */ |