sink.ctf.fs: support packets, DE, and DP w/o beginning/end clock snapshots
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 3 Jun 2019 18:25:12 +0000 (14:25 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 6 Jun 2019 21:19:12 +0000 (17:19 -0400)
commitffb5c13ca2cb0c0e270a00d66e9dca97a8c2f236
tree32610586387ba977cfdd3116de80d5b287f02fdb
parent2e90378a2b94006e2743b06e7fe7a1f0e691a56e
sink.ctf.fs: support packets, DE, and DP w/o beginning/end clock snapshots

This patch makes `sink.ctf.fs` support more stream class configurations.
The table below shows the valid configurations, where:

DE:
    Discarded events.

DP:
    Discarded packets.

CS:
    Clock snapshot.

Each table cell indicates whether or not the given message has a default
clock snapshot (or two default clock snapshots for discarded events
packets messages). Each row is a configuration supported by
`sink.ctf.fs`.

    +------------+------------+-------+-------+
    | Pkt beg CS | Pkt end CS | DE CS | DP CS |
    +------------+------------+-------+-------+
    | No         | No         | No    | No    |
    | No         | Yes        | No    | No    |
    | Yes        | No         | No    | No    |
    | Yes        | Yes        | No    | No    |
    | Yes        | Yes        | No    | Yes   |
    | Yes        | Yes        | Yes   | No    |
    | Yes        | Yes        | Yes   | Yes   |
    +------------+------------+-------+-------+

All other configurations are not supported (the component logs an error
and fails).

As shown by the table above, discarded events and packets messages
without default clock snapshots are always supported:

* Any discarded events message occuring between two packet end messages
  increments the discarded event counter for the packet targeted by the
  second packet end message.

* Any discarded packets message occuring between a packet end message
  and a packet beginning message increments the packet sequence number
  for the packet targeted by the packet beginning message.

When discarded events/packets messages have default clock snapshots,
however, packet beginning and end messages must also have default clock
snapshots. This is to ensure that the discarded item time range matches
what is specified by CTF, which relies on the packet time ranges.
`src.ctf.fs` never produces (and will never produce) such a
configuration, so the CTF-to-CTF use case remains completely compatible.

When packet beginning messages have no default clock snapshot, the
generated packet context has no `timestamp_begin` member.

When packet end messages have no default clock snapshot, the generated
packet context has no `timestamp_end` member.

When a stream class does not support discarded event messages, the
generated packet context has no `events_discarded` member.

NOTE: As of this patch, `src.ctf.fs` cannot produce all the
configurations above. This work is reserved for a future patch.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I4e4fcb5c6f4e363d5c467427fb151c725d100cfb
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1366
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins
plugins/ctf/fs-sink/fs-sink-ctf-meta.h
plugins/ctf/fs-sink/fs-sink-stream.c
plugins/ctf/fs-sink/fs-sink.c
plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c
This page took 0.024813 seconds and 4 git commands to generate.