2 * Copyright (C) 2020 Philippe Proulx <pproulx@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_EVENT_EXPR_INTERNAL_H
9 #define LTTNG_EVENT_EXPR_INTERNAL_H
11 #include <common/macros.h>
12 #include <lttng/event-expr.h>
14 struct lttng_bytecode
;
17 struct lttng_event_expr
{
18 enum lttng_event_expr_type type
;
22 * `LTTNG_EVENT_EXPR_TYPE_EVENT_PAYLOAD_FIELD` and
23 * `LTTNG_EVENT_EXPR_TYPE_CHANNEL_CONTEXT_FIELD`.
25 struct lttng_event_expr_field
{
26 struct lttng_event_expr parent
;
30 /* `LTTNG_EVENT_EXPR_TYPE_APP_SPECIFIC_CONTEXT_FIELD` */
31 struct lttng_event_expr_app_specific_context_field
{
32 struct lttng_event_expr parent
;
37 /* `LTTNG_EVENT_EXPR_TYPE_ARRAY_FIELD_ELEMENT` */
38 struct lttng_event_expr_array_field_element
{
39 struct lttng_event_expr parent
;
42 struct lttng_event_expr
*array_field_expr
;
48 * Returns whether or not `expr` is an l-value (locator value).
51 bool lttng_event_expr_is_lvalue(const struct lttng_event_expr
*expr
)
54 return expr
->type
== LTTNG_EVENT_EXPR_TYPE_EVENT_PAYLOAD_FIELD
||
55 expr
->type
== LTTNG_EVENT_EXPR_TYPE_CHANNEL_CONTEXT_FIELD
||
56 expr
->type
== LTTNG_EVENT_EXPR_TYPE_APP_SPECIFIC_CONTEXT_FIELD
||
57 expr
->type
== LTTNG_EVENT_EXPR_TYPE_ARRAY_FIELD_ELEMENT
;
61 int lttng_event_expr_to_bytecode(const struct lttng_event_expr
*expr
,
62 struct lttng_bytecode
**bytecode_out
);
65 enum lttng_error_code
lttng_event_expr_mi_serialize(
66 const struct lttng_event_expr
*expression
,
67 struct mi_writer
*writer
);
69 #endif /* LTTNG_EVENT_EXPR_INTERNAL_H */