2 * Copyright 2016-2017 - Philippe Proulx <pproulx@efficios.com>
3 * Copyright 2016 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * Copyright 2010-2011 - EfficiOS Inc. and Linux Foundation
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 #define BT_COMP_LOG_SELF_COMP (ds_file->self_comp)
26 #define BT_LOG_OUTPUT_LEVEL (ds_file->log_level)
27 #define BT_LOG_TAG "PLUGIN/SRC.CTF.FS/DS"
28 #include "plugins/comp-logging.h"
37 #include "compat/mman.h"
38 #include "compat/endian.h"
39 #include <babeltrace2/babeltrace.h>
40 #include "common/common.h"
43 #include "../common/msg-iter/msg-iter.h"
44 #include "common/assert.h"
45 #include "data-stream-file.h"
49 size_t remaining_mmap_bytes(struct ctf_fs_ds_file
*ds_file
)
51 BT_ASSERT(ds_file
->mmap_len
>= ds_file
->request_offset
);
52 return ds_file
->mmap_len
- ds_file
->request_offset
;
56 int ds_file_munmap(struct ctf_fs_ds_file
*ds_file
)
60 if (!ds_file
|| !ds_file
->mmap_addr
) {
64 if (bt_munmap(ds_file
->mmap_addr
, ds_file
->mmap_len
)) {
65 BT_COMP_LOGE_ERRNO("Cannot memory-unmap file",
66 ": address=%p, size=%zu, file_path=\"%s\", file=%p",
67 ds_file
->mmap_addr
, ds_file
->mmap_len
,
68 ds_file
->file
? ds_file
->file
->path
->str
: "NULL",
69 ds_file
->file
? ds_file
->file
->fp
: NULL
);
74 ds_file
->mmap_addr
= NULL
;
81 enum bt_msg_iter_medium_status
ds_file_mmap_next(
82 struct ctf_fs_ds_file
*ds_file
)
84 enum bt_msg_iter_medium_status ret
=
85 BT_MSG_ITER_MEDIUM_STATUS_OK
;
87 /* Unmap old region */
88 if (ds_file
->mmap_addr
) {
89 if (ds_file_munmap(ds_file
)) {
94 * mmap_len is guaranteed to be page-aligned except on the
95 * last mapping where it may not be possible (since the file's
96 * size itself may not be a page multiple).
98 ds_file
->mmap_offset
+= ds_file
->mmap_len
;
99 ds_file
->request_offset
= 0;
102 ds_file
->mmap_len
= MIN(ds_file
->file
->size
- ds_file
->mmap_offset
,
103 ds_file
->mmap_max_len
);
104 if (ds_file
->mmap_len
== 0) {
105 ret
= BT_MSG_ITER_MEDIUM_STATUS_EOF
;
109 BT_ASSERT(ds_file
->mmap_len
);
110 ds_file
->mmap_addr
= bt_mmap((void *) 0, ds_file
->mmap_len
,
111 PROT_READ
, MAP_PRIVATE
, fileno(ds_file
->file
->fp
),
112 ds_file
->mmap_offset
, ds_file
->log_level
);
113 if (ds_file
->mmap_addr
== MAP_FAILED
) {
114 BT_COMP_LOGE("Cannot memory-map address (size %zu) of file \"%s\" (%p) at offset %jd: %s",
115 ds_file
->mmap_len
, ds_file
->file
->path
->str
,
116 ds_file
->file
->fp
, (intmax_t) ds_file
->mmap_offset
,
123 ds_file_munmap(ds_file
);
124 ret
= BT_MSG_ITER_MEDIUM_STATUS_ERROR
;
130 enum bt_msg_iter_medium_status
medop_request_bytes(
131 size_t request_sz
, uint8_t **buffer_addr
,
132 size_t *buffer_sz
, void *data
)
134 enum bt_msg_iter_medium_status status
=
135 BT_MSG_ITER_MEDIUM_STATUS_OK
;
136 struct ctf_fs_ds_file
*ds_file
= data
;
138 if (request_sz
== 0) {
143 * Check if we have at least one memory-mapped byte left. If we don't,
144 * mmap the next file.
146 if (remaining_mmap_bytes(ds_file
) == 0) {
147 /* Are we at the end of the file? */
148 if (ds_file
->mmap_offset
>= ds_file
->file
->size
) {
149 BT_COMP_LOGD("Reached end of file \"%s\" (%p)",
150 ds_file
->file
->path
->str
, ds_file
->file
->fp
);
151 status
= BT_MSG_ITER_MEDIUM_STATUS_EOF
;
155 status
= ds_file_mmap_next(ds_file
);
157 case BT_MSG_ITER_MEDIUM_STATUS_OK
:
159 case BT_MSG_ITER_MEDIUM_STATUS_EOF
:
162 BT_COMP_LOGE("Cannot memory-map next region of file \"%s\" (%p)",
163 ds_file
->file
->path
->str
,
169 *buffer_sz
= MIN(remaining_mmap_bytes(ds_file
), request_sz
);
170 BT_ASSERT(ds_file
->mmap_addr
);
171 *buffer_addr
= ((uint8_t *) ds_file
->mmap_addr
) + ds_file
->request_offset
;
172 ds_file
->request_offset
+= *buffer_sz
;
176 status
= BT_MSG_ITER_MEDIUM_STATUS_ERROR
;
183 bt_stream
*medop_borrow_stream(bt_stream_class
*stream_class
, int64_t stream_id
,
186 struct ctf_fs_ds_file
*ds_file
= data
;
187 bt_stream_class
*ds_file_stream_class
;
188 bt_stream
*stream
= NULL
;
190 ds_file_stream_class
= bt_stream_borrow_class(
193 if (stream_class
!= ds_file_stream_class
) {
195 * Not supported: two packets described by two different
196 * stream classes within the same data stream file.
201 stream
= ds_file
->stream
;
208 enum bt_msg_iter_medium_status
medop_seek(enum bt_msg_iter_seek_whence whence
,
209 off_t offset
, void *data
)
211 enum bt_msg_iter_medium_status ret
=
212 BT_MSG_ITER_MEDIUM_STATUS_OK
;
213 struct ctf_fs_ds_file
*ds_file
= data
;
214 off_t offset_in_mapping
, file_size
= ds_file
->file
->size
;
216 if (whence
!= BT_MSG_ITER_SEEK_WHENCE_SET
||
217 offset
< 0 || offset
> file_size
) {
218 BT_COMP_LOGE("Invalid medium seek request: whence=%d, offset=%jd, "
219 "file-size=%jd", (int) whence
, offset
,
221 ret
= BT_MSG_ITER_MEDIUM_STATUS_INVAL
;
225 /* If there is no current mapping, map the right file directly. */
226 if (!ds_file
->mmap_addr
) {
227 goto map_requested_offset
;
231 * Determine whether or not the destination is contained within the
234 if (offset
< ds_file
->mmap_offset
||
235 offset
>= ds_file
->mmap_offset
+ ds_file
->mmap_len
) {
237 BT_COMP_LOGD("Medium seek request cannot be accomodated by the current "
238 "file mapping: offset=%jd, mmap-offset=%jd, "
239 "mmap-len=%zu", offset
, ds_file
->mmap_offset
,
241 unmap_ret
= ds_file_munmap(ds_file
);
243 ret
= BT_MSG_ITER_MEDIUM_STATUS_ERROR
;
246 goto map_requested_offset
;
248 ds_file
->request_offset
= offset
- ds_file
->mmap_offset
;
252 map_requested_offset
:
253 offset_in_mapping
= offset
%
254 bt_common_get_page_size(ds_file
->log_level
);
256 ds_file
->mmap_offset
= offset
- offset_in_mapping
;
257 ds_file
->request_offset
= offset_in_mapping
;
258 ret
= ds_file_mmap_next(ds_file
);
259 if (ret
!= BT_MSG_ITER_MEDIUM_STATUS_OK
) {
264 ds_file
->end_reached
= (offset
== file_size
);
270 struct bt_msg_iter_medium_ops ctf_fs_ds_file_medops
= {
271 .request_bytes
= medop_request_bytes
,
272 .borrow_stream
= medop_borrow_stream
,
277 int convert_cycles_to_ns(struct ctf_clock_class
*clock_class
,
278 uint64_t cycles
, int64_t *ns
)
280 return bt_util_clock_cycles_to_ns_from_origin(cycles
,
281 clock_class
->frequency
, clock_class
->offset_seconds
,
282 clock_class
->offset_cycles
, ns
);
286 struct ctf_fs_ds_index
*build_index_from_idx_file(
287 struct ctf_fs_ds_file
*ds_file
)
290 gchar
*directory
= NULL
;
291 gchar
*basename
= NULL
;
292 GString
*index_basename
= NULL
;
293 gchar
*index_file_path
= NULL
;
294 GMappedFile
*mapped_file
= NULL
;
296 const char *mmap_begin
= NULL
, *file_pos
= NULL
;
297 const struct ctf_packet_index_file_hdr
*header
= NULL
;
298 struct ctf_fs_ds_index
*index
= NULL
;
299 struct ctf_fs_ds_index_entry
*index_entry
= NULL
, *prev_index_entry
= NULL
;
300 uint64_t total_packets_size
= 0;
301 size_t file_index_entry_size
;
302 size_t file_entry_count
;
304 struct ctf_stream_class
*sc
;
305 struct bt_msg_iter_packet_properties props
;
307 BT_COMP_LOGI("Building index from .idx file of stream file %s",
308 ds_file
->file
->path
->str
);
309 ret
= bt_msg_iter_get_packet_properties(ds_file
->msg_iter
, &props
);
311 BT_COMP_LOGI_STR("Cannot read first packet's header and context fields.");
315 sc
= ctf_trace_class_borrow_stream_class_by_id(ds_file
->metadata
->tc
,
316 props
.stream_class_id
);
318 if (!sc
->default_clock_class
) {
319 BT_COMP_LOGI_STR("Cannot find stream class's default clock class.");
323 /* Look for index file in relative path index/name.idx. */
324 basename
= g_path_get_basename(ds_file
->file
->path
->str
);
326 BT_COMP_LOGE("Cannot get the basename of datastream file %s",
327 ds_file
->file
->path
->str
);
331 directory
= g_path_get_dirname(ds_file
->file
->path
->str
);
333 BT_COMP_LOGE("Cannot get dirname of datastream file %s",
334 ds_file
->file
->path
->str
);
338 index_basename
= g_string_new(basename
);
339 if (!index_basename
) {
340 BT_COMP_LOGE_STR("Cannot allocate index file basename string");
344 g_string_append(index_basename
, ".idx");
345 index_file_path
= g_build_filename(directory
, "index",
346 index_basename
->str
, NULL
);
347 mapped_file
= g_mapped_file_new(index_file_path
, FALSE
, NULL
);
349 BT_COMP_LOGD("Cannot create new mapped file %s",
355 * The g_mapped_file API limits us to 4GB files on 32-bit.
356 * Traces with such large indexes have never been seen in the wild,
357 * but this would need to be adjusted to support them.
359 filesize
= g_mapped_file_get_length(mapped_file
);
360 if (filesize
< sizeof(*header
)) {
361 BT_COMP_LOGW("Invalid LTTng trace index file: "
362 "file size (%zu bytes) < header size (%zu bytes)",
363 filesize
, sizeof(*header
));
367 mmap_begin
= g_mapped_file_get_contents(mapped_file
);
368 header
= (struct ctf_packet_index_file_hdr
*) mmap_begin
;
370 file_pos
= g_mapped_file_get_contents(mapped_file
) + sizeof(*header
);
371 if (be32toh(header
->magic
) != CTF_INDEX_MAGIC
) {
372 BT_COMP_LOGW_STR("Invalid LTTng trace index: \"magic\" field validation failed");
376 file_index_entry_size
= be32toh(header
->packet_index_len
);
377 file_entry_count
= (filesize
- sizeof(*header
)) / file_index_entry_size
;
378 if ((filesize
- sizeof(*header
)) % file_index_entry_size
) {
379 BT_COMP_LOGW("Invalid LTTng trace index: the index's size after the header "
380 "(%zu bytes) is not a multiple of the index entry size "
381 "(%zu bytes)", (filesize
- sizeof(*header
)),
386 index
= ctf_fs_ds_index_create(ds_file
->log_level
, ds_file
->self_comp
);
391 for (i
= 0; i
< file_entry_count
; i
++) {
392 struct ctf_packet_index
*file_index
=
393 (struct ctf_packet_index
*) file_pos
;
394 uint64_t packet_size
= be64toh(file_index
->packet_size
);
396 if (packet_size
% CHAR_BIT
) {
397 BT_COMP_LOGW("Invalid packet size encountered in LTTng trace index file");
401 index_entry
= g_new0(struct ctf_fs_ds_index_entry
, 1);
406 /* Convert size in bits to bytes. */
407 packet_size
/= CHAR_BIT
;
408 index_entry
->packet_size
= packet_size
;
410 index_entry
->offset
= be64toh(file_index
->offset
);
411 if (i
!= 0 && index_entry
->offset
< prev_index_entry
->offset
) {
412 BT_COMP_LOGW("Invalid, non-monotonic, packet offset encountered in LTTng trace index file: "
413 "previous offset=%" PRIu64
", current offset=%" PRIu64
,
414 prev_index_entry
->offset
, index_entry
->offset
);
418 index_entry
->timestamp_begin
= be64toh(file_index
->timestamp_begin
);
419 index_entry
->timestamp_end
= be64toh(file_index
->timestamp_end
);
420 if (index_entry
->timestamp_end
< index_entry
->timestamp_begin
) {
421 BT_COMP_LOGW("Invalid packet time bounds encountered in LTTng trace index file (begin > end): "
422 "timestamp_begin=%" PRIu64
"timestamp_end=%" PRIu64
,
423 index_entry
->timestamp_begin
,
424 index_entry
->timestamp_end
);
428 /* Convert the packet's bound to nanoseconds since Epoch. */
429 ret
= convert_cycles_to_ns(sc
->default_clock_class
,
430 index_entry
->timestamp_begin
,
431 &index_entry
->timestamp_begin_ns
);
433 BT_COMP_LOGI_STR("Failed to convert raw timestamp to nanoseconds since Epoch during index parsing");
436 ret
= convert_cycles_to_ns(sc
->default_clock_class
,
437 index_entry
->timestamp_end
,
438 &index_entry
->timestamp_end_ns
);
440 BT_COMP_LOGI_STR("Failed to convert raw timestamp to nanoseconds since Epoch during LTTng trace index parsing");
444 total_packets_size
+= packet_size
;
445 file_pos
+= file_index_entry_size
;
447 g_ptr_array_add(index
->entries
, index_entry
);
448 prev_index_entry
= index_entry
;
451 /* Validate that the index addresses the complete stream. */
452 if (ds_file
->file
->size
!= total_packets_size
) {
453 BT_COMP_LOGW("Invalid LTTng trace index file; indexed size != stream file size: "
454 "file-size=%" PRIu64
", total-packets-size=%" PRIu64
,
455 ds_file
->file
->size
, total_packets_size
);
461 g_free(index_file_path
);
462 if (index_basename
) {
463 g_string_free(index_basename
, TRUE
);
466 g_mapped_file_unref(mapped_file
);
470 ctf_fs_ds_index_destroy(index
);
477 int init_index_entry(struct ctf_fs_ds_index_entry
*entry
,
478 struct ctf_fs_ds_file
*ds_file
,
479 struct bt_msg_iter_packet_properties
*props
,
480 off_t packet_size
, off_t packet_offset
)
483 struct ctf_stream_class
*sc
;
485 sc
= ctf_trace_class_borrow_stream_class_by_id(ds_file
->metadata
->tc
,
486 props
->stream_class_id
);
488 BT_ASSERT(packet_offset
>= 0);
489 entry
->offset
= packet_offset
;
490 BT_ASSERT(packet_size
>= 0);
491 entry
->packet_size
= packet_size
;
493 if (props
->snapshots
.beginning_clock
!= UINT64_C(-1)) {
494 /* Convert the packet's bound to nanoseconds since Epoch. */
495 ret
= convert_cycles_to_ns(sc
->default_clock_class
,
496 props
->snapshots
.beginning_clock
,
497 &entry
->timestamp_begin_ns
);
499 BT_COMP_LOGI_STR("Failed to convert raw timestamp to nanoseconds since Epoch.");
503 entry
->timestamp_begin_ns
= UINT64_C(-1);
506 if (props
->snapshots
.end_clock
!= UINT64_C(-1)) {
507 ret
= convert_cycles_to_ns(sc
->default_clock_class
,
508 props
->snapshots
.end_clock
,
509 &entry
->timestamp_end_ns
);
511 BT_COMP_LOGI_STR("Failed to convert raw timestamp to nanoseconds since Epoch.");
515 entry
->timestamp_end_ns
= UINT64_C(-1);
523 struct ctf_fs_ds_index
*build_index_from_stream_file(
524 struct ctf_fs_ds_file
*ds_file
)
527 struct ctf_fs_ds_index
*index
= NULL
;
528 enum bt_msg_iter_status iter_status
= BT_MSG_ITER_STATUS_OK
;
529 off_t current_packet_offset_bytes
= 0;
531 BT_COMP_LOGI("Indexing stream file %s", ds_file
->file
->path
->str
);
533 index
= ctf_fs_ds_index_create(ds_file
->log_level
, ds_file
->self_comp
);
539 off_t current_packet_size_bytes
;
540 struct ctf_fs_ds_index_entry
*index_entry
;
541 struct bt_msg_iter_packet_properties props
;
543 if (current_packet_offset_bytes
< 0) {
544 BT_COMP_LOGE_STR("Cannot get the current packet's offset.");
546 } else if (current_packet_offset_bytes
> ds_file
->file
->size
) {
547 BT_COMP_LOGE_STR("Unexpected current packet's offset (larger than file).");
549 } else if (current_packet_offset_bytes
== ds_file
->file
->size
) {
554 iter_status
= bt_msg_iter_seek(ds_file
->msg_iter
,
555 current_packet_offset_bytes
);
556 if (iter_status
!= BT_MSG_ITER_STATUS_OK
) {
560 iter_status
= bt_msg_iter_get_packet_properties(
561 ds_file
->msg_iter
, &props
);
562 if (iter_status
!= BT_MSG_ITER_STATUS_OK
) {
566 if (props
.exp_packet_total_size
>= 0) {
567 current_packet_size_bytes
=
568 (uint64_t) props
.exp_packet_total_size
/ 8;
570 current_packet_size_bytes
= ds_file
->file
->size
;
573 if (current_packet_offset_bytes
+ current_packet_size_bytes
>
574 ds_file
->file
->size
) {
575 BT_COMP_LOGW("Invalid packet size reported in file: stream=\"%s\", "
576 "packet-offset=%jd, packet-size-bytes=%jd, "
578 ds_file
->file
->path
->str
,
579 current_packet_offset_bytes
,
580 current_packet_size_bytes
,
581 ds_file
->file
->size
);
585 index_entry
= g_new0(struct ctf_fs_ds_index_entry
, 1);
587 BT_COMP_LOGE_STR("Failed to allocate a new index entry.");
591 ret
= init_index_entry(index_entry
, ds_file
, &props
,
592 current_packet_size_bytes
, current_packet_offset_bytes
);
598 g_ptr_array_add(index
->entries
, index_entry
);
600 current_packet_offset_bytes
+= current_packet_size_bytes
;
601 BT_COMP_LOGD("Seeking to next packet: current-packet-offset=%jd, "
602 "next-packet-offset=%jd",
603 current_packet_offset_bytes
- current_packet_size_bytes
,
604 current_packet_offset_bytes
);
606 } while (iter_status
== BT_MSG_ITER_STATUS_OK
);
608 if (iter_status
!= BT_MSG_ITER_STATUS_OK
) {
616 ctf_fs_ds_index_destroy(index
);
622 struct ctf_fs_ds_file
*ctf_fs_ds_file_create(
623 struct ctf_fs_trace
*ctf_fs_trace
,
624 bt_self_message_iterator
*pc_msg_iter
,
625 struct bt_msg_iter
*msg_iter
,
626 bt_stream
*stream
, const char *path
,
627 bt_logging_level log_level
)
630 const size_t page_size
= bt_common_get_page_size(log_level
);
631 struct ctf_fs_ds_file
*ds_file
= g_new0(struct ctf_fs_ds_file
, 1);
637 ds_file
->log_level
= log_level
;
638 ds_file
->self_comp
= ctf_fs_trace
->self_comp
;
639 ds_file
->pc_msg_iter
= pc_msg_iter
;
640 ds_file
->file
= ctf_fs_file_create(log_level
, ds_file
->self_comp
);
641 if (!ds_file
->file
) {
645 ds_file
->stream
= stream
;
646 bt_stream_get_ref(ds_file
->stream
);
647 ds_file
->metadata
= ctf_fs_trace
->metadata
;
648 g_string_assign(ds_file
->file
->path
, path
);
649 ret
= ctf_fs_file_open(ds_file
->file
, "rb");
654 ds_file
->msg_iter
= msg_iter
;
655 bt_msg_iter_set_medops_data(ds_file
->msg_iter
, ds_file
);
656 if (!ds_file
->msg_iter
) {
660 ds_file
->mmap_max_len
= page_size
* 2048;
665 /* Do not touch "borrowed" file. */
666 ctf_fs_ds_file_destroy(ds_file
);
674 struct ctf_fs_ds_index
*ctf_fs_ds_file_build_index(
675 struct ctf_fs_ds_file
*ds_file
)
677 struct ctf_fs_ds_index
*index
;
679 index
= build_index_from_idx_file(ds_file
);
684 BT_COMP_LOGI("Failed to build index from .index file; "
685 "falling back to stream indexing.");
686 index
= build_index_from_stream_file(ds_file
);
692 struct ctf_fs_ds_index
*ctf_fs_ds_index_create(bt_logging_level log_level
,
693 bt_self_component
*self_comp
)
695 struct ctf_fs_ds_index
*index
= g_new0(struct ctf_fs_ds_index
, 1);
698 BT_COMP_LOG_CUR_LVL(BT_LOG_ERROR
, log_level
, self_comp
,
699 "Failed to allocate index");
703 index
->entries
= g_ptr_array_new_with_free_func((GDestroyNotify
) g_free
);
704 if (!index
->entries
) {
705 BT_COMP_LOG_CUR_LVL(BT_LOG_ERROR
, log_level
, self_comp
,
706 "Failed to allocate index entries.");
713 ctf_fs_ds_index_destroy(index
);
720 void ctf_fs_ds_file_destroy(struct ctf_fs_ds_file
*ds_file
)
726 bt_stream_put_ref(ds_file
->stream
);
727 (void) ds_file_munmap(ds_file
);
730 ctf_fs_file_destroy(ds_file
->file
);
737 bt_component_class_message_iterator_next_method_status
ctf_fs_ds_file_next(
738 struct ctf_fs_ds_file
*ds_file
,
741 enum bt_msg_iter_status msg_iter_status
;
742 bt_component_class_message_iterator_next_method_status status
;
744 msg_iter_status
= bt_msg_iter_get_next_message(
745 ds_file
->msg_iter
, ds_file
->pc_msg_iter
, msg
);
747 switch (msg_iter_status
) {
748 case BT_MSG_ITER_STATUS_EOF
:
749 status
= BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_END
;
751 case BT_MSG_ITER_STATUS_OK
:
752 status
= BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_OK
;
754 case BT_MSG_ITER_STATUS_AGAIN
:
756 * Should not make it this far as this is
757 * medium-specific; there is nothing for the user to do
758 * and it should have been handled upstream.
761 case BT_MSG_ITER_STATUS_INVAL
:
762 case BT_MSG_ITER_STATUS_ERROR
:
764 status
= BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_ERROR
;
771 void ctf_fs_ds_index_destroy(struct ctf_fs_ds_index
*index
)
777 if (index
->entries
) {
778 g_ptr_array_free(index
->entries
, TRUE
);