X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-ust-dynamic-type.c;h=6913ca4b1d1877a82844abaa70eeb46acb60a7ba;hb=864a1eda22ed99266509ac76451c6f27f91aa17e;hp=488cf8156cba55587a4b391137ef57c90ec4abc0;hpb=a6f80644ef276de19ba7e018659070b7504d7ca4;p=lttng-ust.git diff --git a/liblttng-ust/lttng-ust-dynamic-type.c b/liblttng-ust/lttng-ust-dynamic-type.c index 488cf815..6913ca4b 100644 --- a/liblttng-ust/lttng-ust-dynamic-type.c +++ b/liblttng-ust/lttng-ust-dynamic-type.c @@ -1,33 +1,19 @@ /* - * lttng-ust-dynamic-type.c - * - * UST dynamic type implementation. + * SPDX-License-Identifier: LGPL-2.1-only * * Copyright (C) 2016 Mathieu Desnoyers * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; only - * version 2.1 of the License. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * UST dynamic type implementation. */ -#define _GNU_SOURCE +#define _LGPL_SOURCE #include #include #include #include -#include -#include +#include +#include #define ctf_enum_value(_string, _value) \ { \ @@ -69,8 +55,9 @@ const struct lttng_event_field dt_var_fields[_NR_LTTNG_UST_DYNAMIC_TYPES] = { [LTTNG_UST_DYNAMIC_TYPE_NONE] = { .name = "none", .type = { - .atype = atype_struct, - .u._struct.nr_fields = 0, /* empty struct. */ + .atype = atype_struct_nestable, + .u.struct_nestable.nr_fields = 0, /* empty struct. */ + .u.struct_nestable.alignment = 0, }, .nowrite = 0, }, @@ -128,7 +115,7 @@ const struct lttng_event_field dt_var_fields[_NR_LTTNG_UST_DYNAMIC_TYPES] = { .name = "string", .type = { .atype = atype_string, - .u.basic.string.encoding = lttng_encode_UTF8, + .u.string.encoding = lttng_encode_UTF8, }, .nowrite = 0, }, @@ -136,16 +123,11 @@ const struct lttng_event_field dt_var_fields[_NR_LTTNG_UST_DYNAMIC_TYPES] = { static const struct lttng_event_field dt_enum_field = { .name = NULL, - .type.atype = atype_enum, - .type.u.basic.enumeration.desc = &dt_enum_desc, - .type.u.basic.enumeration.container_type = { - .size = sizeof(char) * CHAR_BIT, - .alignment = lttng_alignof(char) * CHAR_BIT, - .signedness = lttng_is_signed_type(char), - .reverse_byte_order = 0, - .base = 10, - .encoding = lttng_encode_none, - }, + .type.atype = atype_enum_nestable, + .type.u.enum_nestable.desc = &dt_enum_desc, + .type.u.enum_nestable.container_type = + __LTTNG_COMPOUND_LITERAL(struct lttng_type, + __type_integer(char, BYTE_ORDER, 10, none)), .nowrite = 0, };