lib: add precondition checks that count of discarded events/packets is greater than 0
It does not make sense to send a discarded packet or discarded event
message with the count 0. That would mean that there is no discarded
event or packet, so the message must simply not be sent. If the number
of packets or events that were discarded is unknown, the count must not
be set, in which case it will stay "unavailable".
A precondition failure looks like:
04-12 00:17:25.171 680020 680020 F LIB/MSG-DISCARDED-ITEMS bt_message_discarded_packets_set_count@discarded-items.c:317 Babeltrace 2 library precondition not satisfied; error is:
04-12 00:17:25.171 680020 680020 F LIB/MSG-DISCARDED-ITEMS bt_message_discarded_packets_set_count@discarded-items.c:317 Discarded packet count is 0.
04-12 00:17:25.171 680020 680020 F LIB/MSG-DISCARDED-ITEMS bt_message_discarded_packets_set_count@discarded-items.c:317 Aborting...
The equivalent checks are added to the Python bindings, as well as
tests.
Change-Id: I3b56f2635df5d918ec35e9756b0a9658e1a1668d
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3388
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.026992 seconds and 4 git commands to generate.