lib: strictly type function return status enumerations
[babeltrace.git] / src / python-plugin-provider / python-plugin-provider.c
1 /*
2 * python-plugin-provider.c
3 *
4 * Babeltrace Python plugin provider
5 *
6 * Copyright 2017 Philippe Proulx <pproulx@efficios.com>
7 *
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:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
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
24 * SOFTWARE.
25 */
26
27 #define BT_LOG_TAG "LIB/PLUGIN-PY"
28
29 #include "lib/logging.h"
30 #include "common/macros.h"
31 #include "compat/compiler.h"
32 #include <babeltrace2/plugin/plugin-const.h>
33 #include "lib/plugin/plugin.h"
34 #include <babeltrace2/graph/component-class.h>
35 #include "lib/graph/component-class.h"
36 #include <stdlib.h>
37 #include <signal.h>
38 #include <Python.h>
39 #include <glib.h>
40 #include <gmodule.h>
41
42 #define PYTHON_PLUGIN_FILE_PREFIX "bt_plugin_"
43 #define PYTHON_PLUGIN_FILE_PREFIX_LEN (sizeof(PYTHON_PLUGIN_FILE_PREFIX) - 1)
44 #define PYTHON_PLUGIN_FILE_EXT ".py"
45 #define PYTHON_PLUGIN_FILE_EXT_LEN (sizeof(PYTHON_PLUGIN_FILE_EXT) - 1)
46
47 enum python_state {
48 /* init_python() not called yet */
49 PYTHON_STATE_NOT_INITED,
50
51 /* init_python() called once with success */
52 PYTHON_STATE_FULLY_INITIALIZED,
53
54 /* init_python() called once without success */
55 PYTHON_STATE_CANNOT_INITIALIZE,
56
57 /*
58 * init_python() called, but environment variable asks the
59 * Python interpreter not to be loaded.
60 */
61 PYTHON_STATE_WONT_INITIALIZE,
62 } python_state = PYTHON_STATE_NOT_INITED;
63
64 static PyObject *py_try_load_plugin_module_func = NULL;
65 static bool python_was_initialized_by_us;
66
67 static
68 void print_python_traceback(int log_level)
69 {
70 if (BT_LOG_ON(log_level) && Py_IsInitialized() && PyErr_Occurred()) {
71 BT_LOG_WRITE(log_level, BT_LOG_TAG,
72 "Exception occured: Python traceback: ");
73 PyErr_Print();
74 }
75 }
76
77 static
78 void pyerr_clear(void)
79 {
80 if (Py_IsInitialized()) {
81 PyErr_Clear();
82 }
83 }
84
85 static
86 void init_python(void)
87 {
88 PyObject *py_bt2_py_plugin_mod = NULL;
89 const char *dis_python_env;
90 #ifndef __MINGW32__
91 sig_t old_sigint = signal(SIGINT, SIG_DFL);
92 #endif
93
94 if (python_state != PYTHON_STATE_NOT_INITED) {
95 goto end;
96 }
97
98 /*
99 * User can disable Python plugin support with the
100 * BABELTRACE_DISABLE_PYTHON_PLUGINS environment variable set to
101 * 1.
102 */
103 dis_python_env = getenv("BABELTRACE_DISABLE_PYTHON_PLUGINS");
104 if (dis_python_env && strcmp(dis_python_env, "1") == 0) {
105 BT_LOGI_STR("Python plugin support is disabled because `BABELTRACE_DISABLE_PYTHON_PLUGINS=1`.");
106 python_state = PYTHON_STATE_WONT_INITIALIZE;
107 goto end;
108 }
109
110 if (!Py_IsInitialized()) {
111 BT_LOGI_STR("Python interpreter is not initialized: initializing Python interpreter.");
112 Py_InitializeEx(0);
113 python_was_initialized_by_us = true;
114 BT_LOGI("Initialized Python interpreter: version=\"%s\"",
115 Py_GetVersion());
116 } else {
117 BT_LOGI("Python interpreter is already initialized: version=\"%s\"",
118 Py_GetVersion());
119 }
120
121 py_bt2_py_plugin_mod = PyImport_ImportModule("bt2.py_plugin");
122 if (!py_bt2_py_plugin_mod) {
123 BT_LOGW_STR("Cannot import bt2.py_plugin Python module: Python plugin support is disabled.");
124 python_state = PYTHON_STATE_CANNOT_INITIALIZE;
125 goto end;
126 }
127
128 py_try_load_plugin_module_func =
129 PyObject_GetAttrString(py_bt2_py_plugin_mod, "_try_load_plugin_module");
130 if (!py_try_load_plugin_module_func) {
131 BT_LOGW_STR("Cannot get _try_load_plugin_module attribute from bt2.py_plugin Python module: Python plugin support is disabled.");
132 python_state = PYTHON_STATE_CANNOT_INITIALIZE;
133 goto end;
134 }
135
136 python_state = PYTHON_STATE_FULLY_INITIALIZED;
137
138 end:
139 #ifndef __MINGW32__
140 if (old_sigint != SIG_ERR) {
141 (void) signal(SIGINT, old_sigint);
142 }
143 #endif
144
145 print_python_traceback(BT_LOG_WARN);
146 pyerr_clear();
147 Py_XDECREF(py_bt2_py_plugin_mod);
148 return;
149 }
150
151 __attribute__((destructor)) static
152 void fini_python(void) {
153 if (Py_IsInitialized() && python_was_initialized_by_us) {
154 if (py_try_load_plugin_module_func) {
155 Py_DECREF(py_try_load_plugin_module_func);
156 py_try_load_plugin_module_func = NULL;
157 }
158
159 Py_Finalize();
160 BT_LOGI_STR("Finalized Python interpreter.");
161 }
162
163 python_state = PYTHON_STATE_NOT_INITED;
164 }
165
166 static
167 int bt_plugin_from_python_plugin_info(PyObject *plugin_info,
168 bool fail_on_load_error, bt_plugin **plugin_out)
169 {
170 int status = __BT_FUNC_STATUS_OK;
171 PyObject *py_name = NULL;
172 PyObject *py_author = NULL;
173 PyObject *py_description = NULL;
174 PyObject *py_license = NULL;
175 PyObject *py_version = NULL;
176 PyObject *py_comp_class_addrs = NULL;
177 const char *name = NULL;
178 const char *author = NULL;
179 const char *description = NULL;
180 const char *license = NULL;
181 unsigned int major = 0, minor = 0, patch = 0;
182 const char *version_extra = NULL;
183
184 BT_ASSERT(plugin_out);
185 *plugin_out = NULL;
186 BT_ASSERT(plugin_info);
187 BT_ASSERT(python_state == PYTHON_STATE_FULLY_INITIALIZED);
188 py_name = PyObject_GetAttrString(plugin_info, "name");
189 if (!py_name) {
190 BT_LOG_WRITE(fail_on_load_error ?
191 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
192 "Cannot find `name` attribute in Python plugin info object: "
193 "py-plugin-info-addr=%p", plugin_info);
194 status = fail_on_load_error ? __BT_FUNC_STATUS_LOADING_ERROR :
195 __BT_FUNC_STATUS_NOT_FOUND;
196 goto error;
197 }
198
199 py_author = PyObject_GetAttrString(plugin_info, "author");
200 if (!py_author) {
201 BT_LOG_WRITE(fail_on_load_error ?
202 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
203 "Cannot find `author` attribute in Python plugin info object: "
204 "py-plugin-info-addr=%p", plugin_info);
205 status = fail_on_load_error ? __BT_FUNC_STATUS_LOADING_ERROR :
206 __BT_FUNC_STATUS_NOT_FOUND;
207 goto error;
208 }
209
210 py_description = PyObject_GetAttrString(plugin_info, "description");
211 if (!py_description) {
212 BT_LOG_WRITE(fail_on_load_error ?
213 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
214 "Cannot find `desciption` attribute in Python plugin info object: "
215 "py-plugin-info-addr=%p", plugin_info);
216 status = fail_on_load_error ? __BT_FUNC_STATUS_LOADING_ERROR :
217 __BT_FUNC_STATUS_NOT_FOUND;
218 goto error;
219 }
220
221 py_license = PyObject_GetAttrString(plugin_info, "license");
222 if (!py_license) {
223 BT_LOG_WRITE(fail_on_load_error ?
224 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
225 "Cannot find `license` attribute in Python plugin info object: "
226 "py-plugin-info-addr=%p", plugin_info);
227 status = fail_on_load_error ? __BT_FUNC_STATUS_LOADING_ERROR :
228 __BT_FUNC_STATUS_NOT_FOUND;
229 goto error;
230 }
231
232 py_version = PyObject_GetAttrString(plugin_info, "version");
233 if (!py_version) {
234 BT_LOG_WRITE(fail_on_load_error ?
235 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
236 "Cannot find `version` attribute in Python plugin info object: "
237 "py-plugin-info-addr=%p", plugin_info);
238 status = fail_on_load_error ? __BT_FUNC_STATUS_LOADING_ERROR :
239 __BT_FUNC_STATUS_NOT_FOUND;
240 goto error;
241 }
242
243 py_comp_class_addrs = PyObject_GetAttrString(plugin_info,
244 "comp_class_addrs");
245 if (!py_comp_class_addrs) {
246 BT_LOG_WRITE(fail_on_load_error ?
247 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
248 "Cannot find `comp_class_addrs` attribute in Python plugin info object: "
249 "py-plugin-info-addr=%p", plugin_info);
250 status = fail_on_load_error ? __BT_FUNC_STATUS_LOADING_ERROR :
251 __BT_FUNC_STATUS_NOT_FOUND;
252 goto error;
253 }
254
255 if (PyUnicode_Check(py_name)) {
256 name = PyUnicode_AsUTF8(py_name);
257 if (!name) {
258 BT_LOG_WRITE(fail_on_load_error ?
259 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
260 "Cannot decode Python plugin name string: "
261 "py-plugin-info-addr=%p", plugin_info);
262 status = fail_on_load_error ?
263 __BT_FUNC_STATUS_LOADING_ERROR :
264 __BT_FUNC_STATUS_NOT_FOUND;
265 goto error;
266 }
267 } else {
268 /* Plugin name is mandatory */
269 BT_LOG_WRITE(fail_on_load_error ?
270 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
271 "Plugin name is not a string: "
272 "py-plugin-info-addr=%p", plugin_info);
273 status = fail_on_load_error ? __BT_FUNC_STATUS_LOADING_ERROR :
274 __BT_FUNC_STATUS_NOT_FOUND;
275 goto error;
276 }
277
278 if (PyUnicode_Check(py_author)) {
279 author = PyUnicode_AsUTF8(py_author);
280 if (!author) {
281 BT_LOG_WRITE(fail_on_load_error ?
282 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
283 "Cannot decode Python plugin author string: "
284 "py-plugin-info-addr=%p", plugin_info);
285 status = fail_on_load_error ?
286 __BT_FUNC_STATUS_LOADING_ERROR :
287 __BT_FUNC_STATUS_NOT_FOUND;
288 goto error;
289 }
290 }
291
292 if (PyUnicode_Check(py_description)) {
293 description = PyUnicode_AsUTF8(py_description);
294 if (!description) {
295 BT_LOG_WRITE(fail_on_load_error ?
296 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
297 "Cannot decode Python plugin description string: "
298 "py-plugin-info-addr=%p", plugin_info);
299 status = fail_on_load_error ?
300 __BT_FUNC_STATUS_LOADING_ERROR :
301 __BT_FUNC_STATUS_NOT_FOUND;
302 goto error;
303 }
304 }
305
306 if (PyUnicode_Check(py_license)) {
307 license = PyUnicode_AsUTF8(py_license);
308 if (!license) {
309 BT_LOG_WRITE(fail_on_load_error ?
310 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
311 "Cannot decode Python plugin license string: "
312 "py-plugin-info-addr=%p", plugin_info);
313 status = fail_on_load_error ?
314 __BT_FUNC_STATUS_LOADING_ERROR :
315 __BT_FUNC_STATUS_NOT_FOUND;
316 goto error;
317 }
318 }
319
320 if (PyTuple_Check(py_version)) {
321 if (PyTuple_Size(py_version) >= 3) {
322 PyObject *py_major = PyTuple_GetItem(py_version, 0);
323 PyObject *py_minor = PyTuple_GetItem(py_version, 1);
324 PyObject *py_patch = PyTuple_GetItem(py_version, 2);
325
326 BT_ASSERT(py_major);
327 BT_ASSERT(py_minor);
328 BT_ASSERT(py_patch);
329
330 if (PyLong_Check(py_major)) {
331 major = PyLong_AsUnsignedLong(py_major);
332 }
333
334 if (PyLong_Check(py_minor)) {
335 minor = PyLong_AsUnsignedLong(py_minor);
336 }
337
338 if (PyLong_Check(py_patch)) {
339 patch = PyLong_AsUnsignedLong(py_patch);
340 }
341
342 if (PyErr_Occurred()) {
343 /* Overflow error, most probably */
344 BT_LOG_WRITE(fail_on_load_error ?
345 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
346 "Invalid Python plugin version format: "
347 "py-plugin-info-addr=%p", plugin_info);
348 status = fail_on_load_error ?
349 __BT_FUNC_STATUS_LOADING_ERROR :
350 __BT_FUNC_STATUS_NOT_FOUND;
351 goto error;
352 }
353 }
354
355 if (PyTuple_Size(py_version) >= 4) {
356 PyObject *py_extra = PyTuple_GetItem(py_version, 3);
357
358 BT_ASSERT(py_extra);
359
360 if (PyUnicode_Check(py_extra)) {
361 version_extra = PyUnicode_AsUTF8(py_extra);
362 if (!version_extra) {
363 BT_LOG_WRITE(fail_on_load_error ?
364 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
365 "Cannot decode Python plugin version's extra string: "
366 "py-plugin-info-addr=%p", plugin_info);
367 status = fail_on_load_error ?
368 __BT_FUNC_STATUS_LOADING_ERROR :
369 __BT_FUNC_STATUS_NOT_FOUND;
370 goto error;
371 }
372 }
373 }
374 }
375
376 *plugin_out = bt_plugin_create_empty(BT_PLUGIN_TYPE_PYTHON);
377 if (!*plugin_out) {
378 BT_LOGE_STR("Cannot create empty plugin object.");
379 status = __BT_FUNC_STATUS_MEMORY_ERROR;
380 goto error;
381 }
382
383 bt_plugin_set_name(*plugin_out, name);
384
385 if (description) {
386 bt_plugin_set_description(*plugin_out, description);
387 }
388
389 if (author) {
390 bt_plugin_set_author(*plugin_out, author);
391 }
392
393 if (license) {
394 bt_plugin_set_license(*plugin_out, license);
395 }
396
397 bt_plugin_set_version(*plugin_out, major, minor, patch, version_extra);
398
399 if (PyList_Check(py_comp_class_addrs)) {
400 size_t i;
401
402 for (i = 0; i < PyList_Size(py_comp_class_addrs); i++) {
403 bt_component_class *comp_class;
404 PyObject *py_comp_class_addr;
405
406 py_comp_class_addr =
407 PyList_GetItem(py_comp_class_addrs, i);
408 BT_ASSERT(py_comp_class_addr);
409 if (PyLong_Check(py_comp_class_addr)) {
410 comp_class = PyLong_AsVoidPtr(py_comp_class_addr);
411 } else {
412 BT_LOG_WRITE(fail_on_load_error ?
413 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
414 "Component class address is not an integer in Python plugin info object: "
415 "py-plugin-info-addr=%p, index=%zu",
416 plugin_info, i);
417
418 if (fail_on_load_error) {
419 status = __BT_FUNC_STATUS_LOADING_ERROR;
420 goto error;
421 }
422
423 continue;
424 }
425
426 status = bt_plugin_add_component_class(*plugin_out,
427 comp_class);
428 if (status < 0) {
429 BT_LOGE("Cannot add component class to plugin: "
430 "py-plugin-info-addr=%p, "
431 "plugin-addr=%p, plugin-name=\"%s\", "
432 "comp-class-addr=%p, "
433 "comp-class-name=\"%s\", "
434 "comp-class-type=%s",
435 plugin_info, *plugin_out,
436 bt_plugin_get_name(*plugin_out),
437 comp_class,
438 bt_component_class_get_name(comp_class),
439 bt_component_class_type_string(
440 bt_component_class_get_type(comp_class)));
441 goto error;
442 }
443 }
444 }
445
446 goto end;
447
448 error:
449 BT_ASSERT(status != __BT_FUNC_STATUS_OK);
450 print_python_traceback(fail_on_load_error ? BT_LOG_WARN : BT_LOG_INFO);
451 pyerr_clear();
452 BT_OBJECT_PUT_REF_AND_RESET(*plugin_out);
453
454 end:
455 Py_XDECREF(py_name);
456 Py_XDECREF(py_author);
457 Py_XDECREF(py_description);
458 Py_XDECREF(py_license);
459 Py_XDECREF(py_version);
460 Py_XDECREF(py_comp_class_addrs);
461 return status;
462 }
463
464 G_MODULE_EXPORT
465 int bt_plugin_python_create_all_from_file(const char *path,
466 bool fail_on_load_error, struct bt_plugin_set **plugin_set_out)
467 {
468 bt_plugin *plugin = NULL;
469 PyObject *py_plugin_info = NULL;
470 gchar *basename = NULL;
471 size_t path_len;
472 int status = __BT_FUNC_STATUS_OK;
473
474 BT_ASSERT(path);
475
476 if (python_state == PYTHON_STATE_CANNOT_INITIALIZE) {
477 /*
478 * We do not even care about the rest of the function
479 * here because we already know Python cannot be fully
480 * initialized.
481 */
482 status = __BT_FUNC_STATUS_ERROR;
483 goto error;
484 } else if (python_state == PYTHON_STATE_WONT_INITIALIZE) {
485 /*
486 * This is not an error: the environment requires that
487 * Python plugins are disabled, so it's simply not
488 * found.
489 */
490 status = __BT_FUNC_STATUS_NOT_FOUND;
491 goto error;
492 }
493
494 BT_LOGI("Trying to create all Python plugins from file: path=\"%s\"",
495 path);
496 path_len = strlen(path);
497
498 /* File name ends with `.py` */
499 if (strncmp(path + path_len - PYTHON_PLUGIN_FILE_EXT_LEN,
500 PYTHON_PLUGIN_FILE_EXT,
501 PYTHON_PLUGIN_FILE_EXT_LEN) != 0) {
502 BT_LOGI("Skipping non-Python file: path=\"%s\"", path);
503 status = __BT_FUNC_STATUS_NOT_FOUND;
504 goto error;
505 }
506
507 /* File name starts with `bt_plugin_` */
508 basename = g_path_get_basename(path);
509 if (!basename) {
510 BT_LOGE("Cannot get path's basename: path=\"%s\"", path);
511 status = __BT_FUNC_STATUS_ERROR;
512 goto error;
513 }
514
515 if (strncmp(basename, PYTHON_PLUGIN_FILE_PREFIX,
516 PYTHON_PLUGIN_FILE_PREFIX_LEN) != 0) {
517 BT_LOGI("Skipping Python file not starting with `%s`: "
518 "path=\"%s\"", PYTHON_PLUGIN_FILE_PREFIX, path);
519 status = __BT_FUNC_STATUS_NOT_FOUND;
520 goto error;
521 }
522
523 /*
524 * Initialize Python now.
525 *
526 * This is not done in the library contructor because the
527 * interpreter is somewhat slow to initialize. If you don't
528 * have any potential Python plugins, you don't need to endure
529 * this waiting time everytime you load the library.
530 */
531 init_python();
532 if (python_state == PYTHON_STATE_WONT_INITIALIZE) {
533 /*
534 * This is not an error: the environment requires that
535 * Python plugins are disabled, so it's simply not
536 * found.
537 */
538 status = __BT_FUNC_STATUS_NOT_FOUND;
539 goto error;
540 } else if (python_state != PYTHON_STATE_FULLY_INITIALIZED) {
541 /*
542 * For some reason we cannot initialize Python,
543 * import the required modules, and get the required
544 * attributes from them.
545 */
546 BT_LOGE("Failed to initialize Python interpreter.");
547 status = __BT_FUNC_STATUS_ERROR;
548 goto error;
549 }
550
551 /*
552 * Call bt2.py_plugin._try_load_plugin_module() with this path
553 * to get plugin info if the plugin is loadable and complete.
554 * This function returns None when there's an error, but just in
555 * case we also manually clear the last Python error state.
556 */
557 BT_LOGD_STR("Getting Python plugin info object from Python module.");
558 py_plugin_info = PyObject_CallFunction(py_try_load_plugin_module_func,
559 "(s)", path);
560 if (!py_plugin_info || py_plugin_info == Py_None) {
561 BT_LOG_WRITE(fail_on_load_error ?
562 BT_LOG_WARN : BT_LOG_INFO, BT_LOG_TAG,
563 "Cannot load Python plugin: path=\"%s\"", path);
564 print_python_traceback(fail_on_load_error ? BT_LOG_WARN :
565 BT_LOG_INFO);
566 PyErr_Clear();
567 status = fail_on_load_error ? __BT_FUNC_STATUS_LOADING_ERROR :
568 __BT_FUNC_STATUS_NOT_FOUND;
569 goto error;
570 }
571
572 /*
573 * Get bt_plugin from plugin info object.
574 */
575 plugin = NULL;
576 status = bt_plugin_from_python_plugin_info(py_plugin_info,
577 fail_on_load_error, &plugin);
578 if (status < 0) {
579 /*
580 * bt_plugin_from_python_plugin_info() handles
581 * `fail_on_load_error`, so this is a "real" error.
582 */
583 BT_LOGW("Cannot create plugin object from Python plugin info object: "
584 "path=\"%s\", py-plugin-info-addr=%p",
585 path, py_plugin_info);
586 BT_ASSERT(!plugin);
587 goto error;
588 } else if (status == __BT_FUNC_STATUS_NOT_FOUND) {
589 BT_ASSERT(!plugin);
590 goto error;
591 }
592
593 BT_ASSERT(status == __BT_FUNC_STATUS_OK);
594 BT_ASSERT(plugin);
595 bt_plugin_set_path(plugin, path);
596 *plugin_set_out = bt_plugin_set_create();
597 if (!*plugin_set_out) {
598 BT_LOGE_STR("Cannot create empty plugin set.");
599 status = __BT_FUNC_STATUS_MEMORY_ERROR;
600 goto error;
601 }
602
603 bt_plugin_set_add_plugin(*plugin_set_out, plugin);
604 BT_LOGD("Created all Python plugins from file: path=\"%s\", "
605 "plugin-addr=%p, plugin-name=\"%s\"",
606 path, plugin, bt_plugin_get_name(plugin));
607 goto end;
608
609 error:
610 BT_ASSERT(status != __BT_FUNC_STATUS_OK);
611 BT_OBJECT_PUT_REF_AND_RESET(*plugin_set_out);
612
613 end:
614 bt_plugin_put_ref(plugin);
615 Py_XDECREF(py_plugin_info);
616 g_free(basename);
617 return status;
618 }
This page took 0.04236 seconds and 4 git commands to generate.