2 * Babeltrace - Trace IR field copy
4 * Copyright (c) 2015-2019 EfficiOS Inc. and Linux Foundation
5 * Copyright (c) 2018 Philippe Proulx <pproulx@efficios.com>
6 * Copyright (c) 2019 Francis Deslauriers <francis.deslauriers@efficios.com>
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 #define BT_LOG_OUTPUT_LEVEL (md_maps->log_level)
28 #define BT_LOG_TAG "PLUGIN/FLT.LTTNG-UTILS.DEBUG-INFO/TRACE-IR-META-FC-COPY"
29 #include "logging/log.h"
31 #include "common/assert.h"
32 #include "common/common.h"
33 #include "compat/compiler.h"
34 #include <babeltrace2/babeltrace.h>
36 #include "trace-ir-metadata-copy.h"
37 #include "trace-ir-metadata-field-class-copy.h"
40 * This fonction walks througth the nested structures field class to resolve a
41 * field path object. A field path is made of indexes inside possibly nested
42 * structures ultimately leading to a field class.
45 const bt_field_class
*walk_field_path(struct trace_ir_metadata_maps
*md_maps
,
46 const bt_field_path
*fp
, const bt_field_class
*fc
)
48 uint64_t i
, fp_item_count
;
49 const bt_field_class
*curr_fc
;
51 BT_ASSERT(bt_field_class_get_type(fc
) == BT_FIELD_CLASS_TYPE_STRUCTURE
);
52 BT_LOGD("Walking field path on field class: fp-addr=%p, fc-addr=%p",
55 fp_item_count
= bt_field_path_get_item_count(fp
);
57 for (i
= 0; i
< fp_item_count
; i
++) {
58 bt_field_class_type fc_type
= bt_field_class_get_type(curr_fc
);
59 const bt_field_path_item
*fp_item
=
60 bt_field_path_borrow_item_by_index_const(fp
, i
);
63 case BT_FIELD_CLASS_TYPE_STRUCTURE
:
65 const bt_field_class_structure_member
*member
;
67 BT_ASSERT(bt_field_path_item_get_type(fp_item
) ==
68 BT_FIELD_PATH_ITEM_TYPE_INDEX
);
69 member
= bt_field_class_structure_borrow_member_by_index_const(
71 bt_field_path_item_index_get_index(fp_item
));
72 curr_fc
= bt_field_class_structure_member_borrow_field_class_const(
76 case BT_FIELD_CLASS_TYPE_VARIANT
:
78 const bt_field_class_variant_option
*option
;
80 BT_ASSERT(bt_field_path_item_get_type(fp_item
) ==
81 BT_FIELD_PATH_ITEM_TYPE_INDEX
);
82 option
= bt_field_class_variant_borrow_option_by_index_const(
84 bt_field_path_item_index_get_index(fp_item
));
85 curr_fc
= bt_field_class_variant_option_borrow_field_class_const(
89 case BT_FIELD_CLASS_TYPE_STATIC_ARRAY
:
90 case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY
:
92 BT_ASSERT(bt_field_path_item_get_type(fp_item
) ==
93 BT_FIELD_PATH_ITEM_TYPE_CURRENT_ARRAY_ELEMENT
);
94 curr_fc
= bt_field_class_array_borrow_element_field_class_const(
107 const bt_field_class
*resolve_field_path_to_field_class(const bt_field_path
*fp
,
108 struct trace_ir_metadata_maps
*md_maps
)
110 struct field_class_resolving_context
*fc_resolving_ctx
;
111 const bt_field_class
*fc
;
114 BT_LOGD("Resolving field path: fp-addr=%p", fp
);
116 fc_resolving_ctx
= md_maps
->fc_resolving_ctx
;
117 fp_scope
= bt_field_path_get_root_scope(fp
);
120 case BT_SCOPE_PACKET_CONTEXT
:
121 fc
= walk_field_path(md_maps
, fp
,
122 fc_resolving_ctx
->packet_context
);
124 case BT_SCOPE_EVENT_COMMON_CONTEXT
:
125 fc
= walk_field_path(md_maps
, fp
,
126 fc_resolving_ctx
->event_common_context
);
128 case BT_SCOPE_EVENT_SPECIFIC_CONTEXT
:
129 fc
= walk_field_path(md_maps
, fp
,
130 fc_resolving_ctx
->event_specific_context
);
132 case BT_SCOPE_EVENT_PAYLOAD
:
133 fc
= walk_field_path(md_maps
, fp
,
134 fc_resolving_ctx
->event_payload
);
144 void field_class_integer_set_props(const bt_field_class
*input_fc
,
145 bt_field_class
*output_fc
)
147 bt_field_class_integer_set_preferred_display_base(output_fc
,
148 bt_field_class_integer_get_preferred_display_base(input_fc
));
149 bt_field_class_integer_set_field_value_range(output_fc
,
150 bt_field_class_integer_get_field_value_range(input_fc
));
154 int field_class_unsigned_integer_copy(
155 struct trace_ir_metadata_maps
*md_maps
,
156 const bt_field_class
*in_field_class
,
157 bt_field_class
*out_field_class
)
159 BT_LOGD("Copying content of unsigned integer field class: "
160 "in-fc-addr=%p, out-fc-addr=%p",
161 in_field_class
, out_field_class
);
163 field_class_integer_set_props(in_field_class
, out_field_class
);
165 BT_LOGD("Copied content of unsigned integer field class: "
166 "in-fc-addr=%p, out-fc-addr=%p",
167 in_field_class
, out_field_class
);
172 int field_class_signed_integer_copy(
173 struct trace_ir_metadata_maps
*md_maps
,
174 const bt_field_class
*in_field_class
,
175 bt_field_class
*out_field_class
)
177 BT_LOGD("Copying content of signed integer field class: "
178 "in-fc-addr=%p, out-fc-addr=%p",
179 in_field_class
, out_field_class
);
181 field_class_integer_set_props(in_field_class
, out_field_class
);
183 BT_LOGD("Copied content of signed integer field class: "
184 "in-fc-addr=%p, out-fc-addr=%p",
185 in_field_class
, out_field_class
);
190 int field_class_unsigned_enumeration_copy(
191 struct trace_ir_metadata_maps
*md_maps
,
192 const bt_field_class
*in_field_class
,
193 bt_field_class
*out_field_class
)
195 uint64_t i
, enum_mapping_count
;
198 BT_LOGD("Copying content of unsigned enumeration field class: "
199 "in-fc-addr=%p, out-fc-addr=%p",
200 in_field_class
, out_field_class
);
202 /* Copy properties of the inner integer. */
203 field_class_integer_set_props(in_field_class
, out_field_class
);
205 /* Copy all enumeration entries. */
206 enum_mapping_count
= bt_field_class_enumeration_get_mapping_count(in_field_class
);
207 for (i
= 0; i
< enum_mapping_count
; i
++) {
209 const bt_field_class_unsigned_enumeration_mapping
*u_mapping
;
210 const bt_field_class_enumeration_mapping
*mapping
;
211 uint64_t range_index
, range_count
;
213 /* Get the ranges and the range count. */
214 u_mapping
= bt_field_class_unsigned_enumeration_borrow_mapping_by_index_const(
216 mapping
= bt_field_class_unsigned_enumeration_mapping_as_mapping_const(
219 bt_field_class_enumeration_mapping_get_range_count(
221 label
= bt_field_class_enumeration_mapping_get_label(
225 * Iterate over all the ranges to add them to copied field
228 for (range_index
= 0; range_index
< range_count
; range_index
++) {
229 uint64_t lower
, upper
;
230 bt_field_class_status status
;
231 bt_field_class_unsigned_enumeration_mapping_get_range_by_index(
232 u_mapping
, range_index
, &lower
, &upper
);
234 BT_LOGD("Copying range in enumeration field class: "
235 "label=%s, lower=%"PRId64
", upper=%"PRId64
,
236 label
, lower
, upper
);
238 /* Add the label and its range to the copy field class. */
239 status
= bt_field_class_unsigned_enumeration_map_range(
240 out_field_class
, label
, lower
, upper
);
242 if (status
!= BT_FIELD_CLASS_STATUS_OK
) {
243 BT_LOGE_STR("Failed to add range to unsigned "
245 BT_FIELD_CLASS_PUT_REF_AND_RESET(out_field_class
);
252 BT_LOGD("Copied content of unsigned enumeration field class: "
253 "in-fc-addr=%p, out-fc-addr=%p",
254 in_field_class
, out_field_class
);
261 int field_class_signed_enumeration_copy(
262 struct trace_ir_metadata_maps
*md_maps
,
263 const bt_field_class
*in_field_class
,
264 bt_field_class
*out_field_class
)
266 uint64_t i
, enum_mapping_count
;
269 BT_LOGD("Copying content of signed enumeration field class: "
270 "in-fc-addr=%p, out-fc-addr=%p",
271 in_field_class
, out_field_class
);
273 /* Copy properties of the inner integer. */
274 field_class_integer_set_props(in_field_class
, out_field_class
);
276 /* Copy all enumeration entries. */
278 bt_field_class_enumeration_get_mapping_count(in_field_class
);
279 for (i
= 0; i
< enum_mapping_count
; i
++) {
281 const bt_field_class_signed_enumeration_mapping
*i_mapping
;
282 const bt_field_class_enumeration_mapping
*mapping
;
283 uint64_t range_index
, range_count
;
285 /* Get the ranges and the range count. */
286 i_mapping
= bt_field_class_signed_enumeration_borrow_mapping_by_index_const(
288 mapping
= bt_field_class_signed_enumeration_mapping_as_mapping_const(
291 bt_field_class_enumeration_mapping_get_range_count(
293 label
= bt_field_class_enumeration_mapping_get_label(
297 * Iterate over all the ranges to add them to copied field
300 for (range_index
= 0; range_index
< range_count
; range_index
++) {
301 int64_t lower
, upper
;
302 bt_field_class_status status
;
303 bt_field_class_signed_enumeration_mapping_get_range_by_index(
304 i_mapping
, range_index
, &lower
, &upper
);
306 BT_LOGD("Copying range in enumeration field class: "
307 "label=%s, lower=%"PRId64
", upper=%"PRId64
,
308 label
, lower
, upper
);
310 /* Add the label and its range to the copy field class. */
311 status
= bt_field_class_signed_enumeration_map_range(
312 out_field_class
, label
, lower
, upper
);
313 if (status
!= BT_FIELD_CLASS_STATUS_OK
) {
314 BT_LOGE_STR("Failed to add range to signed "
316 BT_FIELD_CLASS_PUT_REF_AND_RESET(out_field_class
);
323 BT_LOGD("Copied content of signed enumeration field class: "
324 "in-fc-addr=%p, out-fc-addr=%p",
325 in_field_class
, out_field_class
);
332 int field_class_real_copy(
333 struct trace_ir_metadata_maps
*md_maps
,
334 const bt_field_class
*in_field_class
,
335 bt_field_class
*out_field_class
)
337 BT_LOGD("Copying content of real field class: "
338 "in-fc-addr=%p, out-fc-addr=%p",
339 in_field_class
, out_field_class
);
341 bt_field_class_real_set_is_single_precision(out_field_class
,
342 bt_field_class_real_is_single_precision(in_field_class
));
344 BT_LOGD("Copied content real field class: in-fc-addr=%p, "
345 "out-fc-addr=%p", in_field_class
, out_field_class
);
351 int field_class_structure_copy(
352 struct trace_ir_metadata_maps
*md_maps
,
353 const bt_field_class
*in_field_class
,
354 bt_field_class
*out_field_class
)
356 uint64_t i
, struct_member_count
;
357 bt_field_class_status status
;
360 BT_LOGD("Copying content of structure field class: "
361 "in-fc-addr=%p, out-fc-addr=%p",
362 in_field_class
, out_field_class
);
363 /* Get the number of member in that struct. */
364 struct_member_count
=
365 bt_field_class_structure_get_member_count(in_field_class
);
367 /* Iterate over all the members of the struct. */
368 for (i
= 0; i
< struct_member_count
; i
++) {
369 const bt_field_class_structure_member
*member
;
370 const char *member_name
;
371 const bt_field_class
*member_fc
;
372 bt_field_class
*out_member_field_class
;
374 member
= bt_field_class_structure_borrow_member_by_index_const(
376 member_fc
= bt_field_class_structure_member_borrow_field_class_const(
378 member_name
= bt_field_class_structure_member_get_name(member
);
379 BT_LOGD("Copying structure field class's field: "
380 "index=%" PRId64
", "
381 "member-fc-addr=%p, field-name=\"%s\"",
382 i
, member_fc
, member_name
);
384 out_member_field_class
= create_field_class_copy(md_maps
,
386 if (!out_member_field_class
) {
387 BT_LOGE("Cannot copy structure field class's field: "
388 "index=%" PRId64
", "
389 "field-fc-addr=%p, field-name=\"%s\"",
390 i
, member_fc
, member_name
);
394 ret
= copy_field_class_content(md_maps
, member_fc
,
395 out_member_field_class
);
400 status
= bt_field_class_structure_append_member(out_field_class
,
401 member_name
, out_member_field_class
);
402 if (status
!= BT_FIELD_CLASS_STATUS_OK
) {
403 BT_LOGE("Cannot append structure field class's field: "
404 "index=%" PRId64
", "
405 "field-fc-addr=%p, field-name=\"%s\"",
406 i
, member_fc
, member_name
);
407 BT_FIELD_CLASS_PUT_REF_AND_RESET(out_member_field_class
);
413 BT_LOGD("Copied structure field class: original-fc-addr=%p, copy-fc-addr=%p",
414 in_field_class
, out_field_class
);
421 int field_class_variant_copy(
422 struct trace_ir_metadata_maps
*md_maps
,
423 const bt_field_class
*in_field_class
,
424 bt_field_class
*out_field_class
)
426 bt_field_class
*out_tag_field_class
= NULL
;
427 uint64_t i
, variant_option_count
;
428 const bt_field_path
*tag_fp
;
429 const bt_field_class
*tag_fc
;
432 BT_LOGD("Copying content of variant field class: "
433 "in-fc-addr=%p, out-fc-addr=%p",
434 in_field_class
, out_field_class
);
436 tag_fp
= bt_field_class_variant_borrow_selector_field_path_const(
439 tag_fc
= resolve_field_path_to_field_class(tag_fp
,
442 out_tag_field_class
= g_hash_table_lookup(
443 md_maps
->field_class_map
, tag_fc
);
444 if (!out_tag_field_class
) {
445 BT_LOGE_STR("Cannot find the tag field class.");
449 bt_field_class_variant_set_selector_field_class(out_field_class
,
450 out_tag_field_class
);
453 variant_option_count
=
454 bt_field_class_variant_get_option_count(in_field_class
);
455 for (i
= 0; i
< variant_option_count
; i
++) {
456 const bt_field_class
*option_fc
;
457 const char *option_name
;
458 bt_field_class
*out_option_field_class
;
459 bt_field_class_status status
;
460 const bt_field_class_variant_option
*option
;
462 option
= bt_field_class_variant_borrow_option_by_index_const(
464 option_fc
= bt_field_class_variant_option_borrow_field_class_const(
466 option_name
= bt_field_class_variant_option_get_name(option
);
467 out_option_field_class
= create_field_class_copy_internal(
469 if (!out_option_field_class
) {
470 BT_LOGE_STR("Cannot copy field class.");
474 ret
= copy_field_class_content_internal(md_maps
, option_fc
,
475 out_option_field_class
);
477 BT_LOGE_STR("Error copying content of option variant "
482 status
= bt_field_class_variant_append_option(
483 out_field_class
, option_name
,
484 out_option_field_class
);
485 if (status
!= BT_FIELD_CLASS_STATUS_OK
) {
486 BT_LOGE_STR("Cannot append option to variant field class'");
487 BT_FIELD_CLASS_PUT_REF_AND_RESET(out_tag_field_class
);
493 BT_LOGD("Copied content of variant field class: in-fc-addr=%p, "
494 "out-fc-addr=%p", in_field_class
, out_field_class
);
501 int field_class_static_array_copy(
502 struct trace_ir_metadata_maps
*md_maps
,
503 const bt_field_class
*in_field_class
,
504 bt_field_class
*out_field_class
)
506 BT_LOGD("Copying content of static array field class: in-fc-addr=%p, "
507 "out-fc-addr=%p", in_field_class
, out_field_class
);
509 * There is no content to copy. Keep this function call anyway for
512 BT_LOGD("Copied content of static array field class: in-fc-addr=%p, "
513 "out-fc-addr=%p", in_field_class
, out_field_class
);
519 int field_class_dynamic_array_copy(
520 struct trace_ir_metadata_maps
*md_maps
,
521 const bt_field_class
*in_field_class
,
522 bt_field_class
*out_field_class
)
524 const bt_field_class
*len_fc
;
525 const bt_field_path
*len_fp
;
526 bt_field_class_status status
;
527 bt_field_class
*out_len_field_class
;
530 BT_LOGD("Copying content of dynamic array field class: "
531 "in-fc-addr=%p, out-fc-addr=%p",
532 in_field_class
, out_field_class
);
534 len_fp
= bt_field_class_dynamic_array_borrow_length_field_path_const(
538 BT_LOGD("Copying dynamic array length field class using "
539 "field path: in-len-fp=%p", len_fp
);
540 len_fc
= resolve_field_path_to_field_class(
542 out_len_field_class
= g_hash_table_lookup(
543 md_maps
->field_class_map
, len_fc
);
544 if (!out_len_field_class
) {
545 BT_LOGE_STR("Cannot find the output matching length"
551 status
= bt_field_class_dynamic_array_set_length_field_class(
552 out_field_class
, out_len_field_class
);
553 if (status
!= BT_FIELD_CLASS_STATUS_OK
) {
554 BT_LOGE_STR("Cannot set dynamic array field class' "
555 "length field class.");
556 BT_FIELD_CLASS_PUT_REF_AND_RESET(out_len_field_class
);
562 BT_LOGD("Copied dynamic array field class: in-fc-addr=%p, "
563 "out-fc-addr=%p", in_field_class
, out_field_class
);
570 int field_class_string_copy(struct trace_ir_metadata_maps
*md_maps
,
571 const bt_field_class
*in_field_class
,
572 bt_field_class
*out_field_class
)
574 BT_LOGD("Copying content of string field class: in-fc-addr=%p, "
575 "out-fc-addr=%p", in_field_class
, out_field_class
);
577 * There is no content to copy. Keep this function call anyway for
580 BT_LOGD("Copied content of string field class: in-fc-addr=%p, "
581 "out-fc-addr=%p", in_field_class
, out_field_class
);
587 bt_field_class
*copy_field_class_array_element(struct trace_ir_metadata_maps
*md_maps
,
588 const bt_field_class
*in_elem_fc
)
591 bt_field_class
*out_elem_fc
=
592 create_field_class_copy_internal(md_maps
, in_elem_fc
);
594 BT_LOGE("Error creating output elem field class "
595 "from input elem field class for static array: "
596 "in-fc-addr=%p", in_elem_fc
);
600 ret
= copy_field_class_content_internal(md_maps
, in_elem_fc
, out_elem_fc
);
602 BT_LOGE("Error creating output elem field class "
603 "from input elem field class for static array: "
604 "in-fc-addr=%p", in_elem_fc
);
605 BT_FIELD_CLASS_PUT_REF_AND_RESET(out_elem_fc
);
614 bt_field_class
*create_field_class_copy_internal(struct trace_ir_metadata_maps
*md_maps
,
615 const bt_field_class
*in_field_class
)
617 bt_field_class
*out_field_class
= NULL
;
619 BT_LOGD("Creating bare field class based on field class: in-fc-addr=%p",
622 switch(bt_field_class_get_type(in_field_class
)) {
623 case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER
:
624 out_field_class
= bt_field_class_unsigned_integer_create(
625 md_maps
->output_trace_class
);
627 case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER
:
628 out_field_class
= bt_field_class_signed_integer_create(
629 md_maps
->output_trace_class
);
631 case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION
:
632 out_field_class
= bt_field_class_unsigned_enumeration_create(
633 md_maps
->output_trace_class
);
635 case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION
:
636 out_field_class
= bt_field_class_signed_enumeration_create(
637 md_maps
->output_trace_class
);
639 case BT_FIELD_CLASS_TYPE_REAL
:
640 out_field_class
= bt_field_class_real_create(
641 md_maps
->output_trace_class
);
643 case BT_FIELD_CLASS_TYPE_STRING
:
644 out_field_class
= bt_field_class_string_create(
645 md_maps
->output_trace_class
);
647 case BT_FIELD_CLASS_TYPE_STRUCTURE
:
648 out_field_class
= bt_field_class_structure_create(
649 md_maps
->output_trace_class
);
651 case BT_FIELD_CLASS_TYPE_STATIC_ARRAY
:
653 const bt_field_class
*in_elem_fc
=
654 bt_field_class_array_borrow_element_field_class_const(
657 bt_field_class_static_array_get_length(in_field_class
);
659 bt_field_class
*out_elem_fc
= copy_field_class_array_element(
660 md_maps
, in_elem_fc
);
662 out_field_class
= NULL
;
666 out_field_class
= bt_field_class_static_array_create(
667 md_maps
->output_trace_class
,
668 out_elem_fc
, array_len
);
671 case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY
:
673 const bt_field_class
*in_elem_fc
=
674 bt_field_class_array_borrow_element_field_class_const(
677 bt_field_class
*out_elem_fc
= copy_field_class_array_element(
678 md_maps
, in_elem_fc
);
680 out_field_class
= NULL
;
684 out_field_class
= bt_field_class_dynamic_array_create(
685 md_maps
->output_trace_class
,
689 case BT_FIELD_CLASS_TYPE_VARIANT
:
690 out_field_class
= bt_field_class_variant_create(
691 md_maps
->output_trace_class
);
698 * Add mapping from in_field_class to out_field_class. This simplifies
699 * the resolution of field paths in variant and dynamic array field
702 g_hash_table_insert(md_maps
->field_class_map
,
703 (gpointer
) in_field_class
, out_field_class
);
707 BT_LOGD("Created bare field class based on field class: in-fc-addr=%p, "
708 "out-fc-addr=%p", in_field_class
, out_field_class
);
710 BT_LOGE("Error creating output field class from input field "
711 "class: in-fc-addr=%p", in_field_class
);
714 return out_field_class
;
718 int copy_field_class_content_internal(
719 struct trace_ir_metadata_maps
*md_maps
,
720 const bt_field_class
*in_field_class
,
721 bt_field_class
*out_field_class
)
724 switch(bt_field_class_get_type(in_field_class
)) {
725 case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER
:
726 ret
= field_class_unsigned_integer_copy(md_maps
,
727 in_field_class
, out_field_class
);
729 case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER
:
730 ret
= field_class_signed_integer_copy(md_maps
,
731 in_field_class
, out_field_class
);
733 case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION
:
734 ret
= field_class_unsigned_enumeration_copy(md_maps
,
735 in_field_class
, out_field_class
);
737 case BT_FIELD_CLASS_TYPE_SIGNED_ENUMERATION
:
738 ret
= field_class_signed_enumeration_copy(md_maps
,
739 in_field_class
, out_field_class
);
741 case BT_FIELD_CLASS_TYPE_REAL
:
742 ret
= field_class_real_copy(md_maps
,
743 in_field_class
, out_field_class
);
745 case BT_FIELD_CLASS_TYPE_STRING
:
746 ret
= field_class_string_copy(md_maps
,
747 in_field_class
, out_field_class
);
749 case BT_FIELD_CLASS_TYPE_STRUCTURE
:
750 ret
= field_class_structure_copy(md_maps
,
751 in_field_class
, out_field_class
);
753 case BT_FIELD_CLASS_TYPE_STATIC_ARRAY
:
754 ret
= field_class_static_array_copy(md_maps
,
755 in_field_class
, out_field_class
);
757 case BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY
:
758 ret
= field_class_dynamic_array_copy(md_maps
,
759 in_field_class
, out_field_class
);
761 case BT_FIELD_CLASS_TYPE_VARIANT
:
762 ret
= field_class_variant_copy(md_maps
,
763 in_field_class
, out_field_class
);