- BT_LOGE("Cannot add `magic` field type to structure field type: "
- "ret=%d", ret);
- goto error;
- }
-
- BT_PUT(ft);
- ft = bt_field_type_integer_create(8);
- if (!ft) {
- BT_LOGE_STR("Cannot create an integer field type object.");
- goto error;
- }
-
- goto end;
-
-error:
- BT_PUT(root_ft);
-
-end:
- bt_put(ft);
- return root_ft;
-}
-
-static
-struct bt_field_type *create_event_header_ft(
- struct bt_clock_class *clock_class)
-{
- struct bt_field_type *root_ft = NULL;
- struct bt_field_type *ft = NULL;
- int ret;
-
- root_ft = bt_field_type_structure_create();
- if (!root_ft) {
- BT_LOGE_STR("Cannot create an empty structure field type object.");
- goto error;
- }
-
- ft = bt_field_type_integer_create(64);
- if (!ft) {
- BT_LOGE_STR("Cannot create an integer field type object.");
- goto error;
- }
-
- ret = bt_field_type_integer_set_mapped_clock_class(ft, clock_class);
- if (ret) {
- BT_LOGE("Cannot map integer field type to clock class: "
- "ret=%d", ret);
- goto error;
- }
-
- ret = bt_field_type_structure_add_field(root_ft,
- ft, "timestamp");
- if (ret) {
- BT_LOGE("Cannot add `timestamp` field type to structure field type: "
- "ret=%d", ret);
- goto error;
- }
-
- goto end;
-
-error:
- BT_PUT(root_ft);
-
-end:
- bt_put(ft);
- return root_ft;
-}
-
-static
-struct bt_field_type *create_event_payload_ft(void)
-{
- struct bt_field_type *root_ft = NULL;
- struct bt_field_type *ft = NULL;
- int ret;
-
- root_ft = bt_field_type_structure_create();
- if (!root_ft) {
- BT_LOGE_STR("Cannot create an empty structure field type object.");
- goto error;
- }
-
- ft = bt_field_type_string_create();
- if (!ft) {
- BT_LOGE_STR("Cannot create a string field type object.");
- goto error;
- }
-
- ret = bt_field_type_structure_add_field(root_ft,
- ft, "str");
- if (ret) {
- BT_LOGE("Cannot add `str` field type to structure field type: "