ctf.fs source: add trace file rotation (stream instance ID) support
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 24 May 2017 00:47:58 +0000 (20:47 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:44 +0000 (12:57 -0400)
commit94cf822ec0adbb6d6d33d6475c5b58e1dd7e2b79
treeecf3aaf42d99695e9dbad3ce6f4caa5a7eb82a20
parent87187cbfcf0ff2101a05e58d9043ffa86108f431
ctf.fs source: add trace file rotation (stream instance ID) support

ctf.fs source is changed as such:

* A CTF FS trace owns zero or more stream file groups.

* A stream file group owns a unique CTF IR stream object and one or more
  stream file infos.

* A stream file info contains a path and a beginning timestamp (the
  beginning timestamp of the stream file's first packet).

* Stream file infos are ordered by time in a stream file group.

* One output port is created for each stream file group. It is also
  associated to this stream file group through private port's user data.

  The name of the port is always the stream file group's first stream
  file info's path, which is always the path of stream file containing
  the oldest packet. This can be useful to isolate a group of stream
  files by name and possibly CPU ID, e.g. (CPU 1 of LTTng channel
  `my-channel`):

      --connect='ctf.*my-channel_1_*:mux'

  or all CPUs of LTTng channel `hello-chan`:

      --connect='ctf.*hello-chan_*:mux'

* The user data of a notification iterator contains its upstream port's
  stream file group and a stream file info index.

* For a given notification iterator, one data stream file object (owner
  of a binary notification iterator and the one which does the stream
  file memory mapping) is always active. When it returns a
  BT_NOTIFICATION_ITERATOR_STATUS_END status, the data stream file is
  destroyed and the next stream file info is used to create a new data
  stream file, from which the real next notification is obtained. If
  there's no more stream file info in the stream file group, then
  BT_NOTIFICATION_ITERATOR_STATUS_END is returned.

This patch effectively makes a ctf.fs source component create one unique
stream, and thus one port, for each stream instance of each trace,
therefore supporting trace file rotation. Only one stream file is
opened and memory mapped at any time for a given stream instance.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/ctf/fs-src/Makefile.am
plugins/ctf/fs-src/data-stream-file.c [new file with mode: 0644]
plugins/ctf/fs-src/data-stream-file.h [new file with mode: 0644]
plugins/ctf/fs-src/data-stream.c [deleted file]
plugins/ctf/fs-src/data-stream.h [deleted file]
plugins/ctf/fs-src/fs.c
plugins/ctf/fs-src/fs.h
This page took 0.024866 seconds and 4 git commands to generate.