From: Philippe Proulx Date: Tue, 13 Aug 2019 22:49:14 +0000 (-0400) Subject: sink.text.pretty: print bit array fields X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=6be72e6c1aa4e592e134e985704c677d0f753b48 sink.text.pretty: print bit array fields The compoent prints bit array fields as an unsigned integer (hexadecimal base). Signed-off-by: Philippe Proulx Change-Id: I89b9cadb4b8f0d87d3d547450232321010852e98 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1909 Tested-by: jenkins Reviewed-by: Francis Deslauriers --- diff --git a/src/plugins/text/pretty/print.c b/src/plugins/text/pretty/print.c index ea0b165c..d015cdd2 100644 --- a/src/plugins/text/pretty/print.c +++ b/src/plugins/text/pretty/print.c @@ -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);