1 /* SPDX-License-Identifier: MIT
5 * LTTng modules bytecode code.
7 * Copyright (C) 2010-2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
10 #include <linux/list.h>
11 #include <linux/slab.h>
13 #include <lttng/lttng-bytecode.h>
15 static const char *opnames
[] = {
16 [ BYTECODE_OP_UNKNOWN
] = "UNKNOWN",
18 [ BYTECODE_OP_RETURN
] = "RETURN",
21 [ BYTECODE_OP_MUL
] = "MUL",
22 [ BYTECODE_OP_DIV
] = "DIV",
23 [ BYTECODE_OP_MOD
] = "MOD",
24 [ BYTECODE_OP_PLUS
] = "PLUS",
25 [ BYTECODE_OP_MINUS
] = "MINUS",
26 [ BYTECODE_OP_BIT_RSHIFT
] = "BIT_RSHIFT",
27 [ BYTECODE_OP_BIT_LSHIFT
] = "BIT_LSHIFT",
28 [ BYTECODE_OP_BIT_AND
] = "BIT_AND",
29 [ BYTECODE_OP_BIT_OR
] = "BIT_OR",
30 [ BYTECODE_OP_BIT_XOR
] = "BIT_XOR",
32 /* binary comparators */
33 [ BYTECODE_OP_EQ
] = "EQ",
34 [ BYTECODE_OP_NE
] = "NE",
35 [ BYTECODE_OP_GT
] = "GT",
36 [ BYTECODE_OP_LT
] = "LT",
37 [ BYTECODE_OP_GE
] = "GE",
38 [ BYTECODE_OP_LE
] = "LE",
40 /* string binary comparators */
41 [ BYTECODE_OP_EQ_STRING
] = "EQ_STRING",
42 [ BYTECODE_OP_NE_STRING
] = "NE_STRING",
43 [ BYTECODE_OP_GT_STRING
] = "GT_STRING",
44 [ BYTECODE_OP_LT_STRING
] = "LT_STRING",
45 [ BYTECODE_OP_GE_STRING
] = "GE_STRING",
46 [ BYTECODE_OP_LE_STRING
] = "LE_STRING",
48 /* s64 binary comparators */
49 [ BYTECODE_OP_EQ_S64
] = "EQ_S64",
50 [ BYTECODE_OP_NE_S64
] = "NE_S64",
51 [ BYTECODE_OP_GT_S64
] = "GT_S64",
52 [ BYTECODE_OP_LT_S64
] = "LT_S64",
53 [ BYTECODE_OP_GE_S64
] = "GE_S64",
54 [ BYTECODE_OP_LE_S64
] = "LE_S64",
56 /* double binary comparators */
57 [ BYTECODE_OP_EQ_DOUBLE
] = "EQ_DOUBLE",
58 [ BYTECODE_OP_NE_DOUBLE
] = "NE_DOUBLE",
59 [ BYTECODE_OP_GT_DOUBLE
] = "GT_DOUBLE",
60 [ BYTECODE_OP_LT_DOUBLE
] = "LT_DOUBLE",
61 [ BYTECODE_OP_GE_DOUBLE
] = "GE_DOUBLE",
62 [ BYTECODE_OP_LE_DOUBLE
] = "LE_DOUBLE",
64 /* Mixed S64-double binary comparators */
65 [ BYTECODE_OP_EQ_DOUBLE_S64
] = "EQ_DOUBLE_S64",
66 [ BYTECODE_OP_NE_DOUBLE_S64
] = "NE_DOUBLE_S64",
67 [ BYTECODE_OP_GT_DOUBLE_S64
] = "GT_DOUBLE_S64",
68 [ BYTECODE_OP_LT_DOUBLE_S64
] = "LT_DOUBLE_S64",
69 [ BYTECODE_OP_GE_DOUBLE_S64
] = "GE_DOUBLE_S64",
70 [ BYTECODE_OP_LE_DOUBLE_S64
] = "LE_DOUBLE_S64",
72 [ BYTECODE_OP_EQ_S64_DOUBLE
] = "EQ_S64_DOUBLE",
73 [ BYTECODE_OP_NE_S64_DOUBLE
] = "NE_S64_DOUBLE",
74 [ BYTECODE_OP_GT_S64_DOUBLE
] = "GT_S64_DOUBLE",
75 [ BYTECODE_OP_LT_S64_DOUBLE
] = "LT_S64_DOUBLE",
76 [ BYTECODE_OP_GE_S64_DOUBLE
] = "GE_S64_DOUBLE",
77 [ BYTECODE_OP_LE_S64_DOUBLE
] = "LE_S64_DOUBLE",
80 [ BYTECODE_OP_UNARY_PLUS
] = "UNARY_PLUS",
81 [ BYTECODE_OP_UNARY_MINUS
] = "UNARY_MINUS",
82 [ BYTECODE_OP_UNARY_NOT
] = "UNARY_NOT",
83 [ BYTECODE_OP_UNARY_PLUS_S64
] = "UNARY_PLUS_S64",
84 [ BYTECODE_OP_UNARY_MINUS_S64
] = "UNARY_MINUS_S64",
85 [ BYTECODE_OP_UNARY_NOT_S64
] = "UNARY_NOT_S64",
86 [ BYTECODE_OP_UNARY_PLUS_DOUBLE
] = "UNARY_PLUS_DOUBLE",
87 [ BYTECODE_OP_UNARY_MINUS_DOUBLE
] = "UNARY_MINUS_DOUBLE",
88 [ BYTECODE_OP_UNARY_NOT_DOUBLE
] = "UNARY_NOT_DOUBLE",
91 [ BYTECODE_OP_AND
] = "AND",
92 [ BYTECODE_OP_OR
] = "OR",
95 [ BYTECODE_OP_LOAD_FIELD_REF
] = "LOAD_FIELD_REF",
96 [ BYTECODE_OP_LOAD_FIELD_REF_STRING
] = "LOAD_FIELD_REF_STRING",
97 [ BYTECODE_OP_LOAD_FIELD_REF_SEQUENCE
] = "LOAD_FIELD_REF_SEQUENCE",
98 [ BYTECODE_OP_LOAD_FIELD_REF_S64
] = "LOAD_FIELD_REF_S64",
99 [ BYTECODE_OP_LOAD_FIELD_REF_DOUBLE
] = "LOAD_FIELD_REF_DOUBLE",
101 /* load from immediate operand */
102 [ BYTECODE_OP_LOAD_STRING
] = "LOAD_STRING",
103 [ BYTECODE_OP_LOAD_S64
] = "LOAD_S64",
104 [ BYTECODE_OP_LOAD_DOUBLE
] = "LOAD_DOUBLE",
107 [ BYTECODE_OP_CAST_TO_S64
] = "CAST_TO_S64",
108 [ BYTECODE_OP_CAST_DOUBLE_TO_S64
] = "CAST_DOUBLE_TO_S64",
109 [ BYTECODE_OP_CAST_NOP
] = "CAST_NOP",
111 /* get context ref */
112 [ BYTECODE_OP_GET_CONTEXT_REF
] = "GET_CONTEXT_REF",
113 [ BYTECODE_OP_GET_CONTEXT_REF_STRING
] = "GET_CONTEXT_REF_STRING",
114 [ BYTECODE_OP_GET_CONTEXT_REF_S64
] = "GET_CONTEXT_REF_S64",
115 [ BYTECODE_OP_GET_CONTEXT_REF_DOUBLE
] = "GET_CONTEXT_REF_DOUBLE",
117 /* load userspace field ref */
118 [ BYTECODE_OP_LOAD_FIELD_REF_USER_STRING
] = "LOAD_FIELD_REF_USER_STRING",
119 [ BYTECODE_OP_LOAD_FIELD_REF_USER_SEQUENCE
] = "LOAD_FIELD_REF_USER_SEQUENCE",
122 * load immediate star globbing pattern (literal string)
125 [ BYTECODE_OP_LOAD_STAR_GLOB_STRING
] = "LOAD_STAR_GLOB_STRING",
127 /* globbing pattern binary operator: apply to */
128 [ BYTECODE_OP_EQ_STAR_GLOB_STRING
] = "EQ_STAR_GLOB_STRING",
129 [ BYTECODE_OP_NE_STAR_GLOB_STRING
] = "NE_STAR_GLOB_STRING",
132 * Instructions for recursive traversal through composed types.
134 [ BYTECODE_OP_GET_CONTEXT_ROOT
] = "GET_CONTEXT_ROOT",
135 [ BYTECODE_OP_GET_APP_CONTEXT_ROOT
] = "GET_APP_CONTEXT_ROOT",
136 [ BYTECODE_OP_GET_PAYLOAD_ROOT
] = "GET_PAYLOAD_ROOT",
138 [ BYTECODE_OP_GET_SYMBOL
] = "GET_SYMBOL",
139 [ BYTECODE_OP_GET_SYMBOL_FIELD
] = "GET_SYMBOL_FIELD",
140 [ BYTECODE_OP_GET_INDEX_U16
] = "GET_INDEX_U16",
141 [ BYTECODE_OP_GET_INDEX_U64
] = "GET_INDEX_U64",
143 [ BYTECODE_OP_LOAD_FIELD
] = "LOAD_FIELD",
144 [ BYTECODE_OP_LOAD_FIELD_S8
] = "LOAD_FIELD_S8",
145 [ BYTECODE_OP_LOAD_FIELD_S16
] = "LOAD_FIELD_S16",
146 [ BYTECODE_OP_LOAD_FIELD_S32
] = "LOAD_FIELD_S32",
147 [ BYTECODE_OP_LOAD_FIELD_S64
] = "LOAD_FIELD_S64",
148 [ BYTECODE_OP_LOAD_FIELD_U8
] = "LOAD_FIELD_U8",
149 [ BYTECODE_OP_LOAD_FIELD_U16
] = "LOAD_FIELD_U16",
150 [ BYTECODE_OP_LOAD_FIELD_U32
] = "LOAD_FIELD_U32",
151 [ BYTECODE_OP_LOAD_FIELD_U64
] = "LOAD_FIELD_U64",
152 [ BYTECODE_OP_LOAD_FIELD_STRING
] = "LOAD_FIELD_STRING",
153 [ BYTECODE_OP_LOAD_FIELD_SEQUENCE
] = "LOAD_FIELD_SEQUENCE",
154 [ BYTECODE_OP_LOAD_FIELD_DOUBLE
] = "LOAD_FIELD_DOUBLE",
156 [ BYTECODE_OP_UNARY_BIT_NOT
] = "UNARY_BIT_NOT",
158 [ BYTECODE_OP_RETURN_S64
] = "RETURN_S64",
161 const char *lttng_bytecode_print_op(enum bytecode_op op
)
163 if (op
>= NR_BYTECODE_OPS
)
170 int apply_field_reloc(const struct lttng_event_desc
*event_desc
,
171 struct bytecode_runtime
*runtime
,
172 uint32_t runtime_len
,
173 uint32_t reloc_offset
,
174 const char *field_name
,
175 enum bytecode_op bytecode_op
)
177 const struct lttng_event_field
*fields
, *field
= NULL
;
178 unsigned int nr_fields
, i
;
180 uint32_t field_offset
= 0;
182 dbg_printk("Apply field reloc: %u %s\n", reloc_offset
, field_name
);
184 /* Lookup event by name */
187 fields
= event_desc
->fields
;
190 nr_fields
= event_desc
->nr_fields
;
191 for (i
= 0; i
< nr_fields
; i
++) {
192 if (fields
[i
].nofilter
)
194 if (!strcmp(fields
[i
].name
, field_name
)) {
198 /* compute field offset */
199 switch (fields
[i
].type
.type
) {
200 case lttng_kernel_type_integer
:
201 case lttng_kernel_type_enum_nestable
:
202 field_offset
+= sizeof(int64_t);
204 case lttng_kernel_type_array_nestable
:
205 if (!lttng_is_bytewise_integer(fields
[i
].type
.u
.array_nestable
.elem_type
))
207 field_offset
+= sizeof(unsigned long);
208 field_offset
+= sizeof(void *);
210 case lttng_kernel_type_sequence_nestable
:
211 if (!lttng_is_bytewise_integer(fields
[i
].type
.u
.sequence_nestable
.elem_type
))
213 field_offset
+= sizeof(unsigned long);
214 field_offset
+= sizeof(void *);
216 case lttng_kernel_type_string
:
217 field_offset
+= sizeof(void *);
219 case lttng_kernel_type_struct_nestable
: /* Unsupported. */
220 case lttng_kernel_type_variant_nestable
: /* Unsupported. */
228 /* Check if field offset is too large for 16-bit offset */
229 if (field_offset
> LTTNG_KERNEL_FILTER_BYTECODE_MAX_LEN
- 1)
233 op
= (struct load_op
*) &runtime
->code
[reloc_offset
];
235 switch (bytecode_op
) {
236 case BYTECODE_OP_LOAD_FIELD_REF
:
238 struct field_ref
*field_ref
;
240 field_ref
= (struct field_ref
*) op
->data
;
241 switch (field
->type
.type
) {
242 case lttng_kernel_type_integer
:
243 case lttng_kernel_type_enum_nestable
:
244 op
->op
= BYTECODE_OP_LOAD_FIELD_REF_S64
;
246 case lttng_kernel_type_array_nestable
:
248 const struct lttng_type
*elem_type
= field
->type
.u
.array_nestable
.elem_type
;
250 if (!lttng_is_bytewise_integer(elem_type
) || elem_type
->u
.integer
.encoding
== lttng_kernel_string_encoding_none
)
253 op
->op
= BYTECODE_OP_LOAD_FIELD_REF_USER_SEQUENCE
;
255 op
->op
= BYTECODE_OP_LOAD_FIELD_REF_SEQUENCE
;
258 case lttng_kernel_type_sequence_nestable
:
260 const struct lttng_type
*elem_type
= field
->type
.u
.sequence_nestable
.elem_type
;
262 if (!lttng_is_bytewise_integer(elem_type
) || elem_type
->u
.integer
.encoding
== lttng_kernel_string_encoding_none
)
265 op
->op
= BYTECODE_OP_LOAD_FIELD_REF_USER_SEQUENCE
;
267 op
->op
= BYTECODE_OP_LOAD_FIELD_REF_SEQUENCE
;
270 case lttng_kernel_type_string
:
272 op
->op
= BYTECODE_OP_LOAD_FIELD_REF_USER_STRING
;
274 op
->op
= BYTECODE_OP_LOAD_FIELD_REF_STRING
;
276 case lttng_kernel_type_struct_nestable
: /* Unsupported. */
277 case lttng_kernel_type_variant_nestable
: /* Unsupported. */
282 field_ref
->offset
= (uint16_t) field_offset
;
292 int apply_context_reloc(struct bytecode_runtime
*runtime
,
293 uint32_t runtime_len
,
294 uint32_t reloc_offset
,
295 const char *context_name
,
296 enum bytecode_op bytecode_op
)
299 struct lttng_ctx_field
*ctx_field
;
302 dbg_printk("Apply context reloc: %u %s\n", reloc_offset
, context_name
);
304 /* Get context index */
305 idx
= lttng_get_context_index(lttng_static_ctx
, context_name
);
309 /* Check if idx is too large for 16-bit offset */
310 if (idx
> LTTNG_KERNEL_FILTER_BYTECODE_MAX_LEN
- 1)
313 /* Get context return type */
314 ctx_field
= <tng_static_ctx
->fields
[idx
];
315 op
= (struct load_op
*) &runtime
->code
[reloc_offset
];
317 switch (bytecode_op
) {
318 case BYTECODE_OP_GET_CONTEXT_REF
:
320 struct field_ref
*field_ref
;
322 field_ref
= (struct field_ref
*) op
->data
;
323 switch (ctx_field
->event_field
.type
.type
) {
324 case lttng_kernel_type_integer
:
325 case lttng_kernel_type_enum_nestable
:
326 op
->op
= BYTECODE_OP_GET_CONTEXT_REF_S64
;
328 /* Sequence and array supported as string */
329 case lttng_kernel_type_string
:
330 BUG_ON(ctx_field
->event_field
.user
);
331 op
->op
= BYTECODE_OP_GET_CONTEXT_REF_STRING
;
333 case lttng_kernel_type_array_nestable
:
335 const struct lttng_type
*elem_type
= ctx_field
->event_field
.type
.u
.array_nestable
.elem_type
;
337 if (!lttng_is_bytewise_integer(elem_type
) || elem_type
->u
.integer
.encoding
== lttng_kernel_string_encoding_none
)
339 BUG_ON(ctx_field
->event_field
.user
);
340 op
->op
= BYTECODE_OP_GET_CONTEXT_REF_STRING
;
343 case lttng_kernel_type_sequence_nestable
:
345 const struct lttng_type
*elem_type
= ctx_field
->event_field
.type
.u
.sequence_nestable
.elem_type
;
347 if (!lttng_is_bytewise_integer(elem_type
) || elem_type
->u
.integer
.encoding
== lttng_kernel_string_encoding_none
)
349 BUG_ON(ctx_field
->event_field
.user
);
350 op
->op
= BYTECODE_OP_GET_CONTEXT_REF_STRING
;
353 case lttng_kernel_type_struct_nestable
: /* Unsupported. */
354 case lttng_kernel_type_variant_nestable
: /* Unsupported. */
358 /* set offset to context index within channel contexts */
359 field_ref
->offset
= (uint16_t) idx
;
369 int apply_reloc(const struct lttng_event_desc
*event_desc
,
370 struct bytecode_runtime
*runtime
,
371 uint32_t runtime_len
,
372 uint32_t reloc_offset
,
377 dbg_printk("Apply reloc: %u %s\n", reloc_offset
, name
);
379 /* Ensure that the reloc is within the code */
380 if (runtime_len
- reloc_offset
< sizeof(uint16_t))
383 op
= (struct load_op
*) &runtime
->code
[reloc_offset
];
385 case BYTECODE_OP_LOAD_FIELD_REF
:
386 return apply_field_reloc(event_desc
, runtime
, runtime_len
,
387 reloc_offset
, name
, op
->op
);
388 case BYTECODE_OP_GET_CONTEXT_REF
:
389 return apply_context_reloc(runtime
, runtime_len
,
390 reloc_offset
, name
, op
->op
);
391 case BYTECODE_OP_GET_SYMBOL
:
392 case BYTECODE_OP_GET_SYMBOL_FIELD
:
394 * Will be handled by load specialize phase or
395 * dynamically by interpreter.
399 printk(KERN_WARNING
"LTTng: filter: Unknown reloc op type %u\n", op
->op
);
406 int bytecode_is_linked(struct lttng_bytecode_node
*bytecode
,
407 struct list_head
*bytecode_runtime_head
)
409 struct lttng_bytecode_runtime
*bc_runtime
;
411 list_for_each_entry(bc_runtime
, bytecode_runtime_head
, node
) {
412 if (bc_runtime
->bc
== bytecode
)
419 * Take a bytecode with reloc table and link it to an event to create a
423 int link_bytecode(const struct lttng_event_desc
*event_desc
,
424 struct lttng_ctx
*ctx
,
425 struct lttng_bytecode_node
*bytecode
,
426 struct list_head
*bytecode_runtime_head
,
427 struct list_head
*insert_loc
)
429 int ret
, offset
, next_offset
;
430 struct bytecode_runtime
*runtime
= NULL
;
431 size_t runtime_alloc_len
;
435 /* Bytecode already linked */
436 if (bytecode_is_linked(bytecode
, bytecode_runtime_head
))
439 dbg_printk("Linking...\n");
441 /* We don't need the reloc table in the runtime */
442 runtime_alloc_len
= sizeof(*runtime
) + bytecode
->bc
.reloc_offset
;
443 runtime
= kzalloc(runtime_alloc_len
, GFP_KERNEL
);
448 runtime
->p
.bc
= bytecode
;
449 runtime
->p
.ctx
= ctx
;
450 runtime
->len
= bytecode
->bc
.reloc_offset
;
451 /* copy original bytecode */
452 memcpy(runtime
->code
, bytecode
->bc
.data
, runtime
->len
);
454 * apply relocs. Those are a uint16_t (offset in bytecode)
455 * followed by a string (field name).
457 for (offset
= bytecode
->bc
.reloc_offset
;
458 offset
< bytecode
->bc
.len
;
459 offset
= next_offset
) {
460 uint16_t reloc_offset
=
461 *(uint16_t *) &bytecode
->bc
.data
[offset
];
463 (const char *) &bytecode
->bc
.data
[offset
+ sizeof(uint16_t)];
465 ret
= apply_reloc(event_desc
, runtime
, runtime
->len
, reloc_offset
, name
);
469 next_offset
= offset
+ sizeof(uint16_t) + strlen(name
) + 1;
471 /* Validate bytecode */
472 ret
= lttng_bytecode_validate(runtime
);
476 /* Specialize bytecode */
477 ret
= lttng_bytecode_specialize(event_desc
, runtime
);
482 switch (bytecode
->type
) {
483 case LTTNG_BYTECODE_NODE_TYPE_FILTER
:
484 runtime
->p
.interpreter_funcs
.filter
= lttng_bytecode_filter_interpret
;
486 case LTTNG_BYTECODE_NODE_TYPE_CAPTURE
:
487 runtime
->p
.interpreter_funcs
.capture
= lttng_bytecode_capture_interpret_false
;
493 runtime
->p
.link_failed
= 0;
494 list_add_rcu(&runtime
->p
.node
, insert_loc
);
495 dbg_printk("Linking successful.\n");
500 switch (bytecode
->type
) {
501 case LTTNG_BYTECODE_NODE_TYPE_FILTER
:
502 runtime
->p
.interpreter_funcs
.filter
= lttng_bytecode_filter_interpret_false
;
504 case LTTNG_BYTECODE_NODE_TYPE_CAPTURE
:
505 runtime
->p
.interpreter_funcs
.capture
= lttng_bytecode_capture_interpret_false
;
510 runtime
->p
.link_failed
= 1;
511 list_add_rcu(&runtime
->p
.node
, insert_loc
);
513 dbg_printk("Linking failed.\n");
517 void lttng_bytecode_filter_sync_state(struct lttng_bytecode_runtime
*runtime
)
519 struct lttng_bytecode_node
*bc
= runtime
->bc
;
521 if (!bc
->enabler
->enabled
|| runtime
->link_failed
)
522 runtime
->interpreter_funcs
.filter
= lttng_bytecode_filter_interpret_false
;
524 runtime
->interpreter_funcs
.filter
= lttng_bytecode_filter_interpret
;
527 void lttng_bytecode_capture_sync_state(struct lttng_bytecode_runtime
*runtime
)
529 struct lttng_bytecode_node
*bc
= runtime
->bc
;
531 if (!bc
->enabler
->enabled
|| runtime
->link_failed
)
532 runtime
->interpreter_funcs
.capture
= lttng_bytecode_capture_interpret_false
;
534 runtime
->interpreter_funcs
.capture
= lttng_bytecode_capture_interpret
;
538 * Given the lists of bytecode programs of an instance (event or event
539 * notifier) and of a matching enabler, try to link all the enabler's bytecode
540 * programs with the instance.
542 * This function is called after we confirmed that name enabler and the
543 * instance are matching names (or glob pattern matching).
545 void lttng_enabler_link_bytecode(const struct lttng_event_desc
*event_desc
,
546 struct lttng_ctx
*ctx
,
547 struct list_head
*instance_bytecode_head
,
548 struct list_head
*enabler_bytecode_head
)
550 struct lttng_bytecode_node
*enabler_bc
;
551 struct lttng_bytecode_runtime
*runtime
;
553 WARN_ON_ONCE(!event_desc
);
555 /* Go over all the bytecode programs of the enabler. */
556 list_for_each_entry(enabler_bc
, enabler_bytecode_head
, node
) {
558 struct list_head
*insert_loc
;
561 * Check if the current enabler bytecode program is already
562 * linked with the instance.
564 list_for_each_entry(runtime
, instance_bytecode_head
, node
) {
565 if (runtime
->bc
== enabler_bc
) {
572 * Skip bytecode already linked, go to the next enabler
579 * Insert at specified priority (seqnum) in increasing
580 * order. If there already is a bytecode of the same priority,
581 * insert the new bytecode right after it.
583 list_for_each_entry_reverse(runtime
,
584 instance_bytecode_head
, node
) {
585 if (runtime
->bc
->bc
.seqnum
<= enabler_bc
->bc
.seqnum
) {
587 insert_loc
= &runtime
->node
;
591 /* Add to head to list */
592 insert_loc
= instance_bytecode_head
;
594 dbg_printk("linking bytecode\n");
595 ret
= link_bytecode(event_desc
, ctx
, enabler_bc
, instance_bytecode_head
, insert_loc
);
597 dbg_printk("[lttng filter] warning: cannot link event bytecode\n");
603 * We own the filter_bytecode if we return success.
605 int lttng_filter_enabler_attach_bytecode(struct lttng_enabler
*enabler
,
606 struct lttng_bytecode_node
*filter_bytecode
)
608 list_add(&filter_bytecode
->node
, &enabler
->filter_bytecode_head
);
612 void lttng_free_enabler_filter_bytecode(struct lttng_enabler
*enabler
)
614 struct lttng_bytecode_node
*filter_bytecode
, *tmp
;
616 list_for_each_entry_safe(filter_bytecode
, tmp
,
617 &enabler
->filter_bytecode_head
, node
) {
618 kfree(filter_bytecode
);
622 void lttng_free_event_filter_runtime(struct lttng_event
*event
)
624 struct bytecode_runtime
*runtime
, *tmp
;
626 list_for_each_entry_safe(runtime
, tmp
,
627 &event
->filter_bytecode_runtime_head
, p
.node
) {
628 kfree(runtime
->data
);
633 void lttng_free_event_notifier_filter_runtime(struct lttng_event_notifier
*event_notifier
)
635 struct bytecode_runtime
*runtime
, *tmp
;
637 list_for_each_entry_safe(runtime
, tmp
,
638 &event_notifier
->filter_bytecode_runtime_head
, p
.node
) {
639 kfree(runtime
->data
);