Implement gather byte
[libside.git] / src / test.c
index 396a3f0d5fa6da1fa5e3c089f947e1ccf03401e0..13419ad44f0c8f0f1e05f5c7cfcc0613464a6155 100644 (file)
@@ -8,17 +8,21 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <stdbool.h>
+#include <stddef.h>
 
 #include <side/trace.h>
 #include "tracer.h"
 
 /* User code example */
 
-static side_define_event(my_provider_event, "myprovider", "myevent", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_event, "myprovider", "myevent", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_u32("abc", side_attr_list()),
                side_field_s64("def", side_attr_list()),
-               side_field_dynamic("dynamic", side_attr_list()),
+               side_field_pointer("ptr", side_attr_list()),
+               side_field_dynamic("dynamic"),
+               side_field_dynamic("dynamic_pointer"),
+               side_field_null("null", side_attr_list()),
        ),
        side_attr_list()
 );
@@ -29,12 +33,47 @@ void test_fields(void)
        uint32_t uw = 42;
        int64_t sdw = -500;
 
-       my_provider_event_enabled = 1;
-       side_event(my_provider_event, side_arg_list(side_arg_u32(uw), side_arg_s64(sdw),
-               side_arg_dynamic(side_arg_dynamic_string("zzz", side_attr_list()))));
+       side_event(my_provider_event,
+               side_arg_list(
+                       side_arg_u32(uw),
+                       side_arg_s64(sdw),
+                       side_arg_pointer((void *) 0x1),
+                       side_arg_dynamic_string("zzz", side_attr_list()),
+                       side_arg_dynamic_pointer((void *) 0x1, side_attr_list()),
+                       side_arg_null(),
+               )
+       );
+}
+
+side_hidden_event(my_provider_event_hidden, "myprovider", "myeventhidden", SIDE_LOGLEVEL_DEBUG,
+       side_field_list(
+               side_field_u32("abc", side_attr_list()),
+       ),
+       side_attr_list()
+);
+
+static
+void test_event_hidden(void)
+{
+       side_event(my_provider_event_hidden, side_arg_list(side_arg_u32(2)));
+}
+
+side_declare_event(my_provider_event_export);
+
+side_export_event(my_provider_event_export, "myprovider", "myeventexport", SIDE_LOGLEVEL_DEBUG,
+       side_field_list(
+               side_field_u32("abc", side_attr_list()),
+       ),
+       side_attr_list()
+);
+
+static
+void test_event_export(void)
+{
+       side_event(my_provider_event_export, side_arg_list(side_arg_u32(2)));
 }
 
-static side_define_event(my_provider_event_struct_literal, "myprovider", "myeventstructliteral", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_event_struct_literal, "myprovider", "myeventstructliteral", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_struct("structliteral",
                        side_struct_literal(
@@ -53,7 +92,6 @@ static side_define_event(my_provider_event_struct_literal, "myprovider", "myeven
 static
 void test_struct_literal(void)
 {
-       my_provider_event_struct_literal_enabled = 1;
        side_event_cond(my_provider_event_struct_literal) {
                side_arg_define_vec(mystruct, side_arg_list(side_arg_u32(21), side_arg_s64(22)));
                side_event_call(my_provider_event_struct_literal, side_arg_list(side_arg_struct(&mystruct), side_arg_u8(55)));
@@ -68,7 +106,7 @@ static side_define_struct(mystructdef,
        side_attr_list()
 );
 
-static side_define_event(my_provider_event_struct, "myprovider", "myeventstruct", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_event_struct, "myprovider", "myeventstruct", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_struct("struct", &mystructdef),
                side_field_u8("z", side_attr_list()),
@@ -79,14 +117,13 @@ static side_define_event(my_provider_event_struct, "myprovider", "myeventstruct"
 static
 void test_struct(void)
 {
-       my_provider_event_struct_enabled = 1;
        side_event_cond(my_provider_event_struct) {
                side_arg_define_vec(mystruct, side_arg_list(side_arg_u32(21), side_arg_s64(22)));
                side_event_call(my_provider_event_struct, side_arg_list(side_arg_struct(&mystruct), side_arg_u8(55)));
        }
 }
 
-static side_define_event(my_provider_event_array, "myprovider", "myarray", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_event_array, "myprovider", "myarray", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_array("arr", side_elem(side_type_u32(side_attr_list())), 3, side_attr_list()),
                side_field_s64("v", side_attr_list()),
@@ -97,14 +134,13 @@ static side_define_event(my_provider_event_array, "myprovider", "myarray", SIDE_
 static
 void test_array(void)
 {
-       my_provider_event_array_enabled = 1;
        side_event_cond(my_provider_event_array) {
                side_arg_define_vec(myarray, side_arg_list(side_arg_u32(1), side_arg_u32(2), side_arg_u32(3)));
                side_event_call(my_provider_event_array, side_arg_list(side_arg_array(&myarray), side_arg_s64(42)));
        }
 }
 
-static side_define_event(my_provider_event_vla, "myprovider", "myvla", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_event_vla, "myprovider", "myvla", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_vla("vla", side_elem(side_type_u32(side_attr_list())), side_attr_list()),
                side_field_s64("v", side_attr_list()),
@@ -115,7 +151,6 @@ static side_define_event(my_provider_event_vla, "myprovider", "myvla", SIDE_LOGL
 static
 void test_vla(void)
 {
-       my_provider_event_vla_enabled = 1;
        side_event_cond(my_provider_event_vla) {
                side_arg_define_vec(myvla, side_arg_list(side_arg_u32(1), side_arg_u32(2), side_arg_u32(3)));
                side_event_call(my_provider_event_vla, side_arg_list(side_arg_vla(&myvla), side_arg_s64(42)));
@@ -136,7 +171,7 @@ enum side_visitor_status test_visitor(const struct side_tracer_visitor_ctx *trac
        uint32_t length = ctx->length, i;
 
        for (i = 0; i < length; i++) {
-               const struct side_arg_vec elem = side_arg_u32(ctx->ptr[i]);
+               const struct side_arg elem = side_arg_u32(ctx->ptr[i]);
 
                if (tracer_ctx->write_elem(tracer_ctx, &elem) != SIDE_VISITOR_STATUS_OK)
                        return SIDE_VISITOR_STATUS_ERROR;
@@ -146,7 +181,7 @@ enum side_visitor_status test_visitor(const struct side_tracer_visitor_ctx *trac
 
 static uint32_t testarray[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
 
-static side_define_event(my_provider_event_vla_visitor, "myprovider", "myvlavisit", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_event_vla_visitor, "myprovider", "myvlavisit", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_vla_visitor("vlavisit", side_elem(side_type_u32(side_attr_list())), test_visitor, side_attr_list()),
                side_field_s64("v", side_attr_list()),
@@ -157,7 +192,6 @@ static side_define_event(my_provider_event_vla_visitor, "myprovider", "myvlavisi
 static
 void test_vla_visitor(void)
 {
-       my_provider_event_vla_visitor_enabled = 1;
        side_event_cond(my_provider_event_vla_visitor) {
                struct app_visitor_ctx ctx = {
                        .ptr = testarray,
@@ -181,7 +215,7 @@ enum side_visitor_status test_inner_visitor(const struct side_tracer_visitor_ctx
        uint32_t length = ctx->length, i;
 
        for (i = 0; i < length; i++) {
-               const struct side_arg_vec elem = side_arg_u32(ctx->ptr[i]);
+               const struct side_arg elem = side_arg_u32(ctx->ptr[i]);
 
                if (tracer_ctx->write_elem(tracer_ctx, &elem) != SIDE_VISITOR_STATUS_OK)
                        return SIDE_VISITOR_STATUS_ERROR;
@@ -205,7 +239,7 @@ enum side_visitor_status test_outer_visitor(const struct side_tracer_visitor_ctx
                        .ptr = ctx->ptr[i],
                        .length = 2,
                };
-               const struct side_arg_vec elem = side_arg_vla_visitor(&inner_ctx);
+               const struct side_arg elem = side_arg_vla_visitor(&inner_ctx);
                if (tracer_ctx->write_elem(tracer_ctx, &elem) != SIDE_VISITOR_STATUS_OK)
                        return SIDE_VISITOR_STATUS_ERROR;
        }
@@ -218,7 +252,7 @@ static uint32_t testarray2d[][2] = {
        { 55, 66 },
 };
 
-static side_define_event(my_provider_event_vla_visitor2d, "myprovider", "myvlavisit2d", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_event_vla_visitor2d, "myprovider", "myvlavisit2d", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_vla_visitor("vlavisit2d",
                        side_elem(
@@ -235,7 +269,6 @@ static side_define_event(my_provider_event_vla_visitor2d, "myprovider", "myvlavi
 static
 void test_vla_visitor_2d(void)
 {
-       my_provider_event_vla_visitor2d_enabled = 1;
        side_event_cond(my_provider_event_vla_visitor2d) {
                struct app_visitor_2d_outer_ctx ctx = {
                        .ptr = testarray2d,
@@ -247,7 +280,7 @@ void test_vla_visitor_2d(void)
 
 static int64_t array_fixint[] = { -444, 555, 123, 2897432587 };
 
-static side_define_event(my_provider_event_array_fixint, "myprovider", "myarrayfixint", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_event_array_fixint, "myprovider", "myarrayfixint", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_array("arrfixint", side_elem(side_type_s64(side_attr_list())), SIDE_ARRAY_SIZE(array_fixint), side_attr_list()),
                side_field_s64("v", side_attr_list()),
@@ -258,14 +291,13 @@ static side_define_event(my_provider_event_array_fixint, "myprovider", "myarrayf
 static
 void test_array_fixint(void)
 {
-       my_provider_event_array_fixint_enabled = 1;
        side_event(my_provider_event_array_fixint,
                side_arg_list(side_arg_array_s64(array_fixint), side_arg_s64(42)));
 }
 
 static int64_t vla_fixint[] = { -444, 555, 123, 2897432587 };
 
-static side_define_event(my_provider_event_vla_fixint, "myprovider", "myvlafixint", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_event_vla_fixint, "myprovider", "myvlafixint", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_vla("vlafixint", side_elem(side_type_s64(side_attr_list())), side_attr_list()),
                side_field_s64("v", side_attr_list()),
@@ -276,15 +308,14 @@ static side_define_event(my_provider_event_vla_fixint, "myprovider", "myvlafixin
 static
 void test_vla_fixint(void)
 {
-       my_provider_event_vla_fixint_enabled = 1;
        side_event(my_provider_event_vla_fixint,
                side_arg_list(side_arg_vla_s64(vla_fixint, SIDE_ARRAY_SIZE(vla_fixint)), side_arg_s64(42)));
 }
 
-static side_define_event(my_provider_event_dynamic_basic,
+side_static_event(my_provider_event_dynamic_basic,
        "myprovider", "mydynamicbasic", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
-               side_field_dynamic("dynamic", side_attr_list()),
+               side_field_dynamic("dynamic"),
        ),
        side_attr_list()
 );
@@ -292,15 +323,14 @@ static side_define_event(my_provider_event_dynamic_basic,
 static
 void test_dynamic_basic_type(void)
 {
-       my_provider_event_dynamic_basic_enabled = 1;
        side_event(my_provider_event_dynamic_basic,
-               side_arg_list(side_arg_dynamic(side_arg_dynamic_s16(-33, side_attr_list()))));
+               side_arg_list(side_arg_dynamic_s16(-33, side_attr_list())));
 }
 
-static side_define_event(my_provider_event_dynamic_vla,
+side_static_event(my_provider_event_dynamic_vla,
        "myprovider", "mydynamicvla", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
-               side_field_dynamic("dynamic", side_attr_list()),
+               side_field_dynamic("dynamic"),
        ),
        side_attr_list()
 );
@@ -316,15 +346,14 @@ void test_dynamic_vla(void)
                ),
                side_attr_list()
        );
-       my_provider_event_dynamic_vla_enabled = 1;
        side_event(my_provider_event_dynamic_vla,
-               side_arg_list(side_arg_dynamic(side_arg_dynamic_vla(&myvla))));
+               side_arg_list(side_arg_dynamic_vla(&myvla)));
 }
 
-static side_define_event(my_provider_event_dynamic_null,
+side_static_event(my_provider_event_dynamic_null,
        "myprovider", "mydynamicnull", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
-               side_field_dynamic("dynamic", side_attr_list()),
+               side_field_dynamic("dynamic"),
        ),
        side_attr_list()
 );
@@ -332,15 +361,14 @@ static side_define_event(my_provider_event_dynamic_null,
 static
 void test_dynamic_null(void)
 {
-       my_provider_event_dynamic_null_enabled = 1;
        side_event(my_provider_event_dynamic_null,
-               side_arg_list(side_arg_dynamic(side_arg_dynamic_null(side_attr_list()))));
+               side_arg_list(side_arg_dynamic_null(side_attr_list())));
 }
 
-static side_define_event(my_provider_event_dynamic_struct,
+side_static_event(my_provider_event_dynamic_struct,
        "myprovider", "mydynamicstruct", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
-               side_field_dynamic("dynamic", side_attr_list()),
+               side_field_dynamic("dynamic"),
        ),
        side_attr_list()
 );
@@ -357,15 +385,14 @@ void test_dynamic_struct(void)
                side_attr_list()
        );
 
-       my_provider_event_dynamic_struct_enabled = 1;
        side_event(my_provider_event_dynamic_struct,
-               side_arg_list(side_arg_dynamic(side_arg_dynamic_struct(&mystruct))));
+               side_arg_list(side_arg_dynamic_struct(&mystruct)));
 }
 
-static side_define_event(my_provider_event_dynamic_nested_struct,
+side_static_event(my_provider_event_dynamic_nested_struct,
        "myprovider", "mydynamicnestedstruct", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
-               side_field_dynamic("dynamic", side_attr_list()),
+               side_field_dynamic("dynamic"),
        ),
        side_attr_list()
 );
@@ -394,15 +421,14 @@ void test_dynamic_nested_struct(void)
                ),
                side_attr_list()
        );
-       my_provider_event_dynamic_nested_struct_enabled = 1;
        side_event(my_provider_event_dynamic_nested_struct,
-               side_arg_list(side_arg_dynamic(side_arg_dynamic_struct(&mystruct))));
+               side_arg_list(side_arg_dynamic_struct(&mystruct)));
 }
 
-static side_define_event(my_provider_event_dynamic_vla_struct,
+side_static_event(my_provider_event_dynamic_vla_struct,
        "myprovider", "mydynamicvlastruct", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
-               side_field_dynamic("dynamic", side_attr_list()),
+               side_field_dynamic("dynamic"),
        ),
        side_attr_list()
 );
@@ -426,15 +452,14 @@ void test_dynamic_vla_struct(void)
                ),
                side_attr_list()
        );
-       my_provider_event_dynamic_vla_struct_enabled = 1;
        side_event(my_provider_event_dynamic_vla_struct,
-               side_arg_list(side_arg_dynamic(side_arg_dynamic_vla(&myvla))));
+               side_arg_list(side_arg_dynamic_vla(&myvla)));
 }
 
-static side_define_event(my_provider_event_dynamic_struct_vla,
+side_static_event(my_provider_event_dynamic_struct_vla,
        "myprovider", "mydynamicstructvla", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
-               side_field_dynamic("dynamic", side_attr_list()),
+               side_field_dynamic("dynamic"),
        ),
        side_attr_list()
 );
@@ -465,15 +490,14 @@ void test_dynamic_struct_vla(void)
                ),
                side_attr_list()
        );
-       my_provider_event_dynamic_struct_vla_enabled = 1;
        side_event(my_provider_event_dynamic_struct_vla,
-               side_arg_list(side_arg_dynamic(side_arg_dynamic_struct(&mystruct))));
+               side_arg_list(side_arg_dynamic_struct(&mystruct)));
 }
 
-static side_define_event(my_provider_event_dynamic_nested_vla,
+side_static_event(my_provider_event_dynamic_nested_vla,
        "myprovider", "mydynamicnestedvla", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
-               side_field_dynamic("dynamic", side_attr_list()),
+               side_field_dynamic("dynamic"),
        ),
        side_attr_list()
 );
@@ -504,12 +528,11 @@ void test_dynamic_nested_vla(void)
                ),
                side_attr_list()
        );
-       my_provider_event_dynamic_nested_vla_enabled = 1;
        side_event(my_provider_event_dynamic_nested_vla,
-               side_arg_list(side_arg_dynamic(side_arg_dynamic_vla(&myvla))));
+               side_arg_list(side_arg_dynamic_vla(&myvla)));
 }
 
-static side_define_event_variadic(my_provider_event_variadic,
+side_static_event_variadic(my_provider_event_variadic,
        "myprovider", "myvariadicevent", SIDE_LOGLEVEL_DEBUG,
        side_field_list(),
        side_attr_list()
@@ -518,7 +541,6 @@ static side_define_event_variadic(my_provider_event_variadic,
 static
 void test_variadic(void)
 {
-       my_provider_event_variadic_enabled = 1;
        side_event_variadic(my_provider_event_variadic,
                side_arg_list(),
                side_arg_list(
@@ -529,7 +551,7 @@ void test_variadic(void)
        );
 }
 
-static side_define_event_variadic(my_provider_event_static_variadic,
+side_static_event_variadic(my_provider_event_static_variadic,
        "myprovider", "mystaticvariadicevent", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_u32("abc", side_attr_list()),
@@ -541,7 +563,6 @@ static side_define_event_variadic(my_provider_event_static_variadic,
 static
 void test_static_variadic(void)
 {
-       my_provider_event_static_variadic_enabled = 1;
        side_event_variadic(my_provider_event_static_variadic,
                side_arg_list(
                        side_arg_u32(1),
@@ -555,7 +576,7 @@ void test_static_variadic(void)
        );
 }
 
-static side_define_event(my_provider_event_bool, "myprovider", "myeventbool", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_event_bool, "myprovider", "myeventbool", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_bool("a_false", side_attr_list()),
                side_field_bool("b_true", side_attr_list()),
@@ -579,7 +600,6 @@ void test_bool(void)
        bool f = false;
        uint32_t g = 256;
 
-       my_provider_event_bool_enabled = 1;
        side_event(my_provider_event_bool,
                side_arg_list(
                        side_arg_bool(a),
@@ -593,7 +613,7 @@ void test_bool(void)
        );
 }
 
-static side_define_event_variadic(my_provider_event_dynamic_bool,
+side_static_event_variadic(my_provider_event_dynamic_bool,
        "myprovider", "mydynamicbool", SIDE_LOGLEVEL_DEBUG,
        side_field_list(),
        side_attr_list()
@@ -602,7 +622,6 @@ static side_define_event_variadic(my_provider_event_dynamic_bool,
 static
 void test_dynamic_bool(void)
 {
-       my_provider_event_dynamic_bool_enabled = 1;
        side_event_variadic(my_provider_event_dynamic_bool,
                side_arg_list(),
                side_arg_list(
@@ -615,10 +634,10 @@ void test_dynamic_bool(void)
        );
 }
 
-static side_define_event(my_provider_event_dynamic_vla_visitor,
+side_static_event(my_provider_event_dynamic_vla_visitor,
        "myprovider", "mydynamicvlavisitor", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
-               side_field_dynamic("dynamic", side_attr_list()),
+               side_field_dynamic("dynamic"),
        ),
        side_attr_list()
 );
@@ -629,24 +648,13 @@ struct app_dynamic_vla_visitor_ctx {
 };
 
 static
-enum side_visitor_status test_dynamic_vla_visitor(const struct side_tracer_dynamic_vla_visitor_ctx *tracer_ctx, void *_ctx)
+enum side_visitor_status test_dynamic_vla_visitor(const struct side_tracer_visitor_ctx *tracer_ctx, void *_ctx)
 {
        struct app_dynamic_vla_visitor_ctx *ctx = (struct app_dynamic_vla_visitor_ctx *) _ctx;
        uint32_t length = ctx->length, i;
 
        for (i = 0; i < length; i++) {
-               const struct side_arg_dynamic_vec elem = {
-                       .dynamic_type = SIDE_DYNAMIC_TYPE_U32,
-                       .u = {
-                               .side_basic = {
-                                       .attr = NULL,
-                                       .nr_attr = 0,
-                                       .u = {
-                                               .side_u32 = ctx->ptr[i],
-                                       },
-                               },
-                       },
-               };
+               const struct side_arg elem = side_arg_dynamic_u32(ctx->ptr[i], side_attr_list());
                if (tracer_ctx->write_elem(tracer_ctx, &elem) != SIDE_VISITOR_STATUS_OK)
                        return SIDE_VISITOR_STATUS_ERROR;
        }
@@ -658,7 +666,6 @@ static uint32_t testarray_dynamic_vla[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
 static
 void test_dynamic_vla_with_visitor(void)
 {
-       my_provider_event_dynamic_vla_visitor_enabled = 1;
        side_event_cond(my_provider_event_dynamic_vla_visitor) {
                struct app_dynamic_vla_visitor_ctx ctx = {
                        .ptr = testarray_dynamic_vla,
@@ -666,18 +673,16 @@ void test_dynamic_vla_with_visitor(void)
                };
                side_event_call(my_provider_event_dynamic_vla_visitor,
                        side_arg_list(
-                               side_arg_dynamic(
-                                       side_arg_dynamic_vla_visitor(test_dynamic_vla_visitor, &ctx, side_attr_list())
-                               )
+                               side_arg_dynamic_vla_visitor(test_dynamic_vla_visitor, &ctx, side_attr_list())
                        )
                );
        }
 }
 
-static side_define_event(my_provider_event_dynamic_struct_visitor,
+side_static_event(my_provider_event_dynamic_struct_visitor,
        "myprovider", "mydynamicstructvisitor", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
-               side_field_dynamic("dynamic", side_attr_list()),
+               side_field_dynamic("dynamic"),
        ),
        side_attr_list()
 );
@@ -699,20 +704,9 @@ enum side_visitor_status test_dynamic_struct_visitor(const struct side_tracer_dy
        uint32_t length = ctx->length, i;
 
        for (i = 0; i < length; i++) {
-               struct side_arg_dynamic_event_field dynamic_field = {
+               struct side_arg_dynamic_field dynamic_field = {
                        .field_name = ctx->ptr[i].name,
-                       .elem = {
-                               .dynamic_type = SIDE_DYNAMIC_TYPE_U32,
-                               .u = {
-                                       .side_basic = {
-                                               .nr_attr = 0,
-                                               .attr = NULL,
-                                               .u = {
-                                                       .side_u32 = ctx->ptr[i].value,
-                                               },
-                                       },
-                               },
-                       },
+                       .elem = side_arg_dynamic_u32(ctx->ptr[i].value, side_attr_list()),
                };
                if (tracer_ctx->write_field(tracer_ctx, &dynamic_field) != SIDE_VISITOR_STATUS_OK)
                        return SIDE_VISITOR_STATUS_ERROR;
@@ -730,7 +724,6 @@ static struct struct_visitor_pair testarray_dynamic_struct[] = {
 static
 void test_dynamic_struct_with_visitor(void)
 {
-       my_provider_event_dynamic_struct_visitor_enabled = 1;
        side_event_cond(my_provider_event_dynamic_struct_visitor) {
                struct app_dynamic_struct_visitor_ctx ctx = {
                        .ptr = testarray_dynamic_struct,
@@ -738,15 +731,13 @@ void test_dynamic_struct_with_visitor(void)
                };
                side_event_call(my_provider_event_dynamic_struct_visitor,
                        side_arg_list(
-                               side_arg_dynamic(
-                                       side_arg_dynamic_struct_visitor(test_dynamic_struct_visitor, &ctx, side_attr_list())
-                               )
+                               side_arg_dynamic_struct_visitor(test_dynamic_struct_visitor, &ctx, side_attr_list())
                        )
                );
        }
 }
 
-static side_define_event(my_provider_event_user_attribute, "myprovider", "myevent_user_attribute", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_event_user_attribute, "myprovider", "myevent_user_attribute", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_u32("abc", side_attr_list()),
                side_field_s64("def", side_attr_list()),
@@ -760,11 +751,10 @@ static side_define_event(my_provider_event_user_attribute, "myprovider", "myeven
 static
 void test_event_user_attribute(void)
 {
-       my_provider_event_user_attribute_enabled = 1;
        side_event(my_provider_event_user_attribute, side_arg_list(side_arg_u32(1), side_arg_s64(2)));
 }
 
-static side_define_event(my_provider_field_user_attribute, "myprovider", "myevent_field_attribute", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_field_user_attribute, "myprovider", "myevent_field_attribute", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_u32("abc",
                        side_attr_list(
@@ -785,11 +775,10 @@ static side_define_event(my_provider_field_user_attribute, "myprovider", "myeven
 static
 void test_field_user_attribute(void)
 {
-       my_provider_field_user_attribute_enabled = 1;
        side_event(my_provider_field_user_attribute, side_arg_list(side_arg_u32(1), side_arg_s64(2)));
 }
 
-static side_define_event_variadic(my_provider_event_variadic_attr,
+side_static_event_variadic(my_provider_event_variadic_attr,
        "myprovider", "myvariadiceventattr", SIDE_LOGLEVEL_DEBUG,
        side_field_list(),
        side_attr_list()
@@ -798,7 +787,6 @@ static side_define_event_variadic(my_provider_event_variadic_attr,
 static
 void test_variadic_attr(void)
 {
-       my_provider_event_variadic_attr_enabled = 1;
        side_event_variadic(my_provider_event_variadic_attr,
                side_arg_list(),
                side_arg_list(
@@ -823,7 +811,7 @@ void test_variadic_attr(void)
        );
 }
 
-static side_define_event_variadic(my_provider_event_variadic_vla_attr,
+side_static_event_variadic(my_provider_event_variadic_vla_attr,
        "myprovider", "myvariadiceventvlaattr", SIDE_LOGLEVEL_DEBUG,
        side_field_list(),
        side_attr_list()
@@ -848,7 +836,6 @@ void test_variadic_vla_attr(void)
                        side_attr("Y", side_attr_u8(2)),
                )
        );
-       my_provider_event_variadic_vla_attr_enabled = 1;
        side_event_variadic(my_provider_event_variadic_vla_attr,
                side_arg_list(),
                side_arg_list(
@@ -858,7 +845,7 @@ void test_variadic_vla_attr(void)
        );
 }
 
-static side_define_event_variadic(my_provider_event_variadic_struct_attr,
+side_static_event_variadic(my_provider_event_variadic_struct_attr,
        "myprovider", "myvariadiceventstructattr", SIDE_LOGLEVEL_DEBUG,
        side_field_list(),
        side_attr_list()
@@ -867,7 +854,6 @@ static side_define_event_variadic(my_provider_event_variadic_struct_attr,
 static
 void test_variadic_struct_attr(void)
 {
-       my_provider_event_variadic_struct_attr_enabled = 1;
        side_event_cond(my_provider_event_variadic_struct_attr) {
                side_arg_dynamic_define_struct(mystruct,
                        side_arg_list(
@@ -895,19 +881,27 @@ void test_variadic_struct_attr(void)
        }
 }
 
-static side_define_event(my_provider_event_float, "myprovider", "myeventfloat", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_event_float, "myprovider", "myeventfloat", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
 #if __HAVE_FLOAT16
                side_field_float_binary16("binary16", side_attr_list()),
+               side_field_float_binary16_le("binary16_le", side_attr_list()),
+               side_field_float_binary16_be("binary16_be", side_attr_list()),
 #endif
 #if __HAVE_FLOAT32
                side_field_float_binary32("binary32", side_attr_list()),
+               side_field_float_binary32_le("binary32_le", side_attr_list()),
+               side_field_float_binary32_be("binary32_be", side_attr_list()),
 #endif
 #if __HAVE_FLOAT64
                side_field_float_binary64("binary64", side_attr_list()),
+               side_field_float_binary64_le("binary64_le", side_attr_list()),
+               side_field_float_binary64_be("binary64_be", side_attr_list()),
 #endif
 #if __HAVE_FLOAT128
                side_field_float_binary128("binary128", side_attr_list()),
+               side_field_float_binary128_le("binary128_le", side_attr_list()),
+               side_field_float_binary128_be("binary128_be", side_attr_list()),
 #endif
        ),
        side_attr_list()
@@ -916,26 +910,99 @@ static side_define_event(my_provider_event_float, "myprovider", "myeventfloat",
 static
 void test_float(void)
 {
-       my_provider_event_float_enabled = 1;
+#if __HAVE_FLOAT16
+       union {
+               _Float16 f;
+               uint16_t u;
+       } float16 = {
+               .f = 1.1,
+       };
+#endif
+#if __HAVE_FLOAT32
+       union {
+               _Float32 f;
+               uint32_t u;
+       } float32 = {
+               .f = 2.2,
+       };
+#endif
+#if __HAVE_FLOAT64
+       union {
+               _Float64 f;
+               uint64_t u;
+       } float64 = {
+               .f = 3.3,
+       };
+#endif
+#if __HAVE_FLOAT128
+       union {
+               _Float128 f;
+               char arr[16];
+       } float128 = {
+               .f = 4.4,
+       };
+#endif
+
+#if __HAVE_FLOAT16
+       float16.u = side_bswap_16(float16.u);
+#endif
+#if __HAVE_FLOAT32
+       float32.u = side_bswap_32(float32.u);
+#endif
+#if __HAVE_FLOAT64
+       float64.u = side_bswap_64(float64.u);
+#endif
+#if __HAVE_FLOAT128
+       side_bswap_128p(float128.arr);
+#endif
+
        side_event(my_provider_event_float,
                side_arg_list(
 #if __HAVE_FLOAT16
                        side_arg_float_binary16(1.1),
+# if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
+                       side_arg_float_binary16(1.1),
+                       side_arg_float_binary16(float16.f),
+# else
+                       side_arg_float_binary16(float16.f),
+                       side_arg_float_binary16(1.1),
+# endif
 #endif
 #if __HAVE_FLOAT32
                        side_arg_float_binary32(2.2),
+# if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
+                       side_arg_float_binary32(2.2),
+                       side_arg_float_binary32(float32.f),
+# else
+                       side_arg_float_binary32(float32.f),
+                       side_arg_float_binary32(2.2),
+# endif
 #endif
 #if __HAVE_FLOAT64
                        side_arg_float_binary64(3.3),
+# if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
+                       side_arg_float_binary64(3.3),
+                       side_arg_float_binary64(float64.f),
+# else
+                       side_arg_float_binary64(float64.f),
+                       side_arg_float_binary64(3.3),
+# endif
 #endif
 #if __HAVE_FLOAT128
                        side_arg_float_binary128(4.4),
+# if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
+                       side_arg_float_binary128(4.4),
+                       side_arg_float_binary128(float128.f),
+# else
+                       side_arg_float_binary128(float128.f),
+                       side_arg_float_binary128(4.4),
+# endif
 #endif
                )
        );
 }
 
-static side_define_event_variadic(my_provider_event_variadic_float,
+side_static_event_variadic(my_provider_event_variadic_float,
        "myprovider", "myvariadicfloat", SIDE_LOGLEVEL_DEBUG,
        side_field_list(),
        side_attr_list()
@@ -944,29 +1011,94 @@ static side_define_event_variadic(my_provider_event_variadic_float,
 static
 void test_variadic_float(void)
 {
-       my_provider_event_variadic_float_enabled = 1;
+#if __HAVE_FLOAT16
+       union {
+               _Float16 f;
+               uint16_t u;
+       } float16 = {
+               .f = 1.1,
+       };
+#endif
+#if __HAVE_FLOAT32
+       union {
+               _Float32 f;
+               uint32_t u;
+       } float32 = {
+               .f = 2.2,
+       };
+#endif
+#if __HAVE_FLOAT64
+       union {
+               _Float64 f;
+               uint64_t u;
+       } float64 = {
+               .f = 3.3,
+       };
+#endif
+#if __HAVE_FLOAT128
+       union {
+               _Float128 f;
+               char arr[16];
+       } float128 = {
+               .f = 4.4,
+       };
+#endif
+
+#if __HAVE_FLOAT16
+       float16.u = side_bswap_16(float16.u);
+#endif
+#if __HAVE_FLOAT32
+       float32.u = side_bswap_32(float32.u);
+#endif
+#if __HAVE_FLOAT64
+       float64.u = side_bswap_64(float64.u);
+#endif
+#if __HAVE_FLOAT128
+       side_bswap_128p(float128.arr);
+#endif
+
        side_event_variadic(my_provider_event_variadic_float,
                side_arg_list(),
                side_arg_list(
 #if __HAVE_FLOAT16
-                       side_arg_dynamic_field("binary16",
-                               side_arg_dynamic_float_binary16(1.1, side_attr_list())
-                       ),
+                       side_arg_dynamic_field("binary16", side_arg_dynamic_float_binary16(1.1, side_attr_list())),
+# if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
+                       side_arg_dynamic_field("binary16_le", side_arg_dynamic_float_binary16_le(1.1, side_attr_list())),
+                       side_arg_dynamic_field("binary16_be", side_arg_dynamic_float_binary16_be(float16.f, side_attr_list())),
+# else
+                       side_arg_dynamic_field("binary16_le", side_arg_dynamic_float_binary16_le(float16.f, side_attr_list())),
+                       side_arg_dynamic_field("binary16_be", side_arg_dynamic_float_binary16_be(1.1, side_attr_list())),
+# endif
 #endif
 #if __HAVE_FLOAT32
-                       side_arg_dynamic_field("binary32",
-                               side_arg_dynamic_float_binary32(2.2, side_attr_list())
-                       ),
+                       side_arg_dynamic_field("binary32", side_arg_dynamic_float_binary32(2.2, side_attr_list())),
+# if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
+                       side_arg_dynamic_field("binary32_le", side_arg_dynamic_float_binary32_le(2.2, side_attr_list())),
+                       side_arg_dynamic_field("binary32_be", side_arg_dynamic_float_binary32_be(float32.f, side_attr_list())),
+# else
+                       side_arg_dynamic_field("binary32_le", side_arg_dynamic_float_binary32_le(float32.f, side_attr_list())),
+                       side_arg_dynamic_field("binary32_be", side_arg_dynamic_float_binary32_be(2.2, side_attr_list())),
+# endif
 #endif
 #if __HAVE_FLOAT64
-                       side_arg_dynamic_field("binary64",
-                               side_arg_dynamic_float_binary64(3.3, side_attr_list())
-                       ),
+                       side_arg_dynamic_field("binary64", side_arg_dynamic_float_binary64(3.3, side_attr_list())),
+# if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
+                       side_arg_dynamic_field("binary64_le", side_arg_dynamic_float_binary64_le(3.3, side_attr_list())),
+                       side_arg_dynamic_field("binary64_be", side_arg_dynamic_float_binary64_be(float64.f, side_attr_list())),
+# else
+                       side_arg_dynamic_field("binary64_le", side_arg_dynamic_float_binary64_le(float64.f, side_attr_list())),
+                       side_arg_dynamic_field("binary64_be", side_arg_dynamic_float_binary64_be(3.3, side_attr_list())),
+# endif
 #endif
 #if __HAVE_FLOAT128
-                       side_arg_dynamic_field("binary128",
-                               side_arg_dynamic_float_binary128(4.4, side_attr_list())
-                       ),
+                       side_arg_dynamic_field("binary128", side_arg_dynamic_float_binary128(4.4, side_attr_list())),
+# if SIDE_FLOAT_WORD_ORDER == SIDE_LITTLE_ENDIAN
+                       side_arg_dynamic_field("binary128_le", side_arg_dynamic_float_binary128_le(4.4, side_attr_list())),
+                       side_arg_dynamic_field("binary128_be", side_arg_dynamic_float_binary128_be(float128.f, side_attr_list())),
+# else
+                       side_arg_dynamic_field("binary128_le", side_arg_dynamic_float_binary128_le(float128.f, side_attr_list())),
+                       side_arg_dynamic_field("binary128_be", side_arg_dynamic_float_binary128_be(4.4, side_attr_list())),
+# endif
 #endif
                ),
                side_attr_list()
@@ -983,12 +1115,14 @@ static side_define_enum(myenum,
        side_attr_list()
 );
 
-static side_define_event(my_provider_event_enum, "myprovider", "myeventenum", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_event_enum, "myprovider", "myeventenum", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_enum("5", &myenum, side_elem(side_type_u32(side_attr_list()))),
                side_field_enum("400", &myenum, side_elem(side_type_u64(side_attr_list()))),
                side_field_enum("200", &myenum, side_elem(side_type_u8(side_attr_list()))),
                side_field_enum("-100", &myenum, side_elem(side_type_s8(side_attr_list()))),
+               side_field_enum("6_be", &myenum, side_elem(side_type_u32_be(side_attr_list()))),
+               side_field_enum("6_le", &myenum, side_elem(side_type_u32_le(side_attr_list()))),
        ),
        side_attr_list()
 );
@@ -996,13 +1130,19 @@ static side_define_event(my_provider_event_enum, "myprovider", "myeventenum", SI
 static
 void test_enum(void)
 {
-       my_provider_event_enum_enabled = 1;
        side_event(my_provider_event_enum,
                side_arg_list(
                        side_arg_u32(5),
                        side_arg_u64(400),
                        side_arg_u8(200),
                        side_arg_s8(-100),
+#if SIDE_BYTE_ORDER == SIDE_LITTLE_ENDIAN
+                       side_arg_u32(side_bswap_32(6)),
+                       side_arg_u32(6),
+#else
+                       side_arg_u32(side_bswap_32(6)),
+                       side_arg_u32(6),
+#endif
                )
        );
 }
@@ -1023,7 +1163,7 @@ static side_define_enum_bitmap(myenum_bitmap,
        side_attr_list()
 );
 
-static side_define_event(my_provider_event_enum_bitmap, "myprovider", "myeventenumbitmap", SIDE_LOGLEVEL_DEBUG,
+side_static_event(my_provider_event_enum_bitmap, "myprovider", "myeventenumbitmap", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_enum_bitmap("bit_0", &myenum_bitmap, side_elem(side_type_u32(side_attr_list()))),
                side_field_enum_bitmap("bit_1", &myenum_bitmap, side_elem(side_type_u32(side_attr_list()))),
@@ -1033,10 +1173,13 @@ static side_define_event(my_provider_event_enum_bitmap, "myprovider", "myeventen
                side_field_enum_bitmap("bit_31", &myenum_bitmap, side_elem(side_type_u32(side_attr_list()))),
                side_field_enum_bitmap("bit_63", &myenum_bitmap, side_elem(side_type_u64(side_attr_list()))),
                side_field_enum_bitmap("bits_1+63", &myenum_bitmap, side_elem(side_type_u64(side_attr_list()))),
+               side_field_enum_bitmap("byte_bit_2", &myenum_bitmap, side_elem(side_type_byte(side_attr_list()))),
                side_field_enum_bitmap("bit_159", &myenum_bitmap,
                        side_elem(side_type_array(side_elem(side_type_u32(side_attr_list())), 5, side_attr_list()))),
                side_field_enum_bitmap("bit_159", &myenum_bitmap,
                        side_elem(side_type_vla(side_elem(side_type_u32(side_attr_list())), side_attr_list()))),
+               side_field_enum_bitmap("bit_2_be", &myenum_bitmap, side_elem(side_type_u32_be(side_attr_list()))),
+               side_field_enum_bitmap("bit_2_le", &myenum_bitmap, side_elem(side_type_u32_le(side_attr_list()))),
        ),
        side_attr_list()
 );
@@ -1044,7 +1187,6 @@ static side_define_event(my_provider_event_enum_bitmap, "myprovider", "myeventen
 static
 void test_enum_bitmap(void)
 {
-       my_provider_event_enum_bitmap_enabled = 1;
        side_event_cond(my_provider_event_enum_bitmap) {
                side_arg_define_vec(myarray,
                        side_arg_list(
@@ -1057,16 +1199,24 @@ void test_enum_bitmap(void)
                );
                side_event_call(my_provider_event_enum_bitmap,
                        side_arg_list(
-                               side_arg_u32(1 << 0),
-                               side_arg_u32(1 << 1),
-                               side_arg_u8(1 << 2),
-                               side_arg_u8(1 << 3),
-                               side_arg_u32(1 << 30),
-                               side_arg_u32(1 << 31),
+                               side_arg_u32(1U << 0),
+                               side_arg_u32(1U << 1),
+                               side_arg_u8(1U << 2),
+                               side_arg_u8(1U << 3),
+                               side_arg_u32(1U << 30),
+                               side_arg_u32(1U << 31),
                                side_arg_u64(1ULL << 63),
                                side_arg_u64((1ULL << 1) | (1ULL << 63)),
+                               side_arg_byte(1U << 2),
                                side_arg_array(&myarray),
                                side_arg_vla(&myarray),
+#if SIDE_BYTE_ORDER == SIDE_LITTLE_ENDIAN
+                               side_arg_u32(side_bswap_32(1U << 2)),
+                               side_arg_u32(1U << 2),
+#else
+                               side_arg_u32(0x06000000),
+                               side_arg_u32(side_bswap_32(1U << 2)),
+#endif
                        )
                );
        }
@@ -1074,12 +1224,12 @@ void test_enum_bitmap(void)
 
 static uint8_t blob_fixint[] = { 0x55, 0x44, 0x33, 0x22, 0x11 };
 
-static side_define_event_variadic(my_provider_event_blob, "myprovider", "myeventblob", SIDE_LOGLEVEL_DEBUG,
+side_static_event_variadic(my_provider_event_blob, "myprovider", "myeventblob", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
-               side_field_blob("blobfield", side_attr_list()),
-               side_field_array("arrayblob", side_elem(side_type_blob(side_attr_list())), 3, side_attr_list()),
-               side_field_array("arrayblobfix", side_elem(side_type_blob(side_attr_list())), SIDE_ARRAY_SIZE(blob_fixint), side_attr_list()),
-               side_field_vla("vlablobfix", side_elem(side_type_blob(side_attr_list())), side_attr_list()),
+               side_field_byte("blobfield", side_attr_list()),
+               side_field_array("arrayblob", side_elem(side_type_byte(side_attr_list())), 3, side_attr_list()),
+               side_field_array("arrayblobfix", side_elem(side_type_byte(side_attr_list())), SIDE_ARRAY_SIZE(blob_fixint), side_attr_list()),
+               side_field_vla("vlablobfix", side_elem(side_type_byte(side_attr_list())), side_attr_list()),
        ),
        side_attr_list()
 );
@@ -1087,26 +1237,25 @@ static side_define_event_variadic(my_provider_event_blob, "myprovider", "myevent
 static
 void test_blob(void)
 {
-       my_provider_event_blob_enabled = 1;
        side_event_cond(my_provider_event_blob) {
-               side_arg_define_vec(myarray, side_arg_list(side_arg_blob(1), side_arg_blob(2), side_arg_blob(3)));
+               side_arg_define_vec(myarray, side_arg_list(side_arg_byte(1), side_arg_byte(2), side_arg_byte(3)));
                side_arg_dynamic_define_vec(myvla,
                        side_arg_list(
-                               side_arg_dynamic_blob(0x22, side_attr_list()),
-                               side_arg_dynamic_blob(0x33, side_attr_list()),
+                               side_arg_dynamic_byte(0x22, side_attr_list()),
+                               side_arg_dynamic_byte(0x33, side_attr_list()),
                        ),
                        side_attr_list()
                );
                side_event_call_variadic(my_provider_event_blob,
                        side_arg_list(
-                               side_arg_blob(0x55),
+                               side_arg_byte(0x55),
                                side_arg_array(&myarray),
-                               side_arg_array_blob(blob_fixint),
-                               side_arg_vla_blob(blob_fixint, SIDE_ARRAY_SIZE(blob_fixint)),
+                               side_arg_array_byte(blob_fixint),
+                               side_arg_vla_byte(blob_fixint, SIDE_ARRAY_SIZE(blob_fixint)),
                        ),
                        side_arg_list(
                                side_arg_dynamic_field("varblobfield",
-                                       side_arg_dynamic_blob(0x55, side_attr_list())
+                                       side_arg_dynamic_byte(0x55, side_attr_list())
                                ),
                                side_arg_dynamic_field("varblobvla", side_arg_dynamic_vla(&myvla)),
                        ),
@@ -1115,7 +1264,7 @@ void test_blob(void)
        }
 }
 
-static side_define_event_variadic(my_provider_event_format_string,
+side_static_event_variadic(my_provider_event_format_string,
        "myprovider", "myeventformatstring", SIDE_LOGLEVEL_DEBUG,
        side_field_list(
                side_field_string("fmt", side_attr_list()),
@@ -1128,7 +1277,6 @@ static side_define_event_variadic(my_provider_event_format_string,
 static
 void test_fmt_string(void)
 {
-       my_provider_event_format_string_enabled = 1;
        side_event_cond(my_provider_event_format_string) {
                side_arg_dynamic_define_vec(args,
                        side_arg_list(
@@ -1149,9 +1297,715 @@ void test_fmt_string(void)
        }
 }
 
+side_static_event_variadic(my_provider_event_endian, "myprovider", "myevent_endian", SIDE_LOGLEVEL_DEBUG,
+       side_field_list(
+               side_field_u16_le("u16_le", side_attr_list()),
+               side_field_u32_le("u32_le", side_attr_list()),
+               side_field_u64_le("u64_le", side_attr_list()),
+               side_field_s16_le("s16_le", side_attr_list()),
+               side_field_s32_le("s32_le", side_attr_list()),
+               side_field_s64_le("s64_le", side_attr_list()),
+               side_field_u16_be("u16_be", side_attr_list()),
+               side_field_u32_be("u32_be", side_attr_list()),
+               side_field_u64_be("u64_be", side_attr_list()),
+               side_field_s16_be("s16_be", side_attr_list()),
+               side_field_s32_be("s32_be", side_attr_list()),
+               side_field_s64_be("s64_be", side_attr_list()),
+       ),
+       side_attr_list()
+);
+
+static
+void test_endian(void)
+{
+       side_event_variadic(my_provider_event_endian,
+               side_arg_list(
+#if SIDE_BYTE_ORDER == SIDE_LITTLE_ENDIAN
+                       side_arg_u16(1),
+                       side_arg_u32(1),
+                       side_arg_u64(1),
+                       side_arg_s16(1),
+                       side_arg_s32(1),
+                       side_arg_s64(1),
+                       side_arg_u16(side_bswap_16(1)),
+                       side_arg_u32(side_bswap_32(1)),
+                       side_arg_u64(side_bswap_64(1)),
+                       side_arg_s16(side_bswap_16(1)),
+                       side_arg_s32(side_bswap_32(1)),
+                       side_arg_s64(side_bswap_64(1)),
+#else
+                       side_arg_u16(side_bswap_16(1)),
+                       side_arg_u32(side_bswap_32(1)),
+                       side_arg_u64(side_bswap_64(1)),
+                       side_arg_s16(side_bswap_16(1)),
+                       side_arg_s32(side_bswap_32(1)),
+                       side_arg_s64(side_bswap_64(1)),
+                       side_arg_u16(1),
+                       side_arg_u32(1),
+                       side_arg_u64(1),
+                       side_arg_s16(1),
+                       side_arg_s32(1),
+                       side_arg_s64(1),
+#endif
+               ),
+               side_arg_list(
+#if SIDE_BYTE_ORDER == SIDE_LITTLE_ENDIAN
+                       side_arg_dynamic_field("u16_le", side_arg_dynamic_u16_le(1, side_attr_list())),
+                       side_arg_dynamic_field("u32_le", side_arg_dynamic_u32_le(1, side_attr_list())),
+                       side_arg_dynamic_field("u64_le", side_arg_dynamic_u64_le(1, side_attr_list())),
+                       side_arg_dynamic_field("s16_le", side_arg_dynamic_s16_le(1, side_attr_list())),
+                       side_arg_dynamic_field("s32_le", side_arg_dynamic_s32_le(1, side_attr_list())),
+                       side_arg_dynamic_field("s64_le", side_arg_dynamic_s64_le(1, side_attr_list())),
+                       side_arg_dynamic_field("u16_be", side_arg_dynamic_u16_be(side_bswap_16(1), side_attr_list())),
+                       side_arg_dynamic_field("u32_be", side_arg_dynamic_u32_be(side_bswap_32(1), side_attr_list())),
+                       side_arg_dynamic_field("u64_be", side_arg_dynamic_u64_be(side_bswap_64(1), side_attr_list())),
+                       side_arg_dynamic_field("s16_be", side_arg_dynamic_s16_be(side_bswap_16(1), side_attr_list())),
+                       side_arg_dynamic_field("s32_be", side_arg_dynamic_s32_be(side_bswap_32(1), side_attr_list())),
+                       side_arg_dynamic_field("s64_be", side_arg_dynamic_s64_be(side_bswap_64(1), side_attr_list())),
+#else
+                       side_arg_dynamic_field("u16_le", side_arg_dynamic_u16_le(side_bswap_16(1), side_attr_list())),
+                       side_arg_dynamic_field("u32_le", side_arg_dynamic_u32_le(side_bswap_32(1), side_attr_list())),
+                       side_arg_dynamic_field("u64_le", side_arg_dynamic_u64_le(side_bswap_64(1), side_attr_list())),
+                       side_arg_dynamic_field("s16_le", side_arg_dynamic_s16_le(side_bswap_16(1), side_attr_list())),
+                       side_arg_dynamic_field("s32_le", side_arg_dynamic_s32_le(side_bswap_32(1), side_attr_list())),
+                       side_arg_dynamic_field("s64_le", side_arg_dynamic_s64_le(side_bswap_64(1), side_attr_list())),
+                       side_arg_dynamic_field("u16_be", side_arg_dynamic_u16_be(1, side_attr_list())),
+                       side_arg_dynamic_field("u32_be", side_arg_dynamic_u32_be(1, side_attr_list())),
+                       side_arg_dynamic_field("u64_be", side_arg_dynamic_u64_be(1, side_attr_list())),
+                       side_arg_dynamic_field("s16_be", side_arg_dynamic_s16_be(1, side_attr_list())),
+                       side_arg_dynamic_field("s32_be", side_arg_dynamic_s32_be(1, side_attr_list())),
+                       side_arg_dynamic_field("s64_be", side_arg_dynamic_s64_be(1, side_attr_list())),
+#endif
+               ),
+               side_attr_list()
+       );
+}
+
+side_static_event(my_provider_event_base, "myprovider", "myevent_base", SIDE_LOGLEVEL_DEBUG,
+       side_field_list(
+               side_field_u8("u8base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
+               side_field_u8("u8base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
+               side_field_u8("u8base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+               side_field_u8("u8base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
+               side_field_u16("u16base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
+               side_field_u16("u16base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
+               side_field_u16("u16base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+               side_field_u16("u16base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
+               side_field_u32("u32base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
+               side_field_u32("u32base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
+               side_field_u32("u32base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+               side_field_u32("u32base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
+               side_field_u64("u64base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
+               side_field_u64("u64base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
+               side_field_u64("u64base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+               side_field_u64("u64base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
+               side_field_s8("s8base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
+               side_field_s8("s8base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
+               side_field_s8("s8base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+               side_field_s8("s8base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
+               side_field_s16("s16base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
+               side_field_s16("s16base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
+               side_field_s16("s16base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+               side_field_s16("s16base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
+               side_field_s32("s32base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
+               side_field_s32("s32base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
+               side_field_s32("s32base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+               side_field_s32("s32base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
+               side_field_s64("s64base2", side_attr_list(side_attr("std.integer.base", side_attr_u8(2)))),
+               side_field_s64("s64base8", side_attr_list(side_attr("std.integer.base", side_attr_u8(8)))),
+               side_field_s64("s64base10", side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+               side_field_s64("s64base16", side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
+       ),
+       side_attr_list()
+);
+
+static
+void test_base(void)
+{
+       side_event(my_provider_event_base,
+               side_arg_list(
+                       side_arg_u8(55),
+                       side_arg_u8(55),
+                       side_arg_u8(55),
+                       side_arg_u8(55),
+                       side_arg_u16(55),
+                       side_arg_u16(55),
+                       side_arg_u16(55),
+                       side_arg_u16(55),
+                       side_arg_u32(55),
+                       side_arg_u32(55),
+                       side_arg_u32(55),
+                       side_arg_u32(55),
+                       side_arg_u64(55),
+                       side_arg_u64(55),
+                       side_arg_u64(55),
+                       side_arg_u64(55),
+                       side_arg_s8(-55),
+                       side_arg_s8(-55),
+                       side_arg_s8(-55),
+                       side_arg_s8(-55),
+                       side_arg_s16(-55),
+                       side_arg_s16(-55),
+                       side_arg_s16(-55),
+                       side_arg_s16(-55),
+                       side_arg_s32(-55),
+                       side_arg_s32(-55),
+                       side_arg_s32(-55),
+                       side_arg_s32(-55),
+                       side_arg_s64(-55),
+                       side_arg_s64(-55),
+                       side_arg_s64(-55),
+                       side_arg_s64(-55),
+               )
+       );
+}
+
+struct test {
+       uint32_t a;
+       uint64_t b;
+       uint8_t c;
+       int32_t d;
+       uint16_t e;
+       int8_t f;
+       int16_t g;
+       int32_t h;
+       int64_t i;
+       int64_t j;
+       int64_t k;
+       uint64_t test;
+};
+
+static side_define_struct(mystructgatherdef,
+       side_field_list(
+               side_field_gather_unsigned_integer("a", offsetof(struct test, a),
+                       side_struct_field_sizeof_bit(struct test, a), 0,
+                       side_struct_field_sizeof_bit(struct test, a), SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list()),
+               side_field_gather_signed_integer("d", offsetof(struct test, d),
+                       side_struct_field_sizeof_bit(struct test, d), 0,
+                       side_struct_field_sizeof_bit(struct test, d), SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list()),
+               side_field_gather_unsigned_integer("e", offsetof(struct test, e),
+                       side_struct_field_sizeof_bit(struct test, e), 8, 4,
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
+               side_field_gather_signed_integer("f", offsetof(struct test, f),
+                       side_struct_field_sizeof_bit(struct test, f), 1, 4,
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+               side_field_gather_signed_integer("g", offsetof(struct test, g),
+                       side_struct_field_sizeof_bit(struct test, g), 11, 4,
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+               side_field_gather_signed_integer("h", offsetof(struct test, h),
+                       side_struct_field_sizeof_bit(struct test, h), 1, 31,
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+               side_field_gather_signed_integer("i", offsetof(struct test, i),
+                       side_struct_field_sizeof_bit(struct test, i), 33, 20,
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+               side_field_gather_signed_integer("j", offsetof(struct test, j),
+                       side_struct_field_sizeof_bit(struct test, j), 63, 1,
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+               side_field_gather_signed_integer("k", offsetof(struct test, k), 
+                       side_struct_field_sizeof_bit(struct test, k), 1, 63,
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+               side_field_gather_unsigned_integer_le("test", offsetof(struct test, test),
+                       side_struct_field_sizeof_bit(struct test, test), 0, 64,
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
+               side_field_gather_unsigned_integer_le("test_le", offsetof(struct test, test),
+                       side_struct_field_sizeof_bit(struct test, test), 0, 64,
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
+               side_field_gather_unsigned_integer_be("test_be", offsetof(struct test, test),
+                       side_struct_field_sizeof_bit(struct test, test), 0, 64,
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list(side_attr("std.integer.base", side_attr_u8(16)))),
+       ),
+       side_attr_list()
+);
+
+side_static_event(my_provider_event_structgather, "myprovider", "myeventstructgather", SIDE_LOGLEVEL_DEBUG,
+       side_field_list(
+               side_field_gather_struct("structgather", &mystructgatherdef, 0, sizeof(struct test),
+                               SIDE_TYPE_GATHER_ACCESS_POINTER),
+               side_field_gather_signed_integer("intgather", 0, 32, 0, 32, SIDE_TYPE_GATHER_ACCESS_ADDRESS,
+                       side_attr_list(side_attr("std.integer.base", side_attr_u8(10)))),
+#if __HAVE_FLOAT32
+               side_field_gather_float("f32", 0, 32, SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list()),
+#endif
+       ),
+       side_attr_list()
+);
+
+static
+void test_struct_gather(void)
+{
+       side_event_cond(my_provider_event_structgather) {
+               struct test mystruct = {
+                       .a = 55,
+                       .b = 123,
+                       .c = 2,
+                       .d = -55,
+                       .e = 0xABCD,
+                       .f = -1,
+                       .g = -1,
+                       .h = -1,
+                       .i = -1,
+                       .j = -1,
+                       .k = -1,
+                       .test = 0xFF,
+               };
+               int32_t val = -66;
+#if __HAVE_FLOAT32
+               _Float32 f32 = 1.1;
+#endif
+               side_event_call(my_provider_event_structgather,
+                       side_arg_list(
+                               side_arg_gather_struct(&mystruct),
+                               side_arg_gather_signed_integer(&val),
+#if __HAVE_FLOAT32
+                               side_arg_gather_float(&f32),
+#endif
+                       )
+               );
+       }
+}
+
+struct testnest2 {
+       uint8_t c;
+};
+
+struct testnest1 {
+       uint64_t b;
+       struct testnest2 *nest;
+};
+
+struct testnest0 {
+       uint32_t a;
+       struct testnest1 *nest;
+};
+
+static side_define_struct(mystructgathernest2,
+       side_field_list(
+               side_field_gather_unsigned_integer("c", offsetof(struct testnest2, c),
+                       side_struct_field_sizeof_bit(struct testnest2, c), 0,
+                       side_struct_field_sizeof_bit(struct testnest2, c), SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list()),
+       ),
+       side_attr_list()
+);
+
+static side_define_struct(mystructgathernest1,
+       side_field_list(
+               side_field_gather_unsigned_integer("b", offsetof(struct testnest1, b),
+                       side_struct_field_sizeof_bit(struct testnest1, b), 0,
+                       side_struct_field_sizeof_bit(struct testnest1, b), SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list()),
+               side_field_gather_struct("nest2", &mystructgathernest2,
+                       offsetof(struct testnest1, nest), sizeof(struct testnest2),
+                       SIDE_TYPE_GATHER_ACCESS_POINTER),
+       ),
+       side_attr_list()
+);
+
+static side_define_struct(mystructgathernest0,
+       side_field_list(
+               side_field_gather_unsigned_integer("a", offsetof(struct testnest0, a),
+                       side_struct_field_sizeof_bit(struct testnest0, a), 0,
+                       side_struct_field_sizeof_bit(struct testnest0, a), SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list()),
+               side_field_gather_struct("nest1", &mystructgathernest1,
+                       offsetof(struct testnest0, nest), sizeof(struct testnest1),
+                       SIDE_TYPE_GATHER_ACCESS_POINTER),
+       ),
+       side_attr_list()
+);
+
+side_static_event(my_provider_event_structgather_nest,
+       "myprovider", "myeventstructgathernest", SIDE_LOGLEVEL_DEBUG,
+       side_field_list(
+               side_field_gather_struct("nest0", &mystructgathernest0, 0,
+                       sizeof(struct testnest0), SIDE_TYPE_GATHER_ACCESS_POINTER),
+       ),
+       side_attr_list()
+);
+
+static
+void test_struct_gather_nest_ptr(void)
+{
+       side_event_cond(my_provider_event_structgather_nest) {
+               struct testnest2 mystruct2 = {
+                       .c = 77,
+               };
+               struct testnest1 mystruct1 = {
+                       .b = 66,
+                       .nest = &mystruct2,
+               };
+               struct testnest0 mystruct = {
+                       .a = 55,
+                       .nest = &mystruct1,
+               };
+               side_event_call(my_provider_event_structgather_nest,
+                       side_arg_list(
+                               side_arg_gather_struct(&mystruct),
+                       )
+               );
+       }
+}
+
+struct testfloat {
+#if __HAVE_FLOAT16
+       _Float16 f16;
+#endif
+#if __HAVE_FLOAT32
+       _Float32 f32;
+#endif
+#if __HAVE_FLOAT64
+       _Float64 f64;
+#endif
+#if __HAVE_FLOAT128
+       _Float128 f128;
+#endif
+};
+
+static side_define_struct(mystructgatherfloat,
+       side_field_list(
+#if __HAVE_FLOAT16
+               side_field_gather_float("f16", offsetof(struct testfloat, f16), 16,
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS,
+                       side_attr_list()),
+#endif
+#if __HAVE_FLOAT32
+               side_field_gather_float("f32", offsetof(struct testfloat, f32), 32,
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS,
+                       side_attr_list()),
+#endif
+#if __HAVE_FLOAT64
+               side_field_gather_float("f64", offsetof(struct testfloat, f64), 64,
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS,
+                       side_attr_list()),
+#endif
+#if __HAVE_FLOAT128
+               side_field_gather_float("f128", offsetof(struct testfloat, f128), 128,
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS,
+                       side_attr_list()),
+#endif
+       ),
+       side_attr_list()
+);
+
+side_static_event(my_provider_event_structgatherfloat,
+       "myprovider", "myeventstructgatherfloat", SIDE_LOGLEVEL_DEBUG,
+       side_field_list(
+               side_field_gather_struct("structgatherfloat", &mystructgatherfloat, 0,
+                       sizeof(struct testfloat), SIDE_TYPE_GATHER_ACCESS_POINTER),
+       ),
+       side_attr_list()
+);
+
+static
+void test_struct_gather_float(void)
+{
+       side_event_cond(my_provider_event_structgatherfloat) {
+               struct testfloat mystruct = {
+#if __HAVE_FLOAT16
+                       .f16 = 1.1,
+#endif
+#if __HAVE_FLOAT32
+                       .f32 = 2.2,
+#endif
+#if __HAVE_FLOAT64
+                       .f64 = 3.3,
+#endif
+#if __HAVE_FLOAT128
+                       .f128 = 4.4,
+#endif
+               };
+               side_event_call(my_provider_event_structgatherfloat,
+                       side_arg_list(
+                               side_arg_gather_struct(&mystruct),
+                       )
+               );
+       }
+}
+
+uint32_t mygatherarray[] = { 1, 2, 3, 4, 5 };
+
+uint16_t mygatherarray2[] = { 6, 7, 8, 9 };
+
+struct testarray {
+       int a;
+       uint32_t *ptr;
+};
+
+static side_define_struct(mystructgatherarray,
+       side_field_list(
+               side_field_gather_array("array",
+                       side_elem(side_type_gather_unsigned_integer(0, 32, 0, 32, SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list())),
+                       SIDE_ARRAY_SIZE(mygatherarray),
+                       offsetof(struct testarray, ptr),
+                       SIDE_TYPE_GATHER_ACCESS_POINTER,
+                       side_attr_list()),
+       ),
+       side_attr_list()
+);
+
+side_static_event(my_provider_event_structgatherarray,
+       "myprovider", "myeventstructgatherarray", SIDE_LOGLEVEL_DEBUG,
+       side_field_list(
+               side_field_gather_struct("structgatherarray", &mystructgatherarray, 0,
+                               sizeof(struct testarray), SIDE_TYPE_GATHER_ACCESS_POINTER),
+               side_field_gather_array("array2",
+                       side_elem(side_type_gather_unsigned_integer(0, 16, 0, 16, SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list())),
+                       SIDE_ARRAY_SIZE(mygatherarray2), 0,
+                       SIDE_TYPE_GATHER_ACCESS_POINTER,
+                       side_attr_list()
+               ),
+       ),
+       side_attr_list()
+);
+
+static
+void test_array_gather(void)
+{
+       side_event_cond(my_provider_event_structgatherarray) {
+               struct testarray mystruct = {
+                       .a = 55,
+                       .ptr = mygatherarray,
+               };
+               side_event_call(my_provider_event_structgatherarray,
+                       side_arg_list(
+                               side_arg_gather_struct(&mystruct),
+                               side_arg_gather_array(&mygatherarray2),
+                       )
+               );
+       }
+}
+
+#define TESTSGNESTARRAY_LEN 4
+struct testgatherstructnest1 {
+       int b;
+       int c[TESTSGNESTARRAY_LEN];
+};
+
+struct testgatherstructnest0 {
+       struct testgatherstructnest1 nest;
+       struct testgatherstructnest1 nestarray[2];
+       int a;
+};
+
+
+static side_define_struct(mystructgatherstructnest1,
+       side_field_list(
+               side_field_gather_signed_integer("b", offsetof(struct testgatherstructnest1, b),
+                       side_struct_field_sizeof_bit(struct testgatherstructnest1, b), 0,
+                       side_struct_field_sizeof_bit(struct testgatherstructnest1, b),
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list()),
+               side_field_gather_array("c",
+                       side_elem(
+                               side_type_gather_signed_integer(0, 32, 0, 32, 
+                                       SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list()),
+                       ),
+                       TESTSGNESTARRAY_LEN,
+                       offsetof(struct testgatherstructnest1, c),
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS,
+                       side_attr_list()),
+       ),
+       side_attr_list()
+);
+
+static side_define_struct(mystructgatherstructnest0,
+       side_field_list(
+               side_field_gather_signed_integer("a", offsetof(struct testgatherstructnest0, a),
+                       side_struct_field_sizeof_bit(struct testgatherstructnest0, a), 0,
+                       side_struct_field_sizeof_bit(struct testgatherstructnest0, a),
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list()),
+               side_field_gather_struct("structnest0", &mystructgatherstructnest1,
+                       offsetof(struct testgatherstructnest0, nest),
+                       sizeof(struct testgatherstructnest1),
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS),
+               side_field_gather_array("nestarray",
+                       side_elem(
+                               side_type_gather_struct(&mystructgatherstructnest1,
+                                       0,
+                                       sizeof(struct testgatherstructnest1),
+                                       SIDE_TYPE_GATHER_ACCESS_ADDRESS),
+                       ),
+                       2,
+                       offsetof(struct testgatherstructnest0, nestarray),
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS,
+                       side_attr_list()),
+       ),
+       side_attr_list()
+);
+
+side_static_event(my_provider_event_gatherstructnest,
+       "myprovider", "myeventgatherstructnest", SIDE_LOGLEVEL_DEBUG,
+       side_field_list(
+               side_field_gather_struct("structgather", &mystructgatherstructnest0, 0,
+                               sizeof(struct testgatherstructnest0), SIDE_TYPE_GATHER_ACCESS_POINTER),
+       ),
+       side_attr_list()
+);
+
+static
+void test_gather_structnest(void)
+{
+       side_event_cond(my_provider_event_gatherstructnest) {
+               struct testgatherstructnest0 mystruct = {
+                       .nest = {
+                               .b = 66,
+                               .c = { 0, 1, 2, 3 },
+                       },
+                       .nestarray = {
+                               [0] = {
+                                       .b = 77,
+                                       .c = { 11, 12, 13, 14 },
+                               },
+                               [1] = {
+                                       .b = 88,
+                                       .c = { 15, 16, 17, 18 },
+                               },
+                       },
+                       .a = 55,
+               };
+               side_event_call(my_provider_event_gatherstructnest,
+                       side_arg_list(
+                               side_arg_gather_struct(&mystruct),
+                       )
+               );
+       }
+}
+
+uint32_t gathervla[] = { 1, 2, 3, 4 };
+
+struct testgathervla {
+       int a;
+       uint16_t len;
+       uint32_t *p;
+};
+
+static side_define_struct(mystructgathervla,
+       side_field_list(
+               side_field_gather_signed_integer("a", offsetof(struct testgathervla, a),
+                       side_struct_field_sizeof_bit(struct testgathervla, a), 0,
+                       side_struct_field_sizeof_bit(struct testgathervla, a),
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list()
+               ),
+               side_field_gather_vla("nestvla",
+                       side_elem(side_type_gather_unsigned_integer(0, 32, 0, 32, SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list())),
+                       offsetof(struct testgathervla, p),
+                       SIDE_TYPE_GATHER_ACCESS_POINTER,
+                       side_length(side_type_gather_unsigned_integer(offsetof(struct testgathervla, len),
+                                       16, 0, 16, SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list())),
+                       side_attr_list()
+               ),
+       ),
+       side_attr_list()
+);
+
+side_static_event(my_provider_event_gathervla,
+       "myprovider", "myeventgathervla", SIDE_LOGLEVEL_DEBUG,
+       side_field_list(
+               side_field_gather_struct("structgathervla", &mystructgathervla, 0,
+                               sizeof(struct testgathervla), SIDE_TYPE_GATHER_ACCESS_POINTER),
+       ),
+       side_attr_list()
+);
+
+static
+void test_gather_vla(void)
+{
+       side_event_cond(my_provider_event_gathervla) {
+               struct testgathervla mystruct = {
+                       .a = 55,
+                       .len = SIDE_ARRAY_SIZE(gathervla),
+                       .p = gathervla,
+               };
+               side_event_call(my_provider_event_gathervla,
+                       side_arg_list(
+                               side_arg_gather_struct(&mystruct),
+                       )
+               );
+       }
+}
+
+struct testgathervlaflex {
+       uint8_t len;
+       uint32_t otherfield;
+       uint64_t array[];
+};
+
+static side_define_struct(mystructgathervlaflex,
+       side_field_list(
+               side_field_gather_vla("vlaflex",
+                       side_elem(side_type_gather_unsigned_integer(0, 64, 0, 64, SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list())),
+                       offsetof(struct testgathervlaflex, array),
+                       SIDE_TYPE_GATHER_ACCESS_ADDRESS,
+                       side_length(side_type_gather_unsigned_integer(offsetof(struct testgathervlaflex, len),
+                                       8, 0, 8, SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list())),
+                       side_attr_list()
+               ),
+       ),
+       side_attr_list()
+);
+
+side_static_event(my_provider_event_gathervlaflex,
+       "myprovider", "myeventgathervlaflex", SIDE_LOGLEVEL_DEBUG,
+       side_field_list(
+               side_field_gather_struct("structgathervlaflex", &mystructgathervlaflex, 0,
+                               sizeof(struct testgathervlaflex), SIDE_TYPE_GATHER_ACCESS_POINTER),
+       ),
+       side_attr_list()
+);
+
+#define VLAFLEXLEN     6
+static
+void test_gather_vla_flex(void)
+{
+       side_event_cond(my_provider_event_gathervlaflex) {
+               struct testgathervlaflex *mystruct = malloc(sizeof(*mystruct) + VLAFLEXLEN + sizeof(uint64_t));
+
+               mystruct->len = VLAFLEXLEN;
+               mystruct->otherfield = 0;
+               mystruct->array[0] = 1;
+               mystruct->array[1] = 2;
+               mystruct->array[2] = 3;
+               mystruct->array[3] = 4;
+               mystruct->array[4] = 5;
+               mystruct->array[5] = 6;
+               side_event_call(my_provider_event_gathervlaflex,
+                       side_arg_list(
+                               side_arg_gather_struct(mystruct),
+                       )
+               );
+               free(mystruct);
+       }
+}
+
+side_static_event(my_provider_event_gatherbyte,
+       "myprovider", "myeventgatherbyte", SIDE_LOGLEVEL_DEBUG,
+       side_field_list(
+               side_field_gather_byte("byte", 0, SIDE_TYPE_GATHER_ACCESS_POINTER, side_attr_list()),
+               side_field_gather_array("array",
+                       side_elem(side_type_gather_byte(0, SIDE_TYPE_GATHER_ACCESS_ADDRESS, side_attr_list())),
+                       3, 0, SIDE_TYPE_GATHER_ACCESS_POINTER, side_attr_list()
+               ),
+       ),
+       side_attr_list()
+);
+
+static
+void test_gather_byte(void)
+{
+       side_event_cond(my_provider_event_structgatherarray) {
+               uint8_t v = 0x44;
+               uint8_t array[3] = { 0x1, 0x2, 0x3 };
+
+               side_event_call(my_provider_event_gatherbyte,
+                       side_arg_list(
+                               side_arg_gather_byte(&v),
+                               side_arg_gather_array(array),
+                       )
+               );
+       }
+}
+
 int main()
 {
        test_fields();
+       test_event_hidden();
+       test_event_export();
        test_struct_literal();
        test_struct();
        test_array();
@@ -1185,5 +2039,15 @@ int main()
        test_enum_bitmap();
        test_blob();
        test_fmt_string();
+       test_endian();
+       test_base();
+       test_struct_gather();
+       test_struct_gather_nest_ptr();
+       test_struct_gather_float();
+       test_array_gather();
+       test_gather_structnest();
+       test_gather_vla();
+       test_gather_vla_flex();
+       test_gather_byte();
        return 0;
 }
This page took 0.043747 seconds and 4 git commands to generate.