-struct ctf_fs_ds_index *ctf_fs_ds_index_create(size_t length)
-{
- struct ctf_fs_ds_index *index = g_new0(struct ctf_fs_ds_index, 1);
-
- if (!index) {
- BT_LOGE_STR("Failed to allocate index");
- goto error;
- }
-
- index->entries = g_array_sized_new(FALSE, TRUE,
- sizeof(struct ctf_fs_ds_index_entry), length);
- if (!index->entries) {
- BT_LOGE("Failed to allocate %zu index entries.", length);
- goto error;
- }
- g_array_set_size(index->entries, length);
-end:
- return index;
-error:
- ctf_fs_ds_index_destroy(index);
- goto end;
-}
-
-/* Returns a new, zeroed, index entry. */
-static
-struct ctf_fs_ds_index_entry *ctf_fs_ds_index_add_new_entry(
- struct ctf_fs_ds_index *index)
-{
- g_array_set_size(index->entries, index->entries->len + 1);
- return &g_array_index(index->entries, struct ctf_fs_ds_index_entry,
- index->entries->len - 1);
-}
-
-static
-int convert_cycles_to_ns(struct bt_clock_class *clock_class,