- ret = ctf_fs_ds_file_get_packet_header_context_fields(
- ctf_fs_trace, path, &packet_header_field,
- &packet_context_field);
+ ds_file = ctf_fs_ds_file_create(ctf_fs_trace, NULL, path);
+ if (!ds_file) {
+ goto error;
+ }
+
+ ret = ctf_fs_ds_file_get_packet_header_context_fields(ds_file,
+ &packet_header_field, &packet_context_field);