X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-bytecode.h;h=04dd2520205e47c8e570b3c8b08e55bd286b9d72;hb=89080a4901917de0c71df6590a5a8ee53fd9d6ad;hp=4f1b88f1aa92a21ccda3d337eaebf631aebef14a;hpb=04aa13f8c2944839f6514e3841b93057b443a783;p=lttng-ust.git diff --git a/liblttng-ust/lttng-bytecode.h b/liblttng-ust/lttng-bytecode.h index 4f1b88f1..04dd2520 100644 --- a/liblttng-ust/lttng-bytecode.h +++ b/liblttng-ust/lttng-bytecode.h @@ -1,38 +1,20 @@ -#ifndef _LTTNG_BYTECODE_H -#define _LTTNG_BYTECODE_H - /* - * lttng-bytecode.h - * - * LTTng UST bytecode header. + * SPDX-License-Identifier: MIT * * Copyright (C) 2010-2016 Mathieu Desnoyers * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * LTTng UST bytecode header. */ +#ifndef _LTTNG_BYTECODE_H +#define _LTTNG_BYTECODE_H + #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -77,7 +59,7 @@ do { \ /* Linked bytecode. Child of struct lttng_bytecode_runtime. */ struct bytecode_runtime { - struct lttng_bytecode_runtime p; + struct lttng_ust_bytecode_runtime p; size_t data_len; size_t data_alloc_len; char *data; @@ -112,6 +94,9 @@ enum object_type { OBJECT_TYPE_U32, OBJECT_TYPE_U64, + OBJECT_TYPE_SIGNED_ENUM, + OBJECT_TYPE_UNSIGNED_ENUM, + OBJECT_TYPE_DOUBLE, OBJECT_TYPE_STRING, OBJECT_TYPE_STRING_SEQUENCE, @@ -134,7 +119,7 @@ struct bytecode_get_index_data { * interpreter needs to find it from the event fields and types to * support variants. */ - const struct lttng_event_field *field; + struct lttng_ust_event_field *field; struct { size_t len; enum object_type type; @@ -146,7 +131,7 @@ struct bytecode_get_index_data { struct vstack_load { enum load_type type; enum object_type object_type; - const struct lttng_event_field *field; + struct lttng_ust_event_field *field; bool rev_bo; /* reverse byte order */ }; @@ -223,7 +208,7 @@ struct load_ptr { uint64_t u64; double d; } u; - const struct lttng_event_field *field; + const struct lttng_ust_event_field *field; }; struct estack_entry { @@ -324,20 +309,43 @@ struct lttng_interpreter_output { size_t nr_elem; /* Inner type. */ - const struct lttng_type *nested_type; + struct lttng_ust_type_common *nested_type; } sequence; } u; }; -const char *print_op(enum bytecode_op op); +__attribute__((visibility("hidden"))) +const char *lttng_bytecode_print_op(enum bytecode_op op); + +__attribute__((visibility("hidden"))) +void lttng_bytecode_filter_sync_state(struct lttng_ust_bytecode_runtime *runtime); + +__attribute__((visibility("hidden"))) +void lttng_bytecode_capture_sync_state(struct lttng_ust_bytecode_runtime *runtime); +__attribute__((visibility("hidden"))) int lttng_bytecode_validate(struct bytecode_runtime *bytecode); -int lttng_bytecode_specialize(const struct lttng_event_desc *event_desc, + +__attribute__((visibility("hidden"))) +int lttng_bytecode_specialize(struct lttng_ust_event_desc *event_desc, struct bytecode_runtime *bytecode); +__attribute__((visibility("hidden"))) uint64_t lttng_bytecode_filter_interpret_false(void *filter_data, const char *filter_stack_data); + +__attribute__((visibility("hidden"))) uint64_t lttng_bytecode_filter_interpret(void *filter_data, const char *filter_stack_data); +__attribute__((visibility("hidden"))) +uint64_t lttng_bytecode_capture_interpret_false(void *capture_data, + const char *capture_stack_data, + struct lttng_interpreter_output *output); + +__attribute__((visibility("hidden"))) +uint64_t lttng_bytecode_capture_interpret(void *capture_data, + const char *capture_stack_data, + struct lttng_interpreter_output *output); + #endif /* _LTTNG_BYTECODE_H */