sink.text.pretty: print bit array fields
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 13 Aug 2019 22:49:14 +0000 (18:49 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 4 Sep 2019 15:58:21 +0000 (11:58 -0400)
The compoent prints bit array fields as an unsigned integer (hexadecimal
base).

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I89b9cadb4b8f0d87d3d547450232321010852e98
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1909
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/plugins/text/pretty/print.c

index ea0b165c0260e8c9438e1ab0a81188bffb6f65d5..d015cdd2feec870dbc8094baa4aa339ca413bc02 100644 (file)
@@ -998,6 +998,21 @@ int print_field(struct pretty_component *pretty,
                }
                return 0;
        }
+       case BT_FIELD_CLASS_TYPE_BIT_ARRAY:
+       {
+               uint64_t v = bt_field_bit_array_get_value_as_integer(field);
+
+               if (pretty->use_colors) {
+                       bt_common_g_string_append(pretty->string,
+                               COLOR_NUMBER_VALUE);
+               }
+               bt_common_g_string_append_printf(pretty->string, "0x%" PRIX64,
+                       v);
+               if (pretty->use_colors) {
+                       bt_common_g_string_append(pretty->string, COLOR_RST);
+               }
+               return 0;
+       }
        case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
        case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER:
                return print_integer(pretty, field);
This page took 0.025271 seconds and 4 git commands to generate.