src.ctf.fs: use the new metadata stream parser and message iterator
Update the src.ctf.fs component class to use:
- the new metadata stream parser / IR generator (ctf::src::CtfIrGenerator)
- the new message iterator (ctf::src::MsgIter)
The new IR generator produces a trace class instance using the new CTF
IR type, ctf::src::TraceCls. This instance is then fed to the message
iterator. These two changes must therefore be done in lock step.
Add ctf::src::fs::Medium, a Medium for use with ctf::src::ItemSeqIter
that reads trace data from the filesystem. It receives an index, which
can be thought of as the "playlist" of packets that form the logical
data stream. Its buf method needs to be able to find a packet given a
requested offset in that logical data stream. Therefore, add a new
`offsetInStream` field in the ctf_fs_ds_index_entry structure, and the
`updateOffsetsInStream` method to compute them. Rename
ctf_fs_ds_index_entry::offset to offsetInFile, for clarity.
Once the buf method selected the right index entry (packet), it maps
that portion of the file, and see if the returned buffer can include
some of the following packets in the file, while at it.
Other details about the changes in this patch, in no particular order:
- Make a copy of ctf_trace_class_configure_ir_trace that works on a
ctf::src::TraceCls instead of a struct ctf_trace_class. The old one
will be removed once src.ctf.lttng-live no longer uses it.
- Remove ctf_fs_metadata, the required fields (the decoder / IR
generator) are now directly in ctf_fs_trace.
- The quirks to apply are saved in the ctf_fs_component object
directly. They were previously saved in the old IR object (struct
ctf_trace_class), but they are not in the new IR object. They now
need to be passed to all instantiated message iterators.
- Remove ctf_fs_msg_iter_data::ds_file_group, add
ctf_fs_msg_iter_data::port_data. This allows message iterators to
access the ctf_fs_component and therefore the quirks. They can still
access the ds_file_group through the port_data.
- Replace ctf_fs_msg_iter_data::msg_iter (the old message iterator)
with ctf_fs_msg_iter_data::msgIter (the new message iterator).
- Remove ctf_fs_msg_iter_data::msg_iter_medops_data, this is the data
for the medium (medops) for the old message iterator.
- Adjust ctf_fs_iterator_init, ctf_fs_iterator_next,
ctf_fs_iterator_finalize to the new message iterator.
- Adjust ctf_fs_iterator_seek_beginning to the new message iterator.
The simplest way I found to reset the state to the beginning state is
to delete the message iterator and instantiate a new one.
- Update add_ds_file_to_ds_file_group to use readPktProps to read the
stream class and id.
- Change decode_clock_snapshot_after_event, used for working around
known tracer bugs, to use an ItemSeqIter. Define two item visitors,
ClockSnapshotAfterFirstEventItemVisitor and
ClockSnapshotAfterLastEventItemVisitor, for the two cases.
Change-Id: I8e3ce344c940da2106bdf8320c28724ca360b48a
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8349
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12744
17 files changed:
This page took 0.026211 seconds and 4 git commands to generate.