Accept byte type for enum bitmap
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 25 Oct 2022 15:16:57 +0000 (11:16 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 25 Oct 2022 15:16:57 +0000 (11:16 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/test.c
src/tracer.c

index 173aae55992763d1e9edd41d39dddbf646a8eb53..8320928e36bae3ab1ef3115ac03714a4c6d0a52d 100644 (file)
@@ -1033,6 +1033,7 @@ 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,
@@ -1065,6 +1066,7 @@ void test_enum_bitmap(void)
                                side_arg_u32(1 << 31),
                                side_arg_u64(1ULL << 63),
                                side_arg_u64((1ULL << 1) | (1ULL << 63)),
+                               side_arg_byte(1 << 2),
                                side_arg_array(&myarray),
                                side_arg_vla(&myarray),
                        )
index 7643155dc351baf3e66e91e2a60af74a64fb065f..da0ac69afb15f12eaf73bae6811ad86a1d041998 100644 (file)
@@ -185,7 +185,8 @@ uint32_t enum_elem_type_to_stride(const struct side_type_description *elem_type)
        uint32_t stride_bit;
 
        switch (elem_type->type) {
-       case SIDE_TYPE_U8:
+       case SIDE_TYPE_U8:      /* Fall-through */
+       case SIDE_TYPE_BYTE:
                stride_bit = 8;
                break;
        case SIDE_TYPE_U16:
@@ -216,9 +217,10 @@ void print_enum_bitmap(const struct side_type_description *type_desc,
 
        switch (elem_type->type) {
        case SIDE_TYPE_U8:              /* Fall-through */
+       case SIDE_TYPE_BYTE:            /* Fall-through */
        case SIDE_TYPE_U16:             /* Fall-through */
        case SIDE_TYPE_U32:             /* Fall-through */
-       case SIDE_TYPE_U64:             /* Fall-through */
+       case SIDE_TYPE_U64:
                stride_bit = enum_elem_type_to_stride(elem_type);
                array_item = item;
                nr_items = 1;
@@ -381,6 +383,7 @@ void tracer_print_type(const struct side_type_description *type_desc, const stru
        case SIDE_TYPE_ENUM_BITMAP:
                switch (item->type) {
                case SIDE_TYPE_U8:
+               case SIDE_TYPE_BYTE:
                case SIDE_TYPE_U16:
                case SIDE_TYPE_U32:
                case SIDE_TYPE_U64:
This page took 0.026541 seconds and 4 git commands to generate.