Commit | Line | Data |
---|---|---|
5024c2ac JR |
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_KPROBE_H | |
9 | #define LTTNG_EVENT_RULE_KPROBE_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 kprobe event rule. | |
19 | * | |
20 | * Returns a new event rule on success, NULL on failure. The returned event rule | |
21 | * must be destroyed using lttng_event_rule_destroy(). | |
22 | */ | |
23 | extern struct lttng_event_rule *lttng_event_rule_kprobe_create(void); | |
24 | ||
25 | /* | |
26 | * Set the source of a kprobe event rule. | |
27 | * | |
28 | * Possible formats for the source argument: | |
29 | * Address (0x prefix supported) | |
30 | * Symbol name | |
31 | * Symbol name and offset (SYMBOL+OFFSET format) | |
32 | * | |
33 | * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID | |
34 | * if invalid parameters are passed. | |
35 | */ | |
36 | extern enum lttng_event_rule_status lttng_event_rule_kprobe_set_source( | |
37 | struct lttng_event_rule *rule, const char *source); | |
38 | ||
39 | /* | |
40 | * Set the name of a kprobe event rule. | |
41 | * | |
42 | * The name is copied internally. | |
43 | * | |
44 | * Return LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID | |
45 | * if invalid parameters are passed. | |
46 | */ | |
47 | extern enum lttng_event_rule_status lttng_event_rule_kprobe_set_name( | |
48 | struct lttng_event_rule *rule, const char *name); | |
49 | ||
50 | /* | |
51 | * Get the name of a kprobe event rule. | |
52 | * | |
53 | * The caller does not assume the ownership of the returned name. | |
54 | * The name shall only only be used for the duration of the event | |
55 | * rule's lifetime, or before a different name is set. | |
56 | * | |
57 | * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's name on | |
58 | * success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is passed, | |
59 | * or LTTNG_EVENT_RULE_STATUS_UNSET if a name was not set prior to this call. | |
60 | */ | |
61 | extern enum lttng_event_rule_status lttng_event_rule_kprobe_get_name( | |
62 | const struct lttng_event_rule *rule, const char **name); | |
63 | ||
64 | #ifdef __cplusplus | |
65 | } | |
66 | #endif | |
67 | ||
68 | #endif /* LTTNG_EVENT_RULE_KPROBE_H */ |