2 * Copyright (C) 2019 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_EVENT_RULE_KERNEL_KPROBE_H
9 #define LTTNG_EVENT_RULE_KERNEL_KPROBE_H
11 #include <lttng/event-rule/event-rule.h>
12 #include <lttng/lttng-export.h>
18 struct lttng_kernel_probe_location
;
21 * Create a newly allocated kernel kprobe event rule.
23 * The location is copied internally.
25 * Returns a new event rule on success, NULL on failure. The returned event rule
26 * must be destroyed using lttng_event_rule_destroy().
28 LTTNG_EXPORT
extern struct lttng_event_rule
*
29 lttng_event_rule_kernel_kprobe_create(const struct lttng_kernel_probe_location
*location
);
32 * Get the kernel probe location of a kernel kprobe event rule.
34 * The caller does not assume the ownership of the returned location.
35 * The location shall only be used for the duration of the event
36 * rule's lifetime, or before a different location is set.
38 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's location
39 * on success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is
40 * passed, or LTTNG_EVENT_RULE_STATUS_UNSET if a location was not set prior to
43 LTTNG_EXPORT
extern enum lttng_event_rule_status
44 lttng_event_rule_kernel_kprobe_get_location(const struct lttng_event_rule
*rule
,
45 const struct lttng_kernel_probe_location
**location
);
48 * Set the name of a kernel kprobe event rule.
50 * The name is copied internally.
52 * Returns LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
53 * if invalid parameters are passed.
55 LTTNG_EXPORT
extern enum lttng_event_rule_status
56 lttng_event_rule_kernel_kprobe_set_event_name(struct lttng_event_rule
*rule
, const char *name
);
59 * Get the name of a kernel kprobe event rule.
61 * The caller does not assume the ownership of the returned name.
62 * The name shall only only be used for the duration of the event
63 * rule's lifetime, or before a different name is set.
65 * Returns LTTNG_EVENT_RULE_STATUS_OK and a pointer to the event rule's name on
66 * success, LTTNG_EVENT_RULE_STATUS_INVALID if an invalid parameter is passed,
67 * or LTTNG_EVENT_RULE_STATUS_UNSET if a name was not set prior to this call.
69 LTTNG_EXPORT
extern enum lttng_event_rule_status
70 lttng_event_rule_kernel_kprobe_get_event_name(const struct lttng_event_rule
*rule
,
77 #endif /* LTTNG_EVENT_RULE_KERNEL_KPROBE_H */