1 #ifndef _LTTNG_UST_EVENTS_INTERNAL_H
2 #define _LTTNG_UST_EVENTS_INTERNAL_H
5 * ust-events-internal.h
7 * Copyright 2019 (c) - Francis Deslauriers <francis.deslauriers@efficios.com>
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to deal
11 * in the Software without restriction, including without limitation the rights
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 * copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 #include <urcu/list.h>
31 #include <urcu/hlist.h>
34 #include <lttng/ust-events.h>
36 struct lttng_event_enabler
{
37 struct lttng_enabler base
;
38 struct cds_list_head node
; /* per-session list of enablers */
39 struct lttng_channel
*chan
;
41 * Unused, but kept around to make it explicit that the tracer can do
44 struct lttng_ctx
*ctx
;
48 struct lttng_enabler
*lttng_event_enabler_as_enabler(
49 struct lttng_event_enabler
*event_enabler
)
51 return &event_enabler
->base
;
56 * Allocate and initialize a `struct lttng_event_enabler` object.
58 * On success, returns a `struct lttng_event_enabler`,
59 * On memory error, returns NULL.
62 struct lttng_event_enabler
*lttng_event_enabler_create(
63 enum lttng_enabler_format_type format_type
,
64 struct lttng_ust_event
*event_param
,
65 struct lttng_channel
*chan
);
68 * Destroy a `struct lttng_event_enabler` object.
71 void lttng_event_enabler_destroy(struct lttng_event_enabler
*enabler
);
74 * Enable a `struct lttng_event_enabler` object and all events related to this
78 int lttng_event_enabler_enable(struct lttng_event_enabler
*enabler
);
81 * Disable a `struct lttng_event_enabler` object and all events related to this
85 int lttng_event_enabler_disable(struct lttng_event_enabler
*enabler
);
88 * Attach filter bytecode program to `struct lttng_event_enabler` and all
89 * events related to this enabler.
92 int lttng_event_enabler_attach_bytecode(struct lttng_event_enabler
*enabler
,
93 struct lttng_ust_filter_bytecode_node
*bytecode
);
96 * Attach an application context to an event enabler.
101 int lttng_event_enabler_attach_context(struct lttng_event_enabler
*enabler
,
102 struct lttng_ust_context
*ctx
);
105 * Attach exclusion list to `struct lttng_event_enabler` and all
106 * events related to this enabler.
109 int lttng_event_enabler_attach_exclusion(struct lttng_event_enabler
*enabler
,
110 struct lttng_ust_excluder_node
*excluder
);
113 * Synchronize bytecodes for the enabler and the event.
115 * This function goes over all bytecode programs of the event enabler to ensure
116 * each is linked to the provided event.
119 void lttng_event_enabler_link_bytecode(struct lttng_event
*event
,
120 struct lttng_event_enabler
*enabler
);
122 #endif /* _LTTNG_UST_EVENTS_INTERNAL_H */