flt.lttng-utils.debug-info: copy boolean field class and field objects
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sun, 11 Aug 2019 15:31:38 +0000 (11:31 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 15 Aug 2019 15:41:44 +0000 (11:41 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Iaa66e2fc34740d249f014a3a7ec18006e74a2472
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1892
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c
src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c

index 3bb1fba17fa73426cebb6f156b42fbba7c336265..d805735a95e7f6444d1b7c6ebfdd7f469eb12ae2 100644 (file)
@@ -219,6 +219,10 @@ void copy_field_content(const bt_field *in_field, bt_field *out_field,
        BT_COMP_LOGT("Copying content of field: in-f-addr=%p, out-f-addr=%p",
                        in_field, out_field);
        switch (in_fc_type) {
+       case BT_FIELD_CLASS_TYPE_BOOL:
+               bt_field_bool_set_value(out_field,
+                       bt_field_bool_get_value(in_field));
+               break;
        case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
        case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION:
                bt_field_integer_unsigned_set_value(out_field,
index 0b0d4d4c7a3289da015b611b782d94179f96fbff..868699e580801b41f4d2ee5046b5d8ace8c55cf1 100644 (file)
@@ -153,6 +153,21 @@ void field_class_integer_set_props(const bt_field_class *input_fc,
                        bt_field_class_integer_get_field_value_range(input_fc));
 }
 
+static inline
+int field_class_bool_copy(
+               struct trace_ir_metadata_maps *md_maps,
+               const bt_field_class *in_field_class,
+               bt_field_class *out_field_class)
+{
+       BT_COMP_LOGD("Copying content of boolean field class: "
+                       "in-fc-addr=%p, out-fc-addr=%p",
+                       in_field_class, out_field_class);
+       BT_COMP_LOGD("Copied content of boolean field class: "
+                       "in-fc-addr=%p, out-fc-addr=%p",
+                       in_field_class, out_field_class);
+       return 0;
+}
+
 static inline
 int field_class_unsigned_integer_copy(
                struct trace_ir_metadata_maps *md_maps,
@@ -561,6 +576,10 @@ bt_field_class *create_field_class_copy_internal(struct trace_ir_metadata_maps *
                        in_field_class);
 
        switch (fc_type) {
+       case BT_FIELD_CLASS_TYPE_BOOL:
+               out_field_class = bt_field_class_bool_create(
+                               md_maps->output_trace_class);
+               break;
        case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
                out_field_class = bt_field_class_integer_unsigned_create(
                                md_maps->output_trace_class);
@@ -700,6 +719,10 @@ int copy_field_class_content_internal(
 {
        int ret = 0;
        switch(bt_field_class_get_type(in_field_class)) {
+       case BT_FIELD_CLASS_TYPE_BOOL:
+               ret = field_class_bool_copy(md_maps,
+                               in_field_class, out_field_class);
+               break;
        case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
                ret = field_class_unsigned_integer_copy(md_maps,
                                in_field_class, out_field_class);
This page took 0.026363 seconds and 4 git commands to generate.