X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=liblttng-ust%2Flttng-bytecode-specialize.c;h=2bbcb197a22076bc5d4791e21c025d2bccd2e249;hb=472b4adfd5a39691fe179a2c1d00988d5f32ab70;hp=55b2ebf221687be36d8c4f306b8e85b8a2cbd70c;hpb=04aa13f8c2944839f6514e3841b93057b443a783;p=lttng-ust.git diff --git a/liblttng-ust/lttng-bytecode-specialize.c b/liblttng-ust/lttng-bytecode-specialize.c index 55b2ebf2..2bbcb197 100644 --- a/liblttng-ust/lttng-bytecode-specialize.c +++ b/liblttng-ust/lttng-bytecode-specialize.c @@ -1,35 +1,19 @@ /* - * lttng-bytecode-specialize.c - * - * LTTng UST bytecode specializer. + * 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 specializer. */ #define _LGPL_SOURCE #include #include -#include "lttng-bytecode.h" #include + +#include "context-internal.h" +#include "lttng-bytecode.h" #include "ust-events-internal.h" static int lttng_fls(int val) @@ -155,6 +139,10 @@ static int specialize_load_field(struct vstack_entry *stack_top, if (!stack_top->load.rev_bo) insn->op = BYTECODE_OP_LOAD_FIELD_S64; break; + case OBJECT_TYPE_SIGNED_ENUM: + dbg_printf("op load field signed enumeration\n"); + stack_top->type = REG_PTR; + break; case OBJECT_TYPE_U8: dbg_printf("op load field u8\n"); stack_top->type = REG_U64; @@ -178,6 +166,10 @@ static int specialize_load_field(struct vstack_entry *stack_top, if (!stack_top->load.rev_bo) insn->op = BYTECODE_OP_LOAD_FIELD_U64; break; + case OBJECT_TYPE_UNSIGNED_ENUM: + dbg_printf("op load field unsigned enumeration\n"); + stack_top->type = REG_PTR; + break; case OBJECT_TYPE_DOUBLE: stack_top->type = REG_DOUBLE; insn->op = BYTECODE_OP_LOAD_FIELD_DOUBLE; @@ -416,9 +408,9 @@ static int specialize_load_object(const struct lttng_event_field *field, itype = &field->type.u.enum_nestable.container_type->u.integer; } if (itype->signedness) - load->object_type = OBJECT_TYPE_S64; + load->object_type = OBJECT_TYPE_SIGNED_ENUM; else - load->object_type = OBJECT_TYPE_U64; + load->object_type = OBJECT_TYPE_UNSIGNED_ENUM; load->rev_bo = false; break; }