Fix: bt2: add precond. check, for stream class supporting discarded msgs with clock...
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 10 Apr 2020 20:31:32 +0000 (16:31 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 11 Apr 2020 23:32:57 +0000 (19:32 -0400)
commitaa7407227594c8e5ebff8e1944a902760f2c9a17
tree693ac12a9e356be50a992a81f7624c15f0be9a91
parent5c72947e9bc82704d451e8f760b5171e374835e5
Fix: bt2: add precond. check, for stream class supporting discarded msgs with clock snapshot without clock class

We hit the following precondition failure from the Python bindings when
creating a stream class that supports discarded event messages with
clock snapshots, but does not have a default clock class.  Same with
discarded packet messages.

    04-10 16:40:32.280 59345 59345 F LIB/STREAM-CLASS bt_stream_class_set_supports_discarded_events@stream-class.c:480 Babeltrace 2 library precondition not satisfied; error is:
    04-10 16:40:32.280 59345 59345 F LIB/STREAM-CLASS bt_stream_class_set_supports_discarded_events@stream-class.c:480 Stream class has no default clock class: addr=0x60f0000023e0, id=0, is-frozen=0, event-class-count=0, packet-context-fc-addr=(nil), event-common-context-fc-addr=(nil), assigns-auto-ec-id=1, assigns-auto-stream-id=1, supports-packets=0, packets-have-begin-default-cs=0, packets-have-end-default-cs=0, supports-discarded-events=0, discarded-events-have-default-cs=0, supports-discarded-packets=0, discarded-packets-have-default-cs=0, trace-class-addr=0x608000002b20, pcf-pool-size=0, pcf-pool-cap=0
    04-10 16:40:32.280 59345 59345 F LIB/STREAM-CLASS bt_stream_class_set_supports_discarded_events@stream-class.c:480 Aborting...

Add some checks for that in _StreamClass._validate_create_params, and
some corresponding tests.

Change-Id: I5d79b8ecfc05acbb79b7b15d28ba2c5c34f00729
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3390
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/bindings/python/bt2/bt2/stream_class.py
tests/bindings/python/bt2/test_stream_class.py
This page took 0.027539 seconds and 4 git commands to generate.