2 * python-plugin-provider.c
4 * Babeltrace Python plugin provider
6 * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 #define BT_LOG_TAG "LIB/PLUGIN-PY"
28 #include "lib/logging.h"
30 #include "python-plugin-provider.h"
32 #include "common/macros.h"
33 #include "compat/compiler.h"
34 #include <babeltrace2/plugin/plugin-const.h>
35 #include "lib/plugin/plugin.h"
36 #include <babeltrace2/graph/component-class.h>
37 #include <babeltrace2/current-thread.h>
38 #include "lib/graph/component-class.h"
39 #include "py-common/py-common.h"
47 #define PYTHON_PLUGIN_FILE_PREFIX "bt_plugin_"
48 #define PYTHON_PLUGIN_FILE_PREFIX_LEN (sizeof(PYTHON_PLUGIN_FILE_PREFIX) - 1)
49 #define PYTHON_PLUGIN_FILE_EXT ".py"
50 #define PYTHON_PLUGIN_FILE_EXT_LEN (sizeof(PYTHON_PLUGIN_FILE_EXT) - 1)
52 static enum python_state
{
53 /* init_python() not called yet */
54 PYTHON_STATE_NOT_INITED
,
56 /* init_python() called once with success */
57 PYTHON_STATE_FULLY_INITIALIZED
,
59 /* init_python() called once without success */
60 PYTHON_STATE_CANNOT_INITIALIZE
,
63 * init_python() called, but environment variable asks the
64 * Python interpreter not to be loaded.
66 PYTHON_STATE_WONT_INITIALIZE
,
67 } python_state
= PYTHON_STATE_NOT_INITED
;
69 static PyObject
*py_try_load_plugin_module_func
= NULL
;
70 static bool python_was_initialized_by_us
;
73 void append_python_traceback_error_cause(void)
77 if (Py_IsInitialized() && PyErr_Occurred()) {
78 exc
= bt_py_common_format_current_exception(BT_LOG_OUTPUT_LEVEL
);
80 BT_LOGE_STR("Failed to format Python exception.");
84 (void) BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN(
85 BT_LIB_LOG_LIBBABELTRACE2_NAME
, "%s", exc
->str
);
90 g_string_free(exc
, TRUE
);
95 void log_python_traceback(int log_level
)
99 if (Py_IsInitialized() && PyErr_Occurred()) {
100 exc
= bt_py_common_format_current_exception(BT_LOG_OUTPUT_LEVEL
);
102 BT_LOGE_STR("Failed to format Python exception.");
106 BT_LOG_WRITE(log_level
, BT_LOG_TAG
,
107 "Exception occured: Python traceback:\n%s", exc
->str
);
112 g_string_free(exc
, TRUE
);
117 void pyerr_clear(void)
119 if (Py_IsInitialized()) {
125 int init_python(void)
127 int ret
= BT_FUNC_STATUS_OK
;
128 PyObject
*py_bt2_py_plugin_mod
= NULL
;
129 const char *dis_python_env
;
131 sig_t old_sigint
= signal(SIGINT
, SIG_DFL
);
134 switch (python_state
) {
135 case PYTHON_STATE_NOT_INITED
:
137 case PYTHON_STATE_FULLY_INITIALIZED
:
139 case PYTHON_STATE_WONT_INITIALIZE
:
140 ret
= BT_FUNC_STATUS_NOT_FOUND
;
142 case PYTHON_STATE_CANNOT_INITIALIZE
:
143 ret
= BT_FUNC_STATUS_ERROR
;
150 * User can disable Python plugin support with the
151 * `LIBBABELTRACE2_DISABLE_PYTHON_PLUGINS` environment variable
154 dis_python_env
= getenv("LIBBABELTRACE2_DISABLE_PYTHON_PLUGINS");
155 if (dis_python_env
&& strcmp(dis_python_env
, "1") == 0) {
156 BT_LOGI_STR("Python plugin support is disabled because the "
157 "`LIBBABELTRACE2_DISABLE_PYTHON_PLUGINS` environment "
158 "variable is set to `1`.");
159 python_state
= PYTHON_STATE_WONT_INITIALIZE
;
160 ret
= BT_FUNC_STATUS_NOT_FOUND
;
164 if (!Py_IsInitialized()) {
165 BT_LOGI_STR("Python interpreter is not initialized: initializing Python interpreter.");
167 python_was_initialized_by_us
= true;
168 BT_LOGI("Initialized Python interpreter: version=\"%s\"",
171 BT_LOGI("Python interpreter is already initialized: version=\"%s\"",
175 py_bt2_py_plugin_mod
= PyImport_ImportModule("bt2.py_plugin");
176 if (!py_bt2_py_plugin_mod
) {
177 append_python_traceback_error_cause();
178 BT_LIB_LOGW_APPEND_CAUSE(
179 "Cannot import `bt2.py_plugin` Python module: "
180 "Python plugin support is disabled.");
181 python_state
= PYTHON_STATE_CANNOT_INITIALIZE
;
182 ret
= BT_FUNC_STATUS_ERROR
;
186 py_try_load_plugin_module_func
=
187 PyObject_GetAttrString(py_bt2_py_plugin_mod
, "_try_load_plugin_module");
188 if (!py_try_load_plugin_module_func
) {
189 append_python_traceback_error_cause();
190 BT_LIB_LOGW_APPEND_CAUSE(
191 "Cannot get `_try_load_plugin_module` attribute from `bt2.py_plugin` Python module: "
192 "Python plugin support is disabled.");
193 python_state
= PYTHON_STATE_CANNOT_INITIALIZE
;
194 ret
= BT_FUNC_STATUS_ERROR
;
198 python_state
= PYTHON_STATE_FULLY_INITIALIZED
;
202 if (old_sigint
!= SIG_ERR
) {
203 (void) signal(SIGINT
, old_sigint
);
207 log_python_traceback(ret
== BT_FUNC_STATUS_ERROR
?
208 BT_LOG_WARNING
: BT_LOG_INFO
);
210 Py_XDECREF(py_bt2_py_plugin_mod
);
214 __attribute__((destructor
)) static
215 void fini_python(void) {
216 if (Py_IsInitialized() && python_was_initialized_by_us
) {
217 if (py_try_load_plugin_module_func
) {
218 Py_DECREF(py_try_load_plugin_module_func
);
219 py_try_load_plugin_module_func
= NULL
;
223 BT_LOGI_STR("Finalized Python interpreter.");
226 python_state
= PYTHON_STATE_NOT_INITED
;
230 int bt_plugin_from_python_plugin_info(PyObject
*plugin_info
,
231 bool fail_on_load_error
, bt_plugin
**plugin_out
)
233 int status
= BT_FUNC_STATUS_OK
;
234 PyObject
*py_name
= NULL
;
235 PyObject
*py_author
= NULL
;
236 PyObject
*py_description
= NULL
;
237 PyObject
*py_license
= NULL
;
238 PyObject
*py_version
= NULL
;
239 PyObject
*py_comp_class_addrs
= NULL
;
240 const char *name
= NULL
;
241 const char *author
= NULL
;
242 const char *description
= NULL
;
243 const char *license
= NULL
;
244 unsigned int major
= 0, minor
= 0, patch
= 0;
245 const char *version_extra
= NULL
;
247 BT_ASSERT(plugin_out
);
249 BT_ASSERT(plugin_info
);
250 BT_ASSERT(python_state
== PYTHON_STATE_FULLY_INITIALIZED
);
251 py_name
= PyObject_GetAttrString(plugin_info
, "name");
253 if (fail_on_load_error
) {
254 append_python_traceback_error_cause();
255 BT_LIB_LOGW_APPEND_CAUSE(
256 "Cannot find `name` attribute in Python plugin info object: "
257 "py-plugin-info-addr=%p", plugin_info
);
258 status
= BT_FUNC_STATUS_ERROR
;
261 "Cannot find `name` attribute in Python plugin info object: "
262 "py-plugin-info-addr=%p", plugin_info
);
263 status
= BT_FUNC_STATUS_NOT_FOUND
;
269 py_author
= PyObject_GetAttrString(plugin_info
, "author");
271 if (fail_on_load_error
) {
272 append_python_traceback_error_cause();
273 BT_LIB_LOGW_APPEND_CAUSE(
274 "Cannot find `author` attribute in Python plugin info object: "
275 "py-plugin-info-addr=%p", plugin_info
);
276 status
= BT_FUNC_STATUS_ERROR
;
279 "Cannot find `author` attribute in Python plugin info object: "
280 "py-plugin-info-addr=%p", plugin_info
);
281 status
= BT_FUNC_STATUS_NOT_FOUND
;
287 py_description
= PyObject_GetAttrString(plugin_info
, "description");
288 if (!py_description
) {
289 if (fail_on_load_error
) {
290 append_python_traceback_error_cause();
291 BT_LIB_LOGW_APPEND_CAUSE(
292 "Cannot find `description` attribute in Python plugin info object: "
293 "py-plugin-info-addr=%p", plugin_info
);
294 status
= BT_FUNC_STATUS_ERROR
;
297 "Cannot find `description` attribute in Python plugin info object: "
298 "py-plugin-info-addr=%p", plugin_info
);
299 status
= BT_FUNC_STATUS_NOT_FOUND
;
305 py_license
= PyObject_GetAttrString(plugin_info
, "license");
307 if (fail_on_load_error
) {
308 append_python_traceback_error_cause();
309 BT_LIB_LOGW_APPEND_CAUSE(
310 "Cannot find `license` attribute in Python plugin info object: "
311 "py-plugin-info-addr=%p", plugin_info
);
312 status
= BT_FUNC_STATUS_ERROR
;
315 "Cannot find `license` attribute in Python plugin info object: "
316 "py-plugin-info-addr=%p", plugin_info
);
317 status
= BT_FUNC_STATUS_NOT_FOUND
;
323 py_version
= PyObject_GetAttrString(plugin_info
, "version");
325 if (fail_on_load_error
) {
326 append_python_traceback_error_cause();
327 BT_LIB_LOGW_APPEND_CAUSE(
328 "Cannot find `version` attribute in Python plugin info object: "
329 "py-plugin-info-addr=%p", plugin_info
);
330 status
= BT_FUNC_STATUS_ERROR
;
333 "Cannot find `version` attribute in Python plugin info object: "
334 "py-plugin-info-addr=%p", plugin_info
);
335 status
= BT_FUNC_STATUS_NOT_FOUND
;
341 py_comp_class_addrs
= PyObject_GetAttrString(plugin_info
,
343 if (!py_comp_class_addrs
) {
344 if (fail_on_load_error
) {
345 append_python_traceback_error_cause();
346 BT_LIB_LOGW_APPEND_CAUSE(
347 "Cannot find `comp_class_addrs` attribute in Python plugin info object: "
348 "py-plugin-info-addr=%p", plugin_info
);
349 status
= BT_FUNC_STATUS_ERROR
;
352 "Cannot find `comp_class_addrs` attribute in Python plugin info object: "
353 "py-plugin-info-addr=%p", plugin_info
);
354 status
= BT_FUNC_STATUS_NOT_FOUND
;
360 if (PyUnicode_Check(py_name
)) {
361 name
= PyUnicode_AsUTF8(py_name
);
363 if (fail_on_load_error
) {
364 append_python_traceback_error_cause();
365 BT_LIB_LOGW_APPEND_CAUSE(
366 "Cannot decode Python plugin name string: "
367 "py-plugin-info-addr=%p", plugin_info
);
368 status
= BT_FUNC_STATUS_ERROR
;
371 "Cannot decode Python plugin name string: "
372 "py-plugin-info-addr=%p", plugin_info
);
373 status
= BT_FUNC_STATUS_NOT_FOUND
;
379 /* Plugin name is mandatory */
380 if (fail_on_load_error
) {
381 append_python_traceback_error_cause();
382 BT_LIB_LOGW_APPEND_CAUSE(
383 "Plugin name is not a string: "
384 "py-plugin-info-addr=%p", plugin_info
);
385 status
= BT_FUNC_STATUS_ERROR
;
388 "Plugin name is not a string: "
389 "py-plugin-info-addr=%p", plugin_info
);
390 status
= BT_FUNC_STATUS_NOT_FOUND
;
396 if (PyUnicode_Check(py_author
)) {
397 author
= PyUnicode_AsUTF8(py_author
);
399 if (fail_on_load_error
) {
400 append_python_traceback_error_cause();
401 BT_LIB_LOGW_APPEND_CAUSE(
402 "Cannot decode Python plugin author string: "
403 "py-plugin-info-addr=%p", plugin_info
);
404 status
= BT_FUNC_STATUS_ERROR
;
407 "Cannot decode Python plugin author string: "
408 "py-plugin-info-addr=%p", plugin_info
);
409 status
= BT_FUNC_STATUS_NOT_FOUND
;
416 if (PyUnicode_Check(py_description
)) {
417 description
= PyUnicode_AsUTF8(py_description
);
419 if (fail_on_load_error
) {
420 append_python_traceback_error_cause();
421 BT_LIB_LOGW_APPEND_CAUSE(
422 "Cannot decode Python plugin description string: "
423 "py-plugin-info-addr=%p", plugin_info
);
424 status
= BT_FUNC_STATUS_ERROR
;
427 "Cannot decode Python plugin description string: "
428 "py-plugin-info-addr=%p", plugin_info
);
429 status
= BT_FUNC_STATUS_NOT_FOUND
;
436 if (PyUnicode_Check(py_license
)) {
437 license
= PyUnicode_AsUTF8(py_license
);
439 if (fail_on_load_error
) {
440 append_python_traceback_error_cause();
441 BT_LIB_LOGW_APPEND_CAUSE(
442 "Cannot decode Python plugin license string: "
443 "py-plugin-info-addr=%p", plugin_info
);
444 status
= BT_FUNC_STATUS_ERROR
;
447 "Cannot decode Python plugin license string: "
448 "py-plugin-info-addr=%p", plugin_info
);
449 status
= BT_FUNC_STATUS_NOT_FOUND
;
456 if (PyTuple_Check(py_version
)) {
457 if (PyTuple_Size(py_version
) >= 3) {
458 PyObject
*py_major
= PyTuple_GetItem(py_version
, 0);
459 PyObject
*py_minor
= PyTuple_GetItem(py_version
, 1);
460 PyObject
*py_patch
= PyTuple_GetItem(py_version
, 2);
466 if (PyLong_Check(py_major
)) {
467 major
= PyLong_AsUnsignedLong(py_major
);
470 if (PyLong_Check(py_minor
)) {
471 minor
= PyLong_AsUnsignedLong(py_minor
);
474 if (PyLong_Check(py_patch
)) {
475 patch
= PyLong_AsUnsignedLong(py_patch
);
478 if (PyErr_Occurred()) {
479 /* Overflow error, most probably */
480 if (fail_on_load_error
) {
481 append_python_traceback_error_cause();
482 BT_LIB_LOGW_APPEND_CAUSE(
483 "Invalid Python plugin version format: "
484 "py-plugin-info-addr=%p", plugin_info
);
485 status
= BT_FUNC_STATUS_ERROR
;
488 "Invalid Python plugin version format: "
489 "py-plugin-info-addr=%p", plugin_info
);
490 status
= BT_FUNC_STATUS_NOT_FOUND
;
497 if (PyTuple_Size(py_version
) >= 4) {
498 PyObject
*py_extra
= PyTuple_GetItem(py_version
, 3);
502 if (PyUnicode_Check(py_extra
)) {
503 version_extra
= PyUnicode_AsUTF8(py_extra
);
504 if (!version_extra
) {
505 if (fail_on_load_error
) {
506 append_python_traceback_error_cause();
507 BT_LIB_LOGW_APPEND_CAUSE(
508 "Cannot decode Python plugin version's extra string: "
509 "py-plugin-info-addr=%p", plugin_info
);
510 status
= BT_FUNC_STATUS_ERROR
;
513 "Cannot decode Python plugin version's extra string: "
514 "py-plugin-info-addr=%p", plugin_info
);
515 status
= BT_FUNC_STATUS_NOT_FOUND
;
524 *plugin_out
= bt_plugin_create_empty(BT_PLUGIN_TYPE_PYTHON
);
526 BT_LIB_LOGE_APPEND_CAUSE("Cannot create empty plugin object.");
527 status
= BT_FUNC_STATUS_MEMORY_ERROR
;
531 bt_plugin_set_name(*plugin_out
, name
);
534 bt_plugin_set_description(*plugin_out
, description
);
538 bt_plugin_set_author(*plugin_out
, author
);
542 bt_plugin_set_license(*plugin_out
, license
);
545 bt_plugin_set_version(*plugin_out
, major
, minor
, patch
, version_extra
);
547 if (PyList_Check(py_comp_class_addrs
)) {
550 for (i
= 0; i
< PyList_Size(py_comp_class_addrs
); i
++) {
551 bt_component_class
*comp_class
;
552 PyObject
*py_comp_class_addr
;
555 PyList_GetItem(py_comp_class_addrs
, i
);
556 BT_ASSERT(py_comp_class_addr
);
557 if (PyLong_Check(py_comp_class_addr
)) {
558 comp_class
= PyLong_AsVoidPtr(py_comp_class_addr
);
560 if (fail_on_load_error
) {
561 append_python_traceback_error_cause();
562 BT_LIB_LOGW_APPEND_CAUSE(
563 "Component class address is not an integer in Python plugin info object: "
564 "py-plugin-info-addr=%p, index=%zu",
566 status
= BT_FUNC_STATUS_ERROR
;
569 "Component class address is not an integer in Python plugin info object: "
570 "py-plugin-info-addr=%p, index=%zu",
572 status
= BT_FUNC_STATUS_NOT_FOUND
;
578 status
= bt_plugin_add_component_class(*plugin_out
,
581 BT_LIB_LOGE_APPEND_CAUSE(
582 "Cannot add component class to plugin: "
583 "py-plugin-info-addr=%p, "
584 "plugin-addr=%p, plugin-name=\"%s\", "
585 "comp-class-addr=%p, "
586 "comp-class-name=\"%s\", "
587 "comp-class-type=%s",
588 plugin_info
, *plugin_out
,
589 bt_plugin_get_name(*plugin_out
),
591 bt_component_class_get_name(comp_class
),
592 bt_component_class_type_string(
593 bt_component_class_get_type(comp_class
)));
602 BT_ASSERT(status
!= BT_FUNC_STATUS_OK
);
603 log_python_traceback(fail_on_load_error
? BT_LOG_WARNING
: BT_LOG_INFO
);
605 BT_OBJECT_PUT_REF_AND_RESET(*plugin_out
);
609 Py_XDECREF(py_author
);
610 Py_XDECREF(py_description
);
611 Py_XDECREF(py_license
);
612 Py_XDECREF(py_version
);
613 Py_XDECREF(py_comp_class_addrs
);
618 int bt_plugin_python_create_all_from_file(const char *path
,
619 bool fail_on_load_error
, struct bt_plugin_set
**plugin_set_out
)
621 bt_plugin
*plugin
= NULL
;
622 PyObject
*py_plugin_info
= NULL
;
623 gchar
*basename
= NULL
;
625 int status
= BT_FUNC_STATUS_OK
;
629 if (python_state
== PYTHON_STATE_CANNOT_INITIALIZE
) {
631 * We do not even care about the rest of the function
632 * here because we already know Python cannot be fully
635 BT_LIB_LOGE_APPEND_CAUSE(
636 "Python interpreter could not be initialized previously.");
637 status
= BT_FUNC_STATUS_ERROR
;
639 } else if (python_state
== PYTHON_STATE_WONT_INITIALIZE
) {
641 * This is not an error: the environment requires that
642 * Python plugins are disabled, so it's simply not
645 BT_LOGI_STR("Python plugin support was disabled previously "
646 "because the `LIBBABELTRACE2_DISABLE_PYTHON_PLUGINS` "
647 "environment variable is set to `1`.");
648 status
= BT_FUNC_STATUS_NOT_FOUND
;
652 BT_LOGI("Trying to create all Python plugins from file: path=\"%s\"",
654 path_len
= strlen(path
);
656 /* File name ends with `.py` */
657 if (strncmp(path
+ path_len
- PYTHON_PLUGIN_FILE_EXT_LEN
,
658 PYTHON_PLUGIN_FILE_EXT
,
659 PYTHON_PLUGIN_FILE_EXT_LEN
) != 0) {
660 BT_LOGI("Skipping non-Python file: path=\"%s\"", path
);
661 status
= BT_FUNC_STATUS_NOT_FOUND
;
665 /* File name starts with `bt_plugin_` */
666 basename
= g_path_get_basename(path
);
668 BT_LIB_LOGE_APPEND_CAUSE(
669 "Cannot get path's basename: path=\"%s\"", path
);
670 status
= BT_FUNC_STATUS_ERROR
;
674 if (strncmp(basename
, PYTHON_PLUGIN_FILE_PREFIX
,
675 PYTHON_PLUGIN_FILE_PREFIX_LEN
) != 0) {
676 BT_LOGI("Skipping Python file not starting with `%s`: "
677 "path=\"%s\"", PYTHON_PLUGIN_FILE_PREFIX
, path
);
678 status
= BT_FUNC_STATUS_NOT_FOUND
;
683 * Initialize Python now.
685 * This is not done in the library contructor because the
686 * interpreter is somewhat slow to initialize. If you don't
687 * have any potential Python plugins, you don't need to endure
688 * this waiting time everytime you load the library.
690 status
= init_python();
691 if (status
!= BT_FUNC_STATUS_OK
) {
692 /* init_python() logs and append errors */
697 * Call bt2.py_plugin._try_load_plugin_module() with this path
698 * to get plugin info if the plugin is loadable and complete.
699 * This function returns None when there's an error, but just in
700 * case we also manually clear the last Python error state.
702 BT_LOGD_STR("Getting Python plugin info object from Python module.");
703 py_plugin_info
= PyObject_CallFunction(py_try_load_plugin_module_func
,
705 if (!py_plugin_info
|| py_plugin_info
== Py_None
) {
706 if (fail_on_load_error
) {
707 append_python_traceback_error_cause();
708 BT_LIB_LOGW_APPEND_CAUSE(
709 "Cannot load Python plugin: path=\"%s\"", path
);
710 status
= BT_FUNC_STATUS_ERROR
;
713 "Cannot load Python plugin: path=\"%s\"", path
);
714 status
= BT_FUNC_STATUS_NOT_FOUND
;
721 * Get bt_plugin from plugin info object.
724 status
= bt_plugin_from_python_plugin_info(py_plugin_info
,
725 fail_on_load_error
, &plugin
);
728 * bt_plugin_from_python_plugin_info() handles
729 * `fail_on_load_error`, so this is a "real" error.
731 BT_LIB_LOGW_APPEND_CAUSE(
732 "Cannot create plugin object from Python plugin info object: "
733 "path=\"%s\", py-plugin-info-addr=%p",
734 path
, py_plugin_info
);
737 } else if (status
== BT_FUNC_STATUS_NOT_FOUND
) {
742 BT_ASSERT(status
== BT_FUNC_STATUS_OK
);
744 bt_plugin_set_path(plugin
, path
);
745 *plugin_set_out
= bt_plugin_set_create();
746 if (!*plugin_set_out
) {
747 BT_LIB_LOGE_APPEND_CAUSE("Cannot create empty plugin set.");
748 status
= BT_FUNC_STATUS_MEMORY_ERROR
;
752 bt_plugin_set_add_plugin(*plugin_set_out
, plugin
);
753 BT_LOGD("Created all Python plugins from file: path=\"%s\", "
754 "plugin-addr=%p, plugin-name=\"%s\"",
755 path
, plugin
, bt_plugin_get_name(plugin
));
759 BT_ASSERT(status
!= BT_FUNC_STATUS_OK
);
760 log_python_traceback(BT_LOG_WARNING
);
762 BT_OBJECT_PUT_REF_AND_RESET(*plugin_set_out
);
765 bt_plugin_put_ref(plugin
);
766 Py_XDECREF(py_plugin_info
);