bt2: make bt_bt2_trace_{,class}_add_destruction_listener return a status
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 23 Jul 2019 04:11:44 +0000 (00:11 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 24 Jul 2019 04:18:54 +0000 (00:18 -0400)
commitee2cad25d5c65cd781169c897a53310cee9948fe
tree83eeb528a23bb283487496fbb4bd5820caac13f9
parent5ae9f1bf3332a2dff16e6e811b982f0b5602dc47
bt2: make bt_bt2_trace_{,class}_add_destruction_listener return a status

If the calls to bt_trace_class_add_destruction_listener and
bt_trace_add_destruction_listener in the Python bindings fail (due to an
hypothetical memory error that can't happen today), abort is called.

Strangely, back on the Python side, there is a "listener_id is None"
check that is a bit useless, since we would have aborted had there been
a failure.

Regularize the situation by making the
bt_bt2_trace_class_add_destruction_listener and
bt_bt2_trace_add_destruction_listener wrappers return a status, like any
other API function.  We can then use utils._handle_func_status like
everywhere else.

Change-Id: I17901a0278f1615b45e6adc3b7223f1b3b3ff35e
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1744
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/bindings/python/bt2/bt2/native_bt_trace.i
src/bindings/python/bt2/bt2/native_bt_trace_class.i
src/bindings/python/bt2/bt2/trace.py
src/bindings/python/bt2/bt2/trace_class.py
This page took 0.024473 seconds and 4 git commands to generate.