lib: compile liblttng-ctl as C++
[lttng-tools.git] / include / lttng / event-rule / kernel-kprobe.h
CommitLineData
077192fd
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
85522de5
JR
8#ifndef LTTNG_EVENT_RULE_KERNEL_KPROBE_H
9#define LTTNG_EVENT_RULE_KERNEL_KPROBE_H
077192fd
JR
10
11#include <lttng/event-rule/event-rule.h>
4bd69c5f 12#include <lttng/lttng-export.h>
077192fd
JR
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18struct lttng_kernel_probe_location;
19
20/*
85522de5 21 * Create a newly allocated kernel kprobe event rule.
077192fd 22 *
077192fd
JR
23 * The location is copied internally.
24 *
602a6d40
JR
25 * Returns a new event rule on success, NULL on failure. The returned event rule
26 * must be destroyed using lttng_event_rule_destroy().
077192fd 27 */
4bd69c5f 28LTTNG_EXPORT extern struct lttng_event_rule *lttng_event_rule_kernel_kprobe_create(
077192fd
JR
29 const struct lttng_kernel_probe_location *location);
30
31/*
85522de5 32 * Get the kernel probe location of a kernel kprobe event rule.
077192fd
JR
33 *
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.
37 *
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
41 * this call.
42 */
4bd69c5f 43LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_kprobe_get_location(
077192fd
JR
44 const struct lttng_event_rule *rule,
45 const struct lttng_kernel_probe_location **location);
46
47/*
85522de5 48 * Set the name of a kernel kprobe event rule.
077192fd
JR
49 *
50 * The name is copied internally.
51 *
52 * Returns LTTNG_EVENT_RULE_STATUS_OK on success, LTTNG_EVENT_RULE_STATUS_INVALID
53 * if invalid parameters are passed.
54 */
4bd69c5f 55LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_kprobe_set_event_name(
077192fd
JR
56 struct lttng_event_rule *rule, const char *name);
57
58/*
85522de5 59 * Get the name of a kernel kprobe event rule.
077192fd
JR
60 *
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.
64 *
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.
68 */
4bd69c5f 69LTTNG_EXPORT extern enum lttng_event_rule_status lttng_event_rule_kernel_kprobe_get_event_name(
077192fd
JR
70 const struct lttng_event_rule *rule, const char **name);
71
72#ifdef __cplusplus
73}
74#endif
75
85522de5 76#endif /* LTTNG_EVENT_RULE_KERNEL_KPROBE_H */
This page took 0.027985 seconds and 4 git commands to generate.