X-Git-Url: https://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Fpython-plugin-provider%2Fpython-plugin-provider.c;h=e6e31099713393acfb35e864529ad581bd0a7193;hp=c6b606564ced4e564eebdda8e0e58009defb409e;hb=6375b9429f8332f3eacc2ec795aa1924c73d9cc8;hpb=c4f23e30bf67d2523163614bc9461d84cbe1ae80 diff --git a/src/python-plugin-provider/python-plugin-provider.c b/src/python-plugin-provider/python-plugin-provider.c index c6b60656..e6e31099 100644 --- a/src/python-plugin-provider/python-plugin-provider.c +++ b/src/python-plugin-provider/python-plugin-provider.c @@ -1,27 +1,9 @@ /* - * python-plugin-provider.c - * - * Babeltrace Python plugin provider + * SPDX-License-Identifier: MIT * * Copyright 2017 Philippe Proulx * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Babeltrace Python plugin provider */ #define BT_LOG_TAG "LIB/PLUGIN-PY" @@ -31,10 +13,10 @@ #include "common/macros.h" #include "compat/compiler.h" -#include +#include #include "lib/plugin/plugin.h" #include -#include +#include #include "lib/graph/component-class.h" #include "py-common/py-common.h" #include @@ -49,7 +31,7 @@ #define PYTHON_PLUGIN_FILE_EXT ".py" #define PYTHON_PLUGIN_FILE_EXT_LEN (sizeof(PYTHON_PLUGIN_FILE_EXT) - 1) -enum python_state { +static enum python_state { /* init_python() not called yet */ PYTHON_STATE_NOT_INITED, @@ -82,7 +64,7 @@ void append_python_traceback_error_cause(void) } (void) BT_CURRENT_THREAD_ERROR_APPEND_CAUSE_FROM_UNKNOWN( - "Babeltrace library", "%s", exc->str); + BT_LIB_LOG_LIBBABELTRACE2_NAME, "%s", exc->str); } end: @@ -104,7 +86,7 @@ void log_python_traceback(int log_level) } BT_LOG_WRITE(log_level, BT_LOG_TAG, - "Exception occured: Python traceback:\n%s", exc->str); + "Exception occurred: Python traceback:\n%s", exc->str); } end: @@ -143,7 +125,7 @@ int init_python(void) ret = BT_FUNC_STATUS_ERROR; goto end; default: - abort(); + bt_common_abort(); } /* @@ -589,7 +571,7 @@ int bt_plugin_from_python_plugin_info(PyObject *plugin_info, bt_plugin_get_name(*plugin_out), comp_class, bt_component_class_get_name(comp_class), - bt_component_class_type_string( + bt_common_component_class_type_string( bt_component_class_get_type(comp_class))); goto error; }