1 // SPDX-License-Identifier: MIT
3 * Copyright 2022 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
13 #include <side/trace.h>
15 /* User code example */
17 side_static_event(my_provider_event
, "myprovider", "myevent", SIDE_LOGLEVEL_DEBUG
,
19 side_field_u32("abc"),
20 side_field_s64("def"),
21 side_field_pointer("ptr"),
22 side_field_dynamic("dynamic"),
23 side_field_dynamic("dynamic_pointer"),
24 side_field_null("null"),
29 void test_fields(void)
34 side_event(my_provider_event
,
38 side_arg_pointer((void *) 0x1),
39 side_arg_dynamic_string("zzz"),
40 side_arg_dynamic_pointer((void *) 0x1),
46 side_hidden_event(my_provider_event_hidden
, "myprovider", "myeventhidden", SIDE_LOGLEVEL_DEBUG
,
48 side_field_u32("abc"),
53 void test_event_hidden(void)
55 side_event(my_provider_event_hidden
, side_arg_list(side_arg_u32(2)));
58 side_declare_event(my_provider_event_export
);
60 side_export_event(my_provider_event_export
, "myprovider", "myeventexport", SIDE_LOGLEVEL_DEBUG
,
62 side_field_u32("abc"),
67 void test_event_export(void)
69 side_event(my_provider_event_export
, side_arg_list(side_arg_u32(2)));
72 side_static_event(my_provider_event_struct_literal
, "myprovider", "myeventstructliteral", SIDE_LOGLEVEL_DEBUG
,
74 side_field_struct("structliteral",
87 void test_struct_literal(void)
89 side_event_cond(my_provider_event_struct_literal
) {
90 side_arg_define_vec(mystruct
, side_arg_list(side_arg_u32(21), side_arg_s64(22)));
91 side_event_call(my_provider_event_struct_literal
, side_arg_list(side_arg_struct(&mystruct
), side_arg_u8(55)));
95 static side_define_struct(mystructdef
,
102 side_static_event(my_provider_event_struct
, "myprovider", "myeventstruct", SIDE_LOGLEVEL_DEBUG
,
104 side_field_struct("struct", &mystructdef
),
110 void test_struct(void)
112 side_event_cond(my_provider_event_struct
) {
113 side_arg_define_vec(mystruct
, side_arg_list(side_arg_u32(21), side_arg_s64(22)));
114 side_event_call(my_provider_event_struct
, side_arg_list(side_arg_struct(&mystruct
), side_arg_u8(55)));
118 side_static_event(my_provider_event_array
, "myprovider", "myarray", SIDE_LOGLEVEL_DEBUG
,
120 side_field_array("arr", side_elem(side_type_u32()), 3),
126 void test_array(void)
128 side_event_cond(my_provider_event_array
) {
129 side_arg_define_vec(myarray
, side_arg_list(side_arg_u32(1), side_arg_u32(2), side_arg_u32(3)));
130 side_event_call(my_provider_event_array
, side_arg_list(side_arg_array(&myarray
), side_arg_s64(42)));
134 side_static_event(my_provider_event_vla
, "myprovider", "myvla", SIDE_LOGLEVEL_DEBUG
,
136 side_field_vla("vla", side_elem(side_type_u32()), side_elem(side_type_u32())),
144 side_event_cond(my_provider_event_vla
) {
145 side_arg_define_vec(myvla
, side_arg_list(side_arg_u32(1), side_arg_u32(2), side_arg_u32(3)));
146 side_event_call(my_provider_event_vla
, side_arg_list(side_arg_vla(&myvla
), side_arg_s64(42)));
150 /* 1D array visitor */
152 struct app_visitor_ctx
{
158 enum side_visitor_status
test_visitor(const struct side_tracer_visitor_ctx
*tracer_ctx
, void *_ctx
)
160 struct app_visitor_ctx
*ctx
= (struct app_visitor_ctx
*) _ctx
;
161 uint32_t length
= ctx
->length
, i
;
163 for (i
= 0; i
< length
; i
++) {
164 const struct side_arg elem
= side_arg_u32(ctx
->ptr
[i
]);
166 if (tracer_ctx
->write_elem(tracer_ctx
, &elem
) != SIDE_VISITOR_STATUS_OK
)
167 return SIDE_VISITOR_STATUS_ERROR
;
169 return SIDE_VISITOR_STATUS_OK
;
172 static uint32_t testarray
[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
174 side_static_event(my_provider_event_vla_visitor
, "myprovider", "myvlavisit", SIDE_LOGLEVEL_DEBUG
,
176 side_field_vla_visitor("vlavisit",
177 side_vla_visitor_literal(
178 side_elem(side_type_u32()),
179 side_elem(side_type_u32()),
188 void test_vla_visitor(void)
190 side_event_cond(my_provider_event_vla_visitor
) {
191 struct app_visitor_ctx ctx
= {
193 .length
= SIDE_ARRAY_SIZE(testarray
),
195 side_arg_define_vla_visitor(side_visitor
, &ctx
);
196 side_event_call(my_provider_event_vla_visitor
,
197 side_arg_list(side_arg_vla_visitor(&side_visitor
), side_arg_s64(42)));
201 /* 2D array visitor */
203 struct app_visitor_2d_inner_ctx
{
209 enum side_visitor_status
test_inner_visitor(const struct side_tracer_visitor_ctx
*tracer_ctx
, void *_ctx
)
211 struct app_visitor_2d_inner_ctx
*ctx
= (struct app_visitor_2d_inner_ctx
*) _ctx
;
212 uint32_t length
= ctx
->length
, i
;
214 for (i
= 0; i
< length
; i
++) {
215 const struct side_arg elem
= side_arg_u32(ctx
->ptr
[i
]);
217 if (tracer_ctx
->write_elem(tracer_ctx
, &elem
) != SIDE_VISITOR_STATUS_OK
)
218 return SIDE_VISITOR_STATUS_ERROR
;
220 return SIDE_VISITOR_STATUS_OK
;
223 struct app_visitor_2d_outer_ctx
{
224 const uint32_t (*ptr
)[2];
229 enum side_visitor_status
test_outer_visitor(const struct side_tracer_visitor_ctx
*tracer_ctx
, void *_ctx
)
231 struct app_visitor_2d_outer_ctx
*ctx
= (struct app_visitor_2d_outer_ctx
*) _ctx
;
232 uint32_t length
= ctx
->length
, i
;
234 for (i
= 0; i
< length
; i
++) {
235 struct app_visitor_2d_inner_ctx inner_ctx
= {
239 side_arg_define_vla_visitor(side_inner_visitor
, &inner_ctx
);
240 const struct side_arg elem
= side_arg_vla_visitor(&side_inner_visitor
);
241 if (tracer_ctx
->write_elem(tracer_ctx
, &elem
) != SIDE_VISITOR_STATUS_OK
)
242 return SIDE_VISITOR_STATUS_ERROR
;
244 return SIDE_VISITOR_STATUS_OK
;
247 static uint32_t testarray2d
[][2] = {
253 side_static_event(my_provider_event_vla_visitor2d
, "myprovider", "myvlavisit2d", SIDE_LOGLEVEL_DEBUG
,
255 side_field_vla_visitor("vlavisit2d",
256 side_vla_visitor_literal(
258 side_type_vla_visitor(
259 side_vla_visitor_literal(
260 side_elem(side_type_u32()),
261 side_elem(side_type_u32()),
266 side_elem(side_type_u32()),
275 void test_vla_visitor_2d(void)
277 side_event_cond(my_provider_event_vla_visitor2d
) {
278 struct app_visitor_2d_outer_ctx ctx
= {
280 .length
= SIDE_ARRAY_SIZE(testarray2d
),
282 side_arg_define_vla_visitor(side_outer_visitor
, &ctx
);
283 side_event_call(my_provider_event_vla_visitor2d
,
284 side_arg_list(side_arg_vla_visitor(&side_outer_visitor
), side_arg_s64(42)));
288 side_static_event(my_provider_event_dynamic_basic
,
289 "myprovider", "mydynamicbasic", SIDE_LOGLEVEL_DEBUG
,
291 side_field_dynamic("dynamic"),
296 void test_dynamic_basic_type(void)
298 side_event(my_provider_event_dynamic_basic
,
299 side_arg_list(side_arg_dynamic_s16(-33)));
302 side_static_event(my_provider_event_dynamic_vla
,
303 "myprovider", "mydynamicvla", SIDE_LOGLEVEL_DEBUG
,
305 side_field_dynamic("dynamic"),
310 void test_dynamic_vla(void)
312 side_arg_dynamic_define_vec(myvla
,
314 side_arg_dynamic_u32(1),
315 side_arg_dynamic_u32(2),
316 side_arg_dynamic_u32(3),
319 side_event(my_provider_event_dynamic_vla
,
320 side_arg_list(side_arg_dynamic_vla(&myvla
)));
323 side_static_event(my_provider_event_dynamic_null
,
324 "myprovider", "mydynamicnull", SIDE_LOGLEVEL_DEBUG
,
326 side_field_dynamic("dynamic"),
331 void test_dynamic_null(void)
333 side_event(my_provider_event_dynamic_null
,
334 side_arg_list(side_arg_dynamic_null()));
337 side_static_event(my_provider_event_dynamic_struct
,
338 "myprovider", "mydynamicstruct", SIDE_LOGLEVEL_DEBUG
,
340 side_field_dynamic("dynamic"),
345 void test_dynamic_struct(void)
347 side_arg_dynamic_define_struct(mystruct
,
349 side_arg_dynamic_field("a", side_arg_dynamic_u32(43)),
350 side_arg_dynamic_field("b", side_arg_dynamic_string("zzz")),
351 side_arg_dynamic_field("c", side_arg_dynamic_null()),
355 side_event(my_provider_event_dynamic_struct
,
356 side_arg_list(side_arg_dynamic_struct(&mystruct
)));
359 side_static_event(my_provider_event_dynamic_nested_struct
,
360 "myprovider", "mydynamicnestedstruct", SIDE_LOGLEVEL_DEBUG
,
362 side_field_dynamic("dynamic"),
367 void test_dynamic_nested_struct(void)
369 side_arg_dynamic_define_struct(nested
,
371 side_arg_dynamic_field("a", side_arg_dynamic_u32(43)),
372 side_arg_dynamic_field("b", side_arg_dynamic_u8(55)),
375 side_arg_dynamic_define_struct(nested2
,
377 side_arg_dynamic_field("aa", side_arg_dynamic_u64(128)),
378 side_arg_dynamic_field("bb", side_arg_dynamic_u16(1)),
381 side_arg_dynamic_define_struct(mystruct
,
383 side_arg_dynamic_field("nested", side_arg_dynamic_struct(&nested
)),
384 side_arg_dynamic_field("nested2", side_arg_dynamic_struct(&nested2
)),
387 side_event(my_provider_event_dynamic_nested_struct
,
388 side_arg_list(side_arg_dynamic_struct(&mystruct
)));
391 side_static_event(my_provider_event_dynamic_vla_struct
,
392 "myprovider", "mydynamicvlastruct", SIDE_LOGLEVEL_DEBUG
,
394 side_field_dynamic("dynamic"),
399 void test_dynamic_vla_struct(void)
401 side_arg_dynamic_define_struct(nested
,
403 side_arg_dynamic_field("a", side_arg_dynamic_u32(43)),
404 side_arg_dynamic_field("b", side_arg_dynamic_u8(55)),
407 side_arg_dynamic_define_vec(myvla
,
409 side_arg_dynamic_struct(&nested
),
410 side_arg_dynamic_struct(&nested
),
411 side_arg_dynamic_struct(&nested
),
412 side_arg_dynamic_struct(&nested
),
415 side_event(my_provider_event_dynamic_vla_struct
,
416 side_arg_list(side_arg_dynamic_vla(&myvla
)));
419 side_static_event(my_provider_event_dynamic_struct_vla
,
420 "myprovider", "mydynamicstructvla", SIDE_LOGLEVEL_DEBUG
,
422 side_field_dynamic("dynamic"),
427 void test_dynamic_struct_vla(void)
429 side_arg_dynamic_define_vec(myvla
,
431 side_arg_dynamic_u32(1),
432 side_arg_dynamic_u32(2),
433 side_arg_dynamic_u32(3),
436 side_arg_dynamic_define_vec(myvla2
,
438 side_arg_dynamic_u32(4),
439 side_arg_dynamic_u64(5),
440 side_arg_dynamic_u32(6),
443 side_arg_dynamic_define_struct(mystruct
,
445 side_arg_dynamic_field("a", side_arg_dynamic_vla(&myvla
)),
446 side_arg_dynamic_field("b", side_arg_dynamic_vla(&myvla2
)),
449 side_event(my_provider_event_dynamic_struct_vla
,
450 side_arg_list(side_arg_dynamic_struct(&mystruct
)));
453 side_static_event(my_provider_event_dynamic_nested_vla
,
454 "myprovider", "mydynamicnestedvla", SIDE_LOGLEVEL_DEBUG
,
456 side_field_dynamic("dynamic"),
461 void test_dynamic_nested_vla(void)
463 side_arg_dynamic_define_vec(nestedvla
,
465 side_arg_dynamic_u32(1),
466 side_arg_dynamic_u16(2),
467 side_arg_dynamic_u32(3),
470 side_arg_dynamic_define_vec(nestedvla2
,
472 side_arg_dynamic_u8(4),
473 side_arg_dynamic_u32(5),
474 side_arg_dynamic_u32(6),
477 side_arg_dynamic_define_vec(myvla
,
479 side_arg_dynamic_vla(&nestedvla
),
480 side_arg_dynamic_vla(&nestedvla2
),
483 side_event(my_provider_event_dynamic_nested_vla
,
484 side_arg_list(side_arg_dynamic_vla(&myvla
)));
487 side_static_event_variadic(my_provider_event_variadic
,
488 "myprovider", "myvariadicevent", SIDE_LOGLEVEL_DEBUG
,
493 void test_variadic(void)
495 side_event_variadic(my_provider_event_variadic
,
498 side_arg_dynamic_field("a", side_arg_dynamic_u32(55)),
499 side_arg_dynamic_field("b", side_arg_dynamic_s8(-4)),
504 side_static_event_variadic(my_provider_event_static_variadic
,
505 "myprovider", "mystaticvariadicevent", SIDE_LOGLEVEL_DEBUG
,
507 side_field_u32("abc"),
508 side_field_u16("def"),
513 void test_static_variadic(void)
515 side_event_variadic(my_provider_event_static_variadic
,
521 side_arg_dynamic_field("a", side_arg_dynamic_u32(55)),
522 side_arg_dynamic_field("b", side_arg_dynamic_s8(-4)),
527 side_static_event(my_provider_event_bool
, "myprovider", "myeventbool", SIDE_LOGLEVEL_DEBUG
,
529 side_field_bool("a_false"),
530 side_field_bool("b_true"),
531 side_field_bool("c_true"),
532 side_field_bool("d_true"),
533 side_field_bool("e_true"),
534 side_field_bool("f_false"),
535 side_field_bool("g_true"),
544 uint64_t c
= 0x12345678;
550 side_event(my_provider_event_bool
,
563 side_static_event_variadic(my_provider_event_dynamic_bool
,
564 "myprovider", "mydynamicbool", SIDE_LOGLEVEL_DEBUG
,
569 void test_dynamic_bool(void)
571 side_event_variadic(my_provider_event_dynamic_bool
,
574 side_arg_dynamic_field("a_true", side_arg_dynamic_bool(55)),
575 side_arg_dynamic_field("b_true", side_arg_dynamic_bool(-4)),
576 side_arg_dynamic_field("c_false", side_arg_dynamic_bool(0)),
577 side_arg_dynamic_field("d_true", side_arg_dynamic_bool(256)),
582 side_static_event(my_provider_event_dynamic_vla_visitor
,
583 "myprovider", "mydynamicvlavisitor", SIDE_LOGLEVEL_DEBUG
,
585 side_field_dynamic("dynamic"),
589 struct app_dynamic_vla_visitor_ctx
{
595 enum side_visitor_status
test_dynamic_vla_visitor(const struct side_tracer_visitor_ctx
*tracer_ctx
, void *_ctx
)
597 struct app_dynamic_vla_visitor_ctx
*ctx
= (struct app_dynamic_vla_visitor_ctx
*) _ctx
;
598 uint32_t length
= ctx
->length
, i
;
600 for (i
= 0; i
< length
; i
++) {
601 const struct side_arg elem
= side_arg_dynamic_u32(ctx
->ptr
[i
]);
602 if (tracer_ctx
->write_elem(tracer_ctx
, &elem
) != SIDE_VISITOR_STATUS_OK
)
603 return SIDE_VISITOR_STATUS_ERROR
;
605 return SIDE_VISITOR_STATUS_OK
;
608 static uint32_t testarray_dynamic_vla
[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
611 void test_dynamic_vla_with_visitor(void)
613 side_event_cond(my_provider_event_dynamic_vla_visitor
) {
614 struct app_dynamic_vla_visitor_ctx ctx
= {
615 .ptr
= testarray_dynamic_vla
,
616 .length
= SIDE_ARRAY_SIZE(testarray_dynamic_vla
),
618 side_arg_dynamic_define_vla_visitor(myvlavisitor
, test_dynamic_vla_visitor
, &ctx
);
619 side_event_call(my_provider_event_dynamic_vla_visitor
,
621 side_arg_dynamic_vla_visitor(&myvlavisitor
)
627 side_static_event(my_provider_event_dynamic_struct_visitor
,
628 "myprovider", "mydynamicstructvisitor", SIDE_LOGLEVEL_DEBUG
,
630 side_field_dynamic("dynamic"),
634 struct struct_visitor_pair
{
639 struct app_dynamic_struct_visitor_ctx
{
640 const struct struct_visitor_pair
*ptr
;
645 enum side_visitor_status
test_dynamic_struct_visitor(const struct side_tracer_dynamic_struct_visitor_ctx
*tracer_ctx
, void *_ctx
)
647 struct app_dynamic_struct_visitor_ctx
*ctx
= (struct app_dynamic_struct_visitor_ctx
*) _ctx
;
648 uint32_t length
= ctx
->length
, i
;
650 for (i
= 0; i
< length
; i
++) {
651 struct side_arg_dynamic_field dynamic_field
=
652 side_arg_dynamic_field(ctx
->ptr
[i
].name
,
653 side_arg_dynamic_u32(ctx
->ptr
[i
].value
));
654 if (tracer_ctx
->write_field(tracer_ctx
, &dynamic_field
) != SIDE_VISITOR_STATUS_OK
)
655 return SIDE_VISITOR_STATUS_ERROR
;
657 return SIDE_VISITOR_STATUS_OK
;
660 static struct struct_visitor_pair testarray_dynamic_struct
[] = {
668 void test_dynamic_struct_with_visitor(void)
670 side_event_cond(my_provider_event_dynamic_struct_visitor
) {
671 struct app_dynamic_struct_visitor_ctx ctx
= {
672 .ptr
= testarray_dynamic_struct
,
673 .length
= SIDE_ARRAY_SIZE(testarray_dynamic_struct
),
675 side_arg_dynamic_define_struct_visitor(mystructvisitor
, test_dynamic_struct_visitor
, &ctx
);
676 side_event_call(my_provider_event_dynamic_struct_visitor
,
678 side_arg_dynamic_struct_visitor(&mystructvisitor
)
684 side_static_event(my_provider_event_user_attribute
, "myprovider", "myevent_user_attribute", SIDE_LOGLEVEL_DEBUG
,
686 side_field_u32("abc"),
687 side_field_s64("def"),
690 side_attr("user_attribute_a", side_attr_string("val1")),
691 side_attr("user_attribute_b", side_attr_string("val2")),
696 void test_event_user_attribute(void)
698 side_event(my_provider_event_user_attribute
, side_arg_list(side_arg_u32(1), side_arg_s64(2)));
701 side_static_event(my_provider_field_user_attribute
, "myprovider", "myevent_field_attribute", SIDE_LOGLEVEL_DEBUG
,
703 side_field_u32("abc",
705 side_attr("user_attribute_a", side_attr_string("val1")),
706 side_attr("user_attribute_b", side_attr_u32(2)),
709 side_field_s64("def",
711 side_attr("user_attribute_c", side_attr_string("val3")),
712 side_attr("user_attribute_d", side_attr_s64(-5)),
719 void test_field_user_attribute(void)
721 side_event(my_provider_field_user_attribute
, side_arg_list(side_arg_u32(1), side_arg_s64(2)));
724 side_static_event_variadic(my_provider_event_variadic_attr
,
725 "myprovider", "myvariadiceventattr", SIDE_LOGLEVEL_DEBUG
,
730 void test_variadic_attr(void)
732 side_event_variadic(my_provider_event_variadic_attr
,
735 side_arg_dynamic_field("a",
736 side_arg_dynamic_u32(55,
738 side_attr("user_attribute_c", side_attr_string("valX")),
739 side_attr("user_attribute_d", side_attr_u8(55)),
743 side_arg_dynamic_field("b",
744 side_arg_dynamic_s8(-4,
746 side_attr("X", side_attr_u8(1)),
747 side_attr("Y", side_attr_s8(2)),
755 side_static_event_variadic(my_provider_event_variadic_vla_attr
,
756 "myprovider", "myvariadiceventvlaattr", SIDE_LOGLEVEL_DEBUG
,
761 void test_variadic_vla_attr(void)
763 side_arg_dynamic_define_vec(myvla
,
765 side_arg_dynamic_u32(1,
767 side_attr("Z", side_attr_u8(0)),
768 side_attr("A", side_attr_u8(123)),
771 side_arg_dynamic_u32(2),
772 side_arg_dynamic_u32(3),
775 side_attr("X", side_attr_u8(1)),
776 side_attr("Y", side_attr_u8(2)),
779 side_event_variadic(my_provider_event_variadic_vla_attr
,
782 side_arg_dynamic_field("a", side_arg_dynamic_vla(&myvla
)),
787 side_static_event_variadic(my_provider_event_variadic_struct_attr
,
788 "myprovider", "myvariadiceventstructattr", SIDE_LOGLEVEL_DEBUG
,
793 void test_variadic_struct_attr(void)
795 side_event_cond(my_provider_event_variadic_struct_attr
) {
796 side_arg_dynamic_define_struct(mystruct
,
798 side_arg_dynamic_field("a",
799 side_arg_dynamic_u32(43,
801 side_attr("A", side_attr_bool(true)),
805 side_arg_dynamic_field("b", side_arg_dynamic_u8(55)),
808 side_attr("X", side_attr_u8(1)),
809 side_attr("Y", side_attr_u8(2)),
812 side_event_call_variadic(my_provider_event_variadic_struct_attr
,
815 side_arg_dynamic_field("a", side_arg_dynamic_struct(&mystruct
)),
821 side_static_event(my_provider_event_float
, "myprovider", "myeventfloat", SIDE_LOGLEVEL_DEBUG
,
824 side_field_float_binary16("binary16"),
825 side_field_float_binary16_le("binary16_le"),
826 side_field_float_binary16_be("binary16_be"),
829 side_field_float_binary32("binary32"),
830 side_field_float_binary32_le("binary32_le"),
831 side_field_float_binary32_be("binary32_be"),
834 side_field_float_binary64("binary64"),
835 side_field_float_binary64_le("binary64_le"),
836 side_field_float_binary64_be("binary64_be"),
839 side_field_float_binary128("binary128"),
840 side_field_float_binary128_le("binary128_le"),
841 side_field_float_binary128_be("binary128_be"),
847 void test_float(void)
883 float16
.u
= side_bswap_16(float16
.u
);
886 float32
.u
= side_bswap_32(float32
.u
);
889 float64
.u
= side_bswap_64(float64
.u
);
892 side_bswap_128p(float128
.arr
);
895 side_event(my_provider_event_float
,
898 side_arg_float_binary16(1.1),
899 # if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
900 side_arg_float_binary16(1.1),
901 side_arg_float_binary16(float16
.f
),
903 side_arg_float_binary16(float16
.f
),
904 side_arg_float_binary16(1.1),
908 side_arg_float_binary32(2.2),
909 # if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
910 side_arg_float_binary32(2.2),
911 side_arg_float_binary32(float32
.f
),
913 side_arg_float_binary32(float32
.f
),
914 side_arg_float_binary32(2.2),
918 side_arg_float_binary64(3.3),
919 # if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
920 side_arg_float_binary64(3.3),
921 side_arg_float_binary64(float64
.f
),
923 side_arg_float_binary64(float64
.f
),
924 side_arg_float_binary64(3.3),
928 side_arg_float_binary128(4.4),
929 # if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
930 side_arg_float_binary128(4.4),
931 side_arg_float_binary128(float128
.f
),
933 side_arg_float_binary128(float128
.f
),
934 side_arg_float_binary128(4.4),
941 side_static_event_variadic(my_provider_event_variadic_float
,
942 "myprovider", "myvariadicfloat", SIDE_LOGLEVEL_DEBUG
,
947 void test_variadic_float(void)
983 float16
.u
= side_bswap_16(float16
.u
);
986 float32
.u
= side_bswap_32(float32
.u
);
989 float64
.u
= side_bswap_64(float64
.u
);
992 side_bswap_128p(float128
.arr
);
995 side_event_variadic(my_provider_event_variadic_float
,
999 side_arg_dynamic_field("binary16", side_arg_dynamic_float_binary16(1.1)),
1000 # if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
1001 side_arg_dynamic_field("binary16_le", side_arg_dynamic_float_binary16_le(1.1)),
1002 side_arg_dynamic_field("binary16_be", side_arg_dynamic_float_binary16_be(float16
.f
)),
1004 side_arg_dynamic_field("binary16_le", side_arg_dynamic_float_binary16_le(float16
.f
)),
1005 side_arg_dynamic_field("binary16_be", side_arg_dynamic_float_binary16_be(1.1)),
1009 side_arg_dynamic_field("binary32", side_arg_dynamic_float_binary32(2.2)),
1010 # if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
1011 side_arg_dynamic_field("binary32_le", side_arg_dynamic_float_binary32_le(2.2)),
1012 side_arg_dynamic_field("binary32_be", side_arg_dynamic_float_binary32_be(float32
.f
)),
1014 side_arg_dynamic_field("binary32_le", side_arg_dynamic_float_binary32_le(float32
.f
)),
1015 side_arg_dynamic_field("binary32_be", side_arg_dynamic_float_binary32_be(2.2)),
1019 side_arg_dynamic_field("binary64", side_arg_dynamic_float_binary64(3.3)),
1020 # if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
1021 side_arg_dynamic_field("binary64_le", side_arg_dynamic_float_binary64_le(3.3)),
1022 side_arg_dynamic_field("binary64_be", side_arg_dynamic_float_binary64_be(float64
.f
)),
1024 side_arg_dynamic_field("binary64_le", side_arg_dynamic_float_binary64_le(float64
.f
)),
1025 side_arg_dynamic_field("binary64_be", side_arg_dynamic_float_binary64_be(3.3)),
1029 side_arg_dynamic_field("binary128", side_arg_dynamic_float_binary128(4.4)),
1030 # if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
1031 side_arg_dynamic_field("binary128_le", side_arg_dynamic_float_binary128_le(4.4)),
1032 side_arg_dynamic_field("binary128_be", side_arg_dynamic_float_binary128_be(float128
.f
)),
1034 side_arg_dynamic_field("binary128_le", side_arg_dynamic_float_binary128_le(float128
.f
)),
1035 side_arg_dynamic_field("binary128_be", side_arg_dynamic_float_binary128_be(4.4)),
1042 static side_define_enum(myenum
,
1043 side_enum_mapping_list(
1044 side_enum_mapping_range("one-ten", 1, 10),
1045 side_enum_mapping_range("100-200", 100, 200),
1046 side_enum_mapping_value("200", 200),
1047 side_enum_mapping_value("300", 300),
1051 side_static_event(my_provider_event_enum
, "myprovider", "myeventenum", SIDE_LOGLEVEL_DEBUG
,
1053 side_field_enum("5", &myenum
, side_elem(side_type_u32())),
1054 side_field_enum("400", &myenum
, side_elem(side_type_u64())),
1055 side_field_enum("200", &myenum
, side_elem(side_type_u8())),
1056 side_field_enum("-100", &myenum
, side_elem(side_type_s8())),
1057 side_field_enum("6_be", &myenum
, side_elem(side_type_u32_be())),
1058 side_field_enum("6_le", &myenum
, side_elem(side_type_u32_le())),
1063 void test_enum(void)
1065 side_event(my_provider_event_enum
,
1071 #if SIDE_BYTE_ORDER == SIDE_LITTLE_ENDIAN
1072 side_arg_u32(side_bswap_32(6)),
1076 side_arg_u32(side_bswap_32(6)),
1082 /* A bitmap enum maps bits to labels. */
1083 static side_define_enum_bitmap(myenum_bitmap
,
1084 side_enum_bitmap_mapping_list(
1085 side_enum_bitmap_mapping_value("0", 0),
1086 side_enum_bitmap_mapping_range("1-2", 1, 2),
1087 side_enum_bitmap_mapping_range("2-4", 2, 4),
1088 side_enum_bitmap_mapping_value("3", 3),
1089 side_enum_bitmap_mapping_value("30", 30),
1090 side_enum_bitmap_mapping_value("63", 63),
1091 side_enum_bitmap_mapping_range("158-160", 158, 160),
1092 side_enum_bitmap_mapping_value("159", 159),
1093 side_enum_bitmap_mapping_range("500-700", 500, 700),
1097 side_static_event(my_provider_event_enum_bitmap
, "myprovider", "myeventenumbitmap", SIDE_LOGLEVEL_DEBUG
,
1099 side_field_enum_bitmap("bit_0", &myenum_bitmap
, side_elem(side_type_u32())),
1100 side_field_enum_bitmap("bit_1", &myenum_bitmap
, side_elem(side_type_u32())),
1101 side_field_enum_bitmap("bit_2", &myenum_bitmap
, side_elem(side_type_u8())),
1102 side_field_enum_bitmap("bit_3", &myenum_bitmap
, side_elem(side_type_u8())),
1103 side_field_enum_bitmap("bit_30", &myenum_bitmap
, side_elem(side_type_u32())),
1104 side_field_enum_bitmap("bit_31", &myenum_bitmap
, side_elem(side_type_u32())),
1105 side_field_enum_bitmap("bit_63", &myenum_bitmap
, side_elem(side_type_u64())),
1106 side_field_enum_bitmap("bits_1+63", &myenum_bitmap
, side_elem(side_type_u64())),
1107 side_field_enum_bitmap("byte_bit_2", &myenum_bitmap
, side_elem(side_type_byte())),
1108 side_field_enum_bitmap("bit_159", &myenum_bitmap
,
1109 side_elem(side_type_array(side_elem(side_type_u32()), 5))),
1110 side_field_enum_bitmap("bit_159", &myenum_bitmap
,
1111 side_elem(side_type_vla(side_elem(side_type_u32()), side_elem(side_type_u32())))),
1112 side_field_enum_bitmap("bit_2_be", &myenum_bitmap
, side_elem(side_type_u32_be())),
1113 side_field_enum_bitmap("bit_2_le", &myenum_bitmap
, side_elem(side_type_u32_le())),
1118 void test_enum_bitmap(void)
1120 side_event_cond(my_provider_event_enum_bitmap
) {
1121 side_arg_define_vec(myarray
,
1127 side_arg_u32(0x80000000), /* bit 159 */
1130 side_event_call(my_provider_event_enum_bitmap
,
1132 side_arg_u32(1U << 0),
1133 side_arg_u32(1U << 1),
1134 side_arg_u8(1U << 2),
1135 side_arg_u8(1U << 3),
1136 side_arg_u32(1U << 30),
1137 side_arg_u32(1U << 31),
1138 side_arg_u64(1ULL << 63),
1139 side_arg_u64((1ULL << 1) | (1ULL << 63)),
1140 side_arg_byte(1U << 2),
1141 side_arg_array(&myarray
),
1142 side_arg_vla(&myarray
),
1143 #if SIDE_BYTE_ORDER == SIDE_LITTLE_ENDIAN
1144 side_arg_u32(side_bswap_32(1U << 2)),
1145 side_arg_u32(1U << 2),
1147 side_arg_u32(1U << 2),
1148 side_arg_u32(side_bswap_32(1U << 2)),
1155 side_static_event_variadic(my_provider_event_blob
, "myprovider", "myeventblob", SIDE_LOGLEVEL_DEBUG
,
1157 side_field_byte("blobfield"),
1158 side_field_array("arrayblob", side_elem(side_type_byte()), 3),
1163 void test_blob(void)
1165 side_event_cond(my_provider_event_blob
) {
1166 side_arg_define_vec(myarray
, side_arg_list(side_arg_byte(1), side_arg_byte(2), side_arg_byte(3)));
1167 side_arg_dynamic_define_vec(myvla
,
1169 side_arg_dynamic_byte(0x22),
1170 side_arg_dynamic_byte(0x33),
1173 side_event_call_variadic(my_provider_event_blob
,
1175 side_arg_byte(0x55),
1176 side_arg_array(&myarray
),
1179 side_arg_dynamic_field("varblobfield",
1180 side_arg_dynamic_byte(0x55)
1182 side_arg_dynamic_field("varblobvla", side_arg_dynamic_vla(&myvla
)),
1188 side_static_event_variadic(my_provider_event_format_string
,
1189 "myprovider", "myeventformatstring", SIDE_LOGLEVEL_DEBUG
,
1191 side_field_string("fmt"),
1194 side_attr("lang.c.format_string", side_attr_bool(true)),
1199 void test_fmt_string(void)
1201 side_event_cond(my_provider_event_format_string
) {
1202 side_arg_dynamic_define_vec(args
,
1204 side_arg_dynamic_string("blah"),
1205 side_arg_dynamic_s32(123),
1208 side_event_call_variadic(my_provider_event_format_string
,
1210 side_arg_string("This is a formatted string with str: %s int: %d"),
1213 side_arg_dynamic_field("arguments", side_arg_dynamic_vla(&args
)),
1219 side_static_event_variadic(my_provider_event_endian
, "myprovider", "myevent_endian", SIDE_LOGLEVEL_DEBUG
,
1221 side_field_u16_le("u16_le"),
1222 side_field_u32_le("u32_le"),
1223 side_field_u64_le("u64_le"),
1224 side_field_s16_le("s16_le"),
1225 side_field_s32_le("s32_le"),
1226 side_field_s64_le("s64_le"),
1227 side_field_u16_be("u16_be"),
1228 side_field_u32_be("u32_be"),
1229 side_field_u64_be("u64_be"),
1230 side_field_s16_be("s16_be"),
1231 side_field_s32_be("s32_be"),
1232 side_field_s64_be("s64_be"),
1237 void test_endian(void)
1239 side_event_variadic(my_provider_event_endian
,
1241 #if SIDE_BYTE_ORDER == SIDE_LITTLE_ENDIAN
1248 side_arg_u16(side_bswap_16(1)),
1249 side_arg_u32(side_bswap_32(1)),
1250 side_arg_u64(side_bswap_64(1)),
1251 side_arg_s16(side_bswap_16(1)),
1252 side_arg_s32(side_bswap_32(1)),
1253 side_arg_s64(side_bswap_64(1)),
1255 side_arg_u16(side_bswap_16(1)),
1256 side_arg_u32(side_bswap_32(1)),
1257 side_arg_u64(side_bswap_64(1)),
1258 side_arg_s16(side_bswap_16(1)),
1259 side_arg_s32(side_bswap_32(1)),
1260 side_arg_s64(side_bswap_64(1)),
1270 #if SIDE_BYTE_ORDER == SIDE_LITTLE_ENDIAN
1271 side_arg_dynamic_field("u16_le", side_arg_dynamic_u16_le(1)),
1272 side_arg_dynamic_field("u32_le", side_arg_dynamic_u32_le(1)),
1273 side_arg_dynamic_field("u64_le", side_arg_dynamic_u64_le(1)),
1274 side_arg_dynamic_field("s16_le", side_arg_dynamic_s16_le(1)),
1275 side_arg_dynamic_field("s32_le", side_arg_dynamic_s32_le(1)),
1276 side_arg_dynamic_field("s64_le", side_arg_dynamic_s64_le(1)),
1277 side_arg_dynamic_field("u16_be", side_arg_dynamic_u16_be(side_bswap_16(1))),
1278 side_arg_dynamic_field("u32_be", side_arg_dynamic_u32_be(side_bswap_32(1))),
1279 side_arg_dynamic_field("u64_be", side_arg_dynamic_u64_be(side_bswap_64(1))),
1280 side_arg_dynamic_field("s16_be", side_arg_dynamic_s16_be(side_bswap_16(1))),
1281 side_arg_dynamic_field("s32_be", side_arg_dynamic_s32_be(side_bswap_32(1))),
1282 side_arg_dynamic_field("s64_be", side_arg_dynamic_s64_be(side_bswap_64(1))),
1284 side_arg_dynamic_field("u16_le", side_arg_dynamic_u16_le(side_bswap_16(1))),
1285 side_arg_dynamic_field("u32_le", side_arg_dynamic_u32_le(side_bswap_32(1))),
1286 side_arg_dynamic_field("u64_le", side_arg_dynamic_u64_le(side_bswap_64(1))),
1287 side_arg_dynamic_field("s16_le", side_arg_dynamic_s16_le(side_bswap_16(1))),
1288 side_arg_dynamic_field("s32_le", side_arg_dynamic_s32_le(side_bswap_32(1))),
1289 side_arg_dynamic_field("s64_le", side_arg_dynamic_s64_le(side_bswap_64(1))),
1290 side_arg_dynamic_field("u16_be", side_arg_dynamic_u16_be(1)),
1291 side_arg_dynamic_field("u32_be", side_arg_dynamic_u32_be(1)),
1292 side_arg_dynamic_field("u64_be", side_arg_dynamic_u64_be(1)),
1293 side_arg_dynamic_field("s16_be", side_arg_dynamic_s16_be(1)),
1294 side_arg_dynamic_field("s32_be", side_arg_dynamic_s32_be(1)),
1295 side_arg_dynamic_field("s64_be", side_arg_dynamic_s64_be(1)),
1301 side_static_event(my_provider_event_base
, "myprovider", "myevent_base", SIDE_LOGLEVEL_DEBUG
,
1303 side_field_u8("u8base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
1304 side_field_u8("u8base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
1305 side_field_u8("u8base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1306 side_field_u8("u8base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
1307 side_field_u16("u16base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
1308 side_field_u16("u16base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
1309 side_field_u16("u16base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1310 side_field_u16("u16base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
1311 side_field_u32("u32base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
1312 side_field_u32("u32base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
1313 side_field_u32("u32base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1314 side_field_u32("u32base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
1315 side_field_u64("u64base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
1316 side_field_u64("u64base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
1317 side_field_u64("u64base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1318 side_field_u64("u64base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
1319 side_field_s8("s8base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
1320 side_field_s8("s8base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
1321 side_field_s8("s8base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1322 side_field_s8("s8base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
1323 side_field_s16("s16base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
1324 side_field_s16("s16base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
1325 side_field_s16("s16base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1326 side_field_s16("s16base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
1327 side_field_s32("s32base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
1328 side_field_s32("s32base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
1329 side_field_s32("s32base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1330 side_field_s32("s32base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
1331 side_field_s64("s64base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
1332 side_field_s64("s64base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
1333 side_field_s64("s64base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1334 side_field_s64("s64base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
1339 void test_base(void)
1341 side_event(my_provider_event_base
,
1394 static side_define_struct(mystructgatherdef
,
1396 side_field_gather_unsigned_integer("a", offsetof(struct test
, a
),
1397 side_struct_field_sizeof(struct test
, a
), 0, 0,
1398 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1399 side_field_gather_signed_integer("d", offsetof(struct test
, d
),
1400 side_struct_field_sizeof(struct test
, d
), 0, 0,
1401 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1402 side_field_gather_unsigned_integer("e", offsetof(struct test
, e
),
1403 side_struct_field_sizeof(struct test
, e
), 8, 4,
1404 SIDE_TYPE_GATHER_ACCESS_DIRECT
, side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
1405 side_field_gather_signed_integer("f", offsetof(struct test
, f
),
1406 side_struct_field_sizeof(struct test
, f
), 1, 4,
1407 SIDE_TYPE_GATHER_ACCESS_DIRECT
, side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1408 side_field_gather_signed_integer("g", offsetof(struct test
, g
),
1409 side_struct_field_sizeof(struct test
, g
), 11, 4,
1410 SIDE_TYPE_GATHER_ACCESS_DIRECT
, side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1411 side_field_gather_signed_integer("h", offsetof(struct test
, h
),
1412 side_struct_field_sizeof(struct test
, h
), 1, 31,
1413 SIDE_TYPE_GATHER_ACCESS_DIRECT
, side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1414 side_field_gather_signed_integer("i", offsetof(struct test
, i
),
1415 side_struct_field_sizeof(struct test
, i
), 33, 20,
1416 SIDE_TYPE_GATHER_ACCESS_DIRECT
, side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1417 side_field_gather_signed_integer("j", offsetof(struct test
, j
),
1418 side_struct_field_sizeof(struct test
, j
), 63, 1,
1419 SIDE_TYPE_GATHER_ACCESS_DIRECT
, side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1420 side_field_gather_signed_integer("k", offsetof(struct test
, k
),
1421 side_struct_field_sizeof(struct test
, k
), 1, 63,
1422 SIDE_TYPE_GATHER_ACCESS_DIRECT
, side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1423 side_field_gather_unsigned_integer_le("test", offsetof(struct test
, test
),
1424 side_struct_field_sizeof(struct test
, test
), 0, 64,
1425 SIDE_TYPE_GATHER_ACCESS_DIRECT
, side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
1426 side_field_gather_unsigned_integer_le("test_le", offsetof(struct test
, test
),
1427 side_struct_field_sizeof(struct test
, test
), 0, 64,
1428 SIDE_TYPE_GATHER_ACCESS_DIRECT
, side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
1429 side_field_gather_unsigned_integer_be("test_be", offsetof(struct test
, test
),
1430 side_struct_field_sizeof(struct test
, test
), 0, 64,
1431 SIDE_TYPE_GATHER_ACCESS_DIRECT
, side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
1435 side_static_event(my_provider_event_structgather
, "myprovider", "myeventstructgather", SIDE_LOGLEVEL_DEBUG
,
1437 side_field_gather_struct("structgather", &mystructgatherdef
, 0, sizeof(struct test
),
1438 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1439 side_field_gather_signed_integer("intgather", 0, sizeof(int32_t), 0, 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
,
1440 side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
1442 side_field_gather_float("f32", 0, sizeof(_Float32
), SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1448 void test_struct_gather(void)
1450 side_event_cond(my_provider_event_structgather
) {
1451 struct test mystruct
= {
1469 side_event_call(my_provider_event_structgather
,
1471 side_arg_gather_struct(&mystruct
),
1472 side_arg_gather_integer(&val
),
1474 side_arg_gather_float(&f32
),
1487 struct testnest2
*nest
;
1492 struct testnest1
*nest
;
1495 static side_define_struct(mystructgathernest2
,
1497 side_field_gather_unsigned_integer("c", offsetof(struct testnest2
, c
),
1498 side_struct_field_sizeof(struct testnest2
, c
), 0, 0,
1499 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1503 static side_define_struct(mystructgathernest1
,
1505 side_field_gather_unsigned_integer("b", offsetof(struct testnest1
, b
),
1506 side_struct_field_sizeof(struct testnest1
, b
), 0, 0,
1507 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1508 side_field_gather_struct("nest2", &mystructgathernest2
,
1509 offsetof(struct testnest1
, nest
), sizeof(struct testnest2
),
1510 SIDE_TYPE_GATHER_ACCESS_POINTER
),
1514 static side_define_struct(mystructgathernest0
,
1516 side_field_gather_unsigned_integer("a", offsetof(struct testnest0
, a
),
1517 side_struct_field_sizeof(struct testnest0
, a
), 0, 0,
1518 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1519 side_field_gather_struct("nest1", &mystructgathernest1
,
1520 offsetof(struct testnest0
, nest
), sizeof(struct testnest1
),
1521 SIDE_TYPE_GATHER_ACCESS_POINTER
),
1525 side_static_event(my_provider_event_structgather_nest
,
1526 "myprovider", "myeventstructgathernest", SIDE_LOGLEVEL_DEBUG
,
1528 side_field_gather_struct("nest0", &mystructgathernest0
, 0,
1529 sizeof(struct testnest0
), SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1534 void test_struct_gather_nest_ptr(void)
1536 side_event_cond(my_provider_event_structgather_nest
) {
1537 struct testnest2 mystruct2
= {
1540 struct testnest1 mystruct1
= {
1544 struct testnest0 mystruct
= {
1548 side_event_call(my_provider_event_structgather_nest
,
1550 side_arg_gather_struct(&mystruct
),
1571 static side_define_struct(mystructgatherfloat
,
1574 side_field_gather_float("f16", offsetof(struct testfloat
, f16
), side_struct_field_sizeof(struct testfloat
, f16
),
1575 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1578 side_field_gather_float("f32", offsetof(struct testfloat
, f32
), side_struct_field_sizeof(struct testfloat
, f32
),
1579 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1582 side_field_gather_float("f64", offsetof(struct testfloat
, f64
), side_struct_field_sizeof(struct testfloat
, f64
),
1583 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1586 side_field_gather_float("f128", offsetof(struct testfloat
, f128
), side_struct_field_sizeof(struct testfloat
, f128
),
1587 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1592 side_static_event(my_provider_event_structgatherfloat
,
1593 "myprovider", "myeventstructgatherfloat", SIDE_LOGLEVEL_DEBUG
,
1595 side_field_gather_struct("structgatherfloat", &mystructgatherfloat
, 0,
1596 sizeof(struct testfloat
), SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1601 void test_struct_gather_float(void)
1603 side_event_cond(my_provider_event_structgatherfloat
) {
1604 struct testfloat mystruct
= {
1618 side_event_call(my_provider_event_structgatherfloat
,
1620 side_arg_gather_struct(&mystruct
),
1626 uint32_t mygatherarray
[] = { 1, 2, 3, 4, 5 };
1628 uint16_t mygatherarray2
[] = { 6, 7, 8, 9 };
1635 static side_define_struct(mystructgatherarray
,
1637 side_field_gather_array("array",
1638 side_elem(side_type_gather_unsigned_integer(0, sizeof(uint32_t), 0, 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
)),
1639 SIDE_ARRAY_SIZE(mygatherarray
),
1640 offsetof(struct testarray
, ptr
),
1641 SIDE_TYPE_GATHER_ACCESS_POINTER
1646 side_static_event(my_provider_event_structgatherarray
,
1647 "myprovider", "myeventstructgatherarray", SIDE_LOGLEVEL_DEBUG
,
1649 side_field_gather_struct("structgatherarray", &mystructgatherarray
, 0,
1650 sizeof(struct testarray
), SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1651 side_field_gather_array("array2",
1652 side_elem(side_type_gather_unsigned_integer(0, sizeof(uint16_t), 0, 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
)),
1653 SIDE_ARRAY_SIZE(mygatherarray2
), 0,
1654 SIDE_TYPE_GATHER_ACCESS_DIRECT
1660 void test_array_gather(void)
1662 side_event_cond(my_provider_event_structgatherarray
) {
1663 struct testarray mystruct
= {
1665 .ptr
= mygatherarray
,
1667 side_event_call(my_provider_event_structgatherarray
,
1669 side_arg_gather_struct(&mystruct
),
1670 side_arg_gather_array(&mygatherarray2
),
1676 #define TESTSGNESTARRAY_LEN 4
1677 struct testgatherstructnest1
{
1679 int c
[TESTSGNESTARRAY_LEN
];
1682 struct testgatherstructnest0
{
1683 struct testgatherstructnest1 nest
;
1684 struct testgatherstructnest1 nestarray
[2];
1688 static side_define_struct(mystructgatherstructnest1
,
1690 side_field_gather_signed_integer("b", offsetof(struct testgatherstructnest1
, b
),
1691 side_struct_field_sizeof(struct testgatherstructnest1
, b
), 0, 0,
1692 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1693 side_field_gather_array("c",
1695 side_type_gather_signed_integer(0, sizeof(uint32_t), 0, 0,
1696 SIDE_TYPE_GATHER_ACCESS_DIRECT
)
1698 TESTSGNESTARRAY_LEN
,
1699 offsetof(struct testgatherstructnest1
, c
),
1700 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1704 static side_define_struct(mystructgatherstructnest0
,
1706 side_field_gather_signed_integer("a", offsetof(struct testgatherstructnest0
, a
),
1707 side_struct_field_sizeof(struct testgatherstructnest0
, a
), 0, 0,
1708 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1709 side_field_gather_struct("structnest0", &mystructgatherstructnest1
,
1710 offsetof(struct testgatherstructnest0
, nest
),
1711 sizeof(struct testgatherstructnest1
),
1712 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1713 side_field_gather_array("nestarray",
1715 side_type_gather_struct(&mystructgatherstructnest1
,
1717 sizeof(struct testgatherstructnest1
),
1718 SIDE_TYPE_GATHER_ACCESS_DIRECT
)
1721 offsetof(struct testgatherstructnest0
, nestarray
),
1722 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1726 side_static_event(my_provider_event_gatherstructnest
,
1727 "myprovider", "myeventgatherstructnest", SIDE_LOGLEVEL_DEBUG
,
1729 side_field_gather_struct("structgather", &mystructgatherstructnest0
, 0,
1730 sizeof(struct testgatherstructnest0
), SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1735 void test_gather_structnest(void)
1737 side_event_cond(my_provider_event_gatherstructnest
) {
1738 struct testgatherstructnest0 mystruct
= {
1741 .c
= { 0, 1, 2, 3 },
1746 .c
= { 11, 12, 13, 14 },
1750 .c
= { 15, 16, 17, 18 },
1755 side_event_call(my_provider_event_gatherstructnest
,
1757 side_arg_gather_struct(&mystruct
),
1763 uint32_t gathervla
[] = { 1, 2, 3, 4 };
1764 uint32_t gathervla2
[] = { 5, 6, 7, 8, 9 };
1766 struct testgathervla
{
1772 static side_define_struct(mystructgathervla
,
1774 side_field_gather_signed_integer("a", offsetof(struct testgathervla
, a
),
1775 side_struct_field_sizeof(struct testgathervla
, a
), 0, 0,
1776 SIDE_TYPE_GATHER_ACCESS_DIRECT
1778 side_field_gather_vla("nestvla",
1779 side_elem(side_type_gather_unsigned_integer(0, sizeof(uint32_t), 0, 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
)),
1780 offsetof(struct testgathervla
, p
),
1781 SIDE_TYPE_GATHER_ACCESS_POINTER
,
1782 side_length(side_type_gather_unsigned_integer(offsetof(struct testgathervla
, len
),
1783 sizeof(uint16_t), 0, 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
))
1788 side_static_event(my_provider_event_gathervla
,
1789 "myprovider", "myeventgathervla", SIDE_LOGLEVEL_DEBUG
,
1791 side_field_gather_struct("structgathervla", &mystructgathervla
, 0,
1792 sizeof(struct testgathervla
), SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1793 side_field_gather_vla("vla",
1794 side_elem(side_type_gather_unsigned_integer(0, sizeof(uint32_t), 0, 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
)),
1795 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
,
1796 side_length(side_type_gather_unsigned_integer(0, sizeof(uint16_t), 0, 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
))
1802 void test_gather_vla(void)
1804 side_event_cond(my_provider_event_gathervla
) {
1805 struct testgathervla mystruct
= {
1807 .len
= SIDE_ARRAY_SIZE(gathervla
),
1810 uint16_t vla2_len
= 5;
1811 side_event_call(my_provider_event_gathervla
,
1813 side_arg_gather_struct(&mystruct
),
1814 side_arg_gather_vla(gathervla2
, &vla2_len
),
1820 struct testgathervlaflex
{
1822 uint32_t otherfield
;
1826 static side_define_struct(mystructgathervlaflex
,
1828 side_field_gather_vla("vlaflex",
1829 side_elem(side_type_gather_unsigned_integer(0, sizeof(uint64_t), 0, 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
)),
1830 offsetof(struct testgathervlaflex
, array
),
1831 SIDE_TYPE_GATHER_ACCESS_DIRECT
,
1832 side_length(side_type_gather_unsigned_integer(offsetof(struct testgathervlaflex
, len
),
1833 side_struct_field_sizeof(struct testgathervlaflex
, len
), 0, 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
))
1838 side_static_event(my_provider_event_gathervlaflex
,
1839 "myprovider", "myeventgathervlaflex", SIDE_LOGLEVEL_DEBUG
,
1841 side_field_gather_struct("structgathervlaflex", &mystructgathervlaflex
, 0,
1842 sizeof(struct testgathervlaflex
), SIDE_TYPE_GATHER_ACCESS_DIRECT
)
1846 #define VLAFLEXLEN 6
1848 void test_gather_vla_flex(void)
1850 side_event_cond(my_provider_event_gathervlaflex
) {
1851 struct testgathervlaflex
*mystruct
=
1852 (struct testgathervlaflex
*) malloc(sizeof(*mystruct
) + VLAFLEXLEN
* sizeof(uint64_t));
1854 mystruct
->len
= VLAFLEXLEN
;
1855 mystruct
->otherfield
= 0;
1856 mystruct
->array
[0] = 1;
1857 mystruct
->array
[1] = 2;
1858 mystruct
->array
[2] = 3;
1859 mystruct
->array
[3] = 4;
1860 mystruct
->array
[4] = 5;
1861 mystruct
->array
[5] = 6;
1862 side_event_call(my_provider_event_gathervlaflex
,
1864 side_arg_gather_struct(mystruct
),
1871 side_static_event(my_provider_event_gatherbyte
,
1872 "myprovider", "myeventgatherbyte", SIDE_LOGLEVEL_DEBUG
,
1874 side_field_gather_byte("byte", 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1875 side_field_gather_array("array",
1876 side_elem(side_type_gather_byte(0, SIDE_TYPE_GATHER_ACCESS_DIRECT
)),
1877 3, 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
1883 void test_gather_byte(void)
1885 side_event_cond(my_provider_event_gatherbyte
) {
1887 uint8_t array
[3] = { 0x1, 0x2, 0x3 };
1889 side_event_call(my_provider_event_gatherbyte
,
1891 side_arg_gather_byte(&v
),
1892 side_arg_gather_array(array
),
1898 #define ARRAYBOOLLEN 4
1899 static bool arraybool
[ARRAYBOOLLEN
] = { false, true, false, true };
1901 side_static_event(my_provider_event_gatherbool
,
1902 "myprovider", "myeventgatherbool", SIDE_LOGLEVEL_DEBUG
,
1904 side_field_gather_bool("v1_true", 0, sizeof(bool), 0, 0,
1905 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1906 side_field_gather_bool("v2_false", 0, sizeof(bool), 0, 0,
1907 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1908 side_field_gather_bool("v3_true", 0, sizeof(uint16_t), 1, 1,
1909 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1910 side_field_gather_bool("v4_false", 0, sizeof(uint16_t), 1, 1,
1911 SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1912 side_field_gather_array("arraybool",
1913 side_elem(side_type_gather_bool(0, sizeof(bool), 0, 0,
1914 SIDE_TYPE_GATHER_ACCESS_DIRECT
)),
1915 ARRAYBOOLLEN
, 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
1921 void test_gather_bool(void)
1923 side_event_cond(my_provider_event_structgatherarray
) {
1926 uint16_t v3
= 1U << 1;
1927 uint16_t v4
= 1U << 2;
1929 side_event_call(my_provider_event_gatherbool
,
1931 side_arg_gather_bool(&v1
),
1932 side_arg_gather_bool(&v2
),
1933 side_arg_gather_bool(&v3
),
1934 side_arg_gather_bool(&v4
),
1935 side_arg_gather_array(arraybool
),
1941 side_static_event(my_provider_event_gatherpointer
,
1942 "myprovider", "myeventgatherpointer", SIDE_LOGLEVEL_DEBUG
,
1944 side_field_gather_pointer("ptr", 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
),
1945 side_field_gather_array("array",
1946 side_elem(side_type_gather_pointer(0, SIDE_TYPE_GATHER_ACCESS_DIRECT
)),
1947 3, 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
1953 void test_gather_pointer(void)
1955 side_event_cond(my_provider_event_structgatherarray
) {
1956 void *v
= (void *)0x44;
1957 void *array
[3] = { (void *)0x1, (void *)0x2, (void *)0x3 };
1959 side_event_call(my_provider_event_gatherpointer
,
1961 side_arg_gather_pointer(&v
),
1962 side_arg_gather_array(array
),
1968 static side_define_enum(myenumgather
,
1969 side_enum_mapping_list(
1970 side_enum_mapping_range("one-ten", 1, 10),
1971 side_enum_mapping_range("100-200", 100, 200),
1972 side_enum_mapping_value("200", 200),
1973 side_enum_mapping_value("300", 300),
1977 side_static_event(my_provider_event_enum_gather
, "myprovider", "myeventenumgather", SIDE_LOGLEVEL_DEBUG
,
1979 side_field_gather_enum("5", &myenumgather
,
1981 side_type_gather_unsigned_integer(0, sizeof(uint32_t), 0, 0,
1982 SIDE_TYPE_GATHER_ACCESS_DIRECT
)
1985 side_field_gather_enum("400", &myenumgather
,
1987 side_type_gather_unsigned_integer(0, sizeof(uint64_t), 0, 0,
1988 SIDE_TYPE_GATHER_ACCESS_DIRECT
)
1991 side_field_gather_enum("200", &myenumgather
,
1993 side_type_gather_unsigned_integer(0, sizeof(uint8_t), 0, 0,
1994 SIDE_TYPE_GATHER_ACCESS_DIRECT
)
1997 side_field_gather_enum("-100", &myenumgather
,
1999 side_type_gather_signed_integer(0, sizeof(int8_t), 0, 0,
2000 SIDE_TYPE_GATHER_ACCESS_DIRECT
)
2003 side_field_gather_enum("6_be", &myenumgather
,
2005 side_type_gather_unsigned_integer_be(0, sizeof(uint32_t), 0, 0,
2006 SIDE_TYPE_GATHER_ACCESS_DIRECT
)
2009 side_field_gather_enum("6_le", &myenumgather
,
2011 side_type_gather_unsigned_integer_le(0, sizeof(uint32_t), 0, 0,
2012 SIDE_TYPE_GATHER_ACCESS_DIRECT
)
2019 void test_gather_enum(void)
2025 #if SIDE_BYTE_ORDER == SIDE_LITTLE_ENDIAN
2026 uint32_t v5
= side_bswap_32(6);
2030 uint32_t v6
= side_bswap_32(6);
2033 side_event(my_provider_event_enum_gather
,
2035 side_arg_gather_integer(&v1
),
2036 side_arg_gather_integer(&v2
),
2037 side_arg_gather_integer(&v3
),
2038 side_arg_gather_integer(&v4
),
2039 side_arg_gather_integer(&v5
),
2040 side_arg_gather_integer(&v6
),
2045 side_static_event(my_provider_event_gatherstring
,
2046 "myprovider", "myeventgatherstring", SIDE_LOGLEVEL_DEBUG
,
2048 side_field_gather_string("string", 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
),
2049 side_field_gather_array("arrayptr",
2050 side_elem(side_type_gather_string(0, SIDE_TYPE_GATHER_ACCESS_POINTER
)),
2051 3, 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
2053 side_field_gather_array("array",
2054 side_elem(side_type_gather_string(0, SIDE_TYPE_GATHER_ACCESS_DIRECT
)),
2055 3, 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
2061 void test_gather_string(void)
2063 side_event_cond(my_provider_event_gatherstring
) {
2064 const char *str1
= "abcdef";
2065 const char *ptrarray
[3] = {
2070 char flatarray
[] = { 'a', 'b', '\0', 'c', 'd', '\0', 'e', 'f', '\0' };
2072 side_event_call(my_provider_event_gatherstring
,
2074 side_arg_gather_string(str1
),
2075 side_arg_gather_array(ptrarray
),
2076 side_arg_gather_array(flatarray
),
2082 side_static_event(my_provider_event_str_utf
, "myprovider", "myevent_str_utf", SIDE_LOGLEVEL_DEBUG
,
2084 side_field_string("utf8"),
2085 side_field_string32("utf32"),
2086 side_field_string16("utf16"),
2087 side_field_string32_le("utf32_le"),
2088 side_field_string16_le("utf16_le"),
2089 side_field_string32_be("utf32_be"),
2090 side_field_string16_be("utf16_be"),
2091 side_field_dynamic("dynamic_utf32"),
2092 side_field_gather_string32("gather_utf32", 0, SIDE_TYPE_GATHER_ACCESS_DIRECT
),
2097 void test_string_utf(void)
2103 * UTF-32: U+000000ae
2105 uint8_t str8
[] = { 0xc2, 0xae, 'a', 'b', 'c', 0 };
2106 uint32_t str32
[] = { 0x000000ae, 'a', 'b', 'c', 0 };
2107 uint16_t str16
[] = { 0x00ae, 'a', 'b', 'c', 0 };
2108 #if SIDE_BYTE_ORDER == SIDE_LITTLE_ENDIAN
2109 uint32_t str32_le
[] = { 0x000000ae, 'a', 'b', 'c', 0 };
2110 uint16_t str16_le
[] = { 0x00ae, 'a', 'b', 'c', 0 };
2111 uint32_t str32_be
[] = { side_bswap_32(0x000000ae), side_bswap_32('a'), side_bswap_32('b'), side_bswap_32('c'), 0 };
2112 uint16_t str16_be
[] = { side_bswap_16(0x00ae), side_bswap_16('a'), side_bswap_16('b'), side_bswap_16('c'), 0 };
2114 uint32_t str32_le
[] = { side_bswap_32(0x000000ae), side_bswap_32('a'), side_bswap_32('b'), side_bswap_32('c'), 0 };
2115 uint16_t str16_le
[] = { side_bswap_16(0x00ae), side_bswap_16('a'), side_bswap_16('b'), side_bswap_16('c'), 0 };
2116 uint32_t str32_be
[] = { 0x000000ae, 'a', 'b', 'c', 0 };
2117 uint16_t str16_be
[] = { 0x00ae, 'a', 'b', 'c', 0 };
2120 side_event(my_provider_event_str_utf
,
2122 side_arg_string(str8
),
2123 side_arg_string32(str32
),
2124 side_arg_string16(str16
),
2125 side_arg_string32(str32_le
),
2126 side_arg_string16(str16_le
),
2127 side_arg_string32(str32_be
),
2128 side_arg_string16(str16_be
),
2129 side_arg_dynamic_string32(str32
),
2130 side_arg_gather_string(str32
),
2135 static side_define_variant(myvariantdef
,
2138 side_option_range(1, 3, side_type_u16()),
2139 side_option(5, side_type_string()),
2143 side_static_event(my_provider_event_variant
, "myprovider", "myeventvariant", SIDE_LOGLEVEL_DEBUG
,
2145 side_field_variant("variant1", &myvariantdef
),
2146 side_field_variant("variant2", &myvariantdef
),
2152 void test_variant(void)
2154 side_event_cond(my_provider_event_variant
) {
2155 side_arg_define_variant(myvariant1
, side_arg_u32(2), side_arg_u16(4));
2156 side_arg_define_variant(myvariant2
, side_arg_u32(5), side_arg_string("abc"));
2158 side_event_call(my_provider_event_variant
,
2160 side_arg_variant(&myvariant1
),
2161 side_arg_variant(&myvariant2
),
2168 #ifdef __SIZEOF_INT128__
2169 side_static_event(my_provider_event_integer128
, "myprovider", "myevent_integer128", SIDE_LOGLEVEL_DEBUG
,
2171 side_field_s128("signed128_base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
2172 side_field_u128("unsigned128_base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
2173 side_field_s128("signed128_base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
2174 side_field_u128("unsigned128_base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
2175 side_field_s128("signed128_base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
2176 side_field_u128("unsigned128_base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
2177 side_field_s128("signed128_base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
2178 side_field_u128("unsigned128_base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
2183 void test_integer128(void)
2185 side_event_cond(my_provider_event_integer128
) {
2186 __int128 s_v128
= 0;
2187 unsigned __int128 u_v128
;
2192 /* Maximum unsigned 128-bit value: 340282366920938463463374607431768211455. */
2195 side_event_call(my_provider_event_integer128
,
2197 side_arg_s128(s_v128
),
2198 side_arg_u128(u_v128
),
2199 side_arg_s128(s_v128
),
2200 side_arg_u128(u_v128
),
2201 side_arg_s128(s_v128
),
2202 side_arg_u128(u_v128
),
2203 side_arg_s128(s_v128
),
2204 side_arg_u128(u_v128
),
2208 side_event_cond(my_provider_event_integer128
) {
2209 __int128 s_v128
= 0;
2210 unsigned __int128 u_v128
;
2212 /* Minimum signed 128-bit value: -170141183460469231731687303715884105728 */
2218 side_event_call(my_provider_event_integer128
,
2220 side_arg_s128(s_v128
),
2221 side_arg_u128(u_v128
),
2222 side_arg_s128(s_v128
),
2223 side_arg_u128(u_v128
),
2224 side_arg_s128(s_v128
),
2225 side_arg_u128(u_v128
),
2226 side_arg_s128(s_v128
),
2227 side_arg_u128(u_v128
),
2231 side_event_cond(my_provider_event_integer128
) {
2232 __int128 s_v128
= 0;
2233 unsigned __int128 u_v128
;
2235 /* Minimum signed 128-bit value + 1: -170141183460469231731687303715884105727 */
2240 /* INT64_MAX + 1. */
2241 u_v128
= INT64_MAX
; /* 9223372036854775807LL */
2243 side_event_call(my_provider_event_integer128
,
2245 side_arg_s128(s_v128
),
2246 side_arg_u128(u_v128
),
2247 side_arg_s128(s_v128
),
2248 side_arg_u128(u_v128
),
2249 side_arg_s128(s_v128
),
2250 side_arg_u128(u_v128
),
2251 side_arg_s128(s_v128
),
2252 side_arg_u128(u_v128
),
2259 void test_integer128(void)
2268 test_event_hidden();
2269 test_event_export();
2270 test_struct_literal();
2275 test_vla_visitor_2d();
2276 test_dynamic_basic_type();
2278 test_dynamic_null();
2279 test_dynamic_struct();
2280 test_dynamic_nested_struct();
2281 test_dynamic_vla_struct();
2282 test_dynamic_struct_vla();
2283 test_dynamic_nested_vla();
2285 test_static_variadic();
2287 test_dynamic_bool();
2288 test_dynamic_vla_with_visitor();
2289 test_dynamic_struct_with_visitor();
2290 test_event_user_attribute();
2291 test_field_user_attribute();
2292 test_variadic_attr();
2293 test_variadic_vla_attr();
2294 test_variadic_struct_attr();
2296 test_variadic_float();
2303 test_struct_gather();
2304 test_struct_gather_nest_ptr();
2305 test_struct_gather_float();
2306 test_array_gather();
2307 test_gather_structnest();
2309 test_gather_vla_flex();
2312 test_gather_pointer();
2314 test_gather_string();