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)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 18 Jun 2019 21:12:13 +0000 (17:12 -0400)
commitdcd94213f4a0a4fa9a49e22e74f7c421ef4ac68a
treecab47910af2cfc9af6f59e5078f5a0f7026fcae6
parent82c537ae0e9f9c5dc74c9dc88e05fc02d318dcfc
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.026802 seconds and 4 git commands to generate.