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)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Aug 2019 18:05:19 +0000 (14:05 -0400)
commit48e95b3d0a409b028cd2a7cb779e0a6ea5cb8004
tree5c3119ac2cabcec0757cb52d028bb4d33564065c
parent100b6d915cca62ba73f3c86e9c7b5d5f84f4d370
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.026772 seconds and 4 git commands to generate.