This patch adds a new component class, `src.ctf.lttng-archive`, of which
a message iterator consumes file system LTTng trace archives (the result
of an LTTng recording session rotation operation) for a given recording
session as LTTng produces them, optionally removing them when they're
not needed anymore.
This is a proof of concept, therefore it comes without documentation and
tests, and also assumes a few LTTng parameters:
• Each trace archive has a single CTF trace (in other words, only
per-UID channels with a single user ID).
• Each trace archive has a single data stream file per channel/CPU pair.
• The number of data stream files of the earliest non-empty trace
archive determines the expected number of data stream files in the
following non-empty trace archives.
• The metadata streams of all the non-empty trace archives are the same
(the component only parses the earliest).
This means you must start at least one instance of any application to
trace before the first recording session rotation operation.
The component accepts the following initialization parameters:
session-name=SESSION (mandatory):
Read the trace archives of the LTTng recording session
named SESSION.
session-found-file-path=PATH (optional):
When the targeted recording session (`session-name` parameter) is
found, write an empty file to PATH.
This is useful for short recording sessions, where the component
could miss an lttng_list_sessions() call between the creation and
destruction of a recording session.
The component also accepts all the `src.ctf.fs` initialization
parameters except `inputs`.
The component creates a single output port named `out`, sorting messages
internally just like `src.ctf.lttng-live` does. Therefore, you don't
need an `flt.utils.muxer` component downstream.
You must create a _single_ message iterator for a given
`src.ctf.lttng-archive` component.
The message iterator has the following stages (within its
"next" method):
1. Waits for the targeted recording session to exist, returning the "try
again" status if it doesn't yet.
2. Waits for the first non-empty trace archive to exist, returning the
"try again" status if it doesn't yet.
3. Consumes data stream files from existing trace archives, emitting
corresponding messages.
If it needs a new data stream file for a specific data stream, it
reads it from the next trace archive. If there's no next trace
archive, then it returns the "try again" status.
4. If it detects that the targeted recording session is destroyed, then
it waits for the final trace archive to exist so as to consume it and
eventually return the "end of iteration" status.
This new component uses liblttng-ctl to get some LTTng recording session
details (its output directory and whether or not it exists, for
example). Therefore, the project configuration script needs to find
liblttng-ctl through pkg-config.
With the INFO logging level enabled, you can see details whenever the
message iterator is waiting for something.
Signed-off-by: Philippe Proulx <email address hidden>
Change-Id: Iec076c4735d95be8f86ffc80ebc80776fcbe0a21
src.ctf.fs: always set the correct trace IR stream ID
In add_ds_file_to_ds_file_group(), we don't use the original CTF data
stream ID to set the trace IR stream ID whenever the beginning timestamp
is missing.
The comment says:
if (begin_ns == -1) {
/*
* No beginning timestamp to sort the stream files
* within a stream file group, so consider that this
* file must be the only one within its group.
*/ stream_instance_id.reset();
}
This might be true, but there's no need to reset the data stream ID.
Then during data stream decoding, the trace IR stream ID always matches
the CTF IR data stream ID (if any), which enables some further checks.
Furthermore, a trace which goes from `src.ctf.fs` to `sink.ctf.fs` will
keep its original data stream IDs.
Signed-off-by: Philippe Proulx <email address hidden>
Change-Id: I3c6ea0a3cbd913017cd00c1c07c6c6bf83b8a534
This patch changes `tests/data/plugins/src.ctf.fs/field/data_from_mp.py`
to add CTF 2 support.
The script generates a CTF 2 trace when the stripped field class text
starts with `{` (full field class) or `"` (field class alias), which are
exclusive to the CTF 2 metadata syntax (any CTF 1.8 field class starts
with some keyword).
The same automatic field class aliases as the CTF 1.8 case
are available.
_make_ctf_2_metadata() doesn't need the `@` replacement trick of
_make_ctf_1_metadata() because CTF 2 array field classes aren't
different from any CTF 2 field class, for example: