bt2: stream activity messages: create with unknown/infinite default CS
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 14 Jun 2019 02:22:26 +0000 (22:22 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 18 Jun 2019 04:18:14 +0000 (00:18 -0400)
commitc6af194f4d5f4478fbd14a019e41cff93f9c207e
treeb1cff759e078b1a36e35c3d25bfeb7105debbe34
parent662514648ee42c5c45fe27a0d4702ef825eb4b16
bt2: stream activity messages: create with unknown/infinite default CS

This patch makes it possible to create stream activity beginning and end
messages with unknown or infinite default clock snapshots. It was
already possible to create them with known default clock snapshots, that
is, with a value.

With this patch, you pass either `self._unknown_clock_snapshot` or
`self._infinite_clock_snapshot`, when implementing a
`bt2._UserMessageIterator`, as the default clock snapshot when you call
self._create_stream_activity_beginning_message() or
self._create_stream_activity_end_message(). They are instances of
internal types which are only used for this. The creation methods use
`_unknown_clock_snapshot` by default. This is similar to how
bt_message_stream_activity_beginning_create() and
bt_message_stream_activity_end_create() create messages with unknown
default clock snapshots.

`test_message.py` tests the new feature.

Also in this patch: `_BaseClockSnapshot` does not inherit
`object._UniqueObject` anymore so that `_UnknownClockSnapshot` and
`_InfiniteClockSnapshot` do not either. This is so that the default
clock snapshot properties of the stream activity beginning/end messages
can return instances of those types without having actual native
pointers, because there are none.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I56d5cd9fffb77d505f61522073aaf80ccd58eb8e
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1430
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
src/bindings/python/bt2/bt2/__init__.py.in
src/bindings/python/bt2/bt2/clock_snapshot.py
src/bindings/python/bt2/bt2/message.py
src/bindings/python/bt2/bt2/message_iterator.py
src/bindings/python/bt2/bt2/utils.py
tests/bindings/python/bt2/test_message.py
This page took 0.025287 seconds and 4 git commands to generate.