X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Fplugin%2Fplugin-so.c;h=3017e6c0af167d5850b134cf6321f2e1c675b62c;hb=6375b9429f8332f3eacc2ec795aa1924c73d9cc8;hp=3684acaedd930fa5b3948a375cb54d1c3067b6b2;hpb=43c59509042845f8d42c3e99ec74d45fa2dc0908;p=babeltrace.git diff --git a/src/lib/plugin/plugin-so.c b/src/lib/plugin/plugin-so.c index 3684acae..3017e6c0 100644 --- a/src/lib/plugin/plugin-so.c +++ b/src/lib/plugin/plugin-so.c @@ -1,33 +1,15 @@ /* + * SPDX-License-Identifier: MIT + * * Copyright 2017-2018 Philippe Proulx * Copyright 2016 Jérémie Galarneau - * - * Author: Jérémie Galarneau - * - * 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. */ #define BT_LOG_TAG "LIB/PLUGIN-SO" #include "lib/logging.h" #include "common/assert.h" -#include "lib/assert-pre.h" +#include "lib/assert-cond.h" #include "compat/compiler.h" #include #include "lib/graph/component-class.h" @@ -84,6 +66,11 @@ BT_PLUGIN_MODULE(); * component class is removed from this list, the shared library handle * object's reference count falls to zero and the shared library is * finally closed. + * + * We're not using a GLib linked list here because this destructor is + * called after GLib's thread-specific data is destroyed, which contains + * the allocated memory for GLib data structures (what's used by + * g_slice_alloc()). */ static @@ -171,7 +158,7 @@ int bt_plugin_so_shared_lib_handle_create( int status = BT_FUNC_STATUS_OK; BT_ASSERT(shared_lib_handle); - BT_LOGI("Creating shared library handle: path=\"%s\"", path); + BT_LOGI("Creating shared library handle: path=\"%s\"", path ? path : "(null)"); *shared_lib_handle = g_new0(struct bt_plugin_so_shared_lib_handle, 1); if (!*shared_lib_handle) { BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one shared library handle."); @@ -215,7 +202,7 @@ end: BT_ASSERT(*shared_lib_handle || status != BT_FUNC_STATUS_OK); if (*shared_lib_handle) { BT_LOGI("Created shared library handle: path=\"%s\", addr=%p", - path, *shared_lib_handle); + path ? path : "(null)", *shared_lib_handle); } return status; @@ -699,7 +686,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin, NULL, descriptor->name, cur_cc_descr_attr->comp_class_descriptor->name, - bt_component_class_type_string( + bt_common_component_class_type_string( cur_cc_descr_attr->comp_class_descriptor->type), cur_cc_descr_attr->type_name, cur_cc_descr_attr->type); @@ -719,7 +706,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin, NULL, descriptor->name, cur_cc_descr_attr->comp_class_descriptor->name, - bt_component_class_type_string( + bt_common_component_class_type_string( cur_cc_descr_attr->comp_class_descriptor->type), cur_cc_descr_attr->type_name, cur_cc_descr_attr->type); @@ -779,7 +766,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin, NULL, descriptor->name, cc_full_descr->descriptor->name, - bt_component_class_type_string( + bt_common_component_class_type_string( cc_full_descr->descriptor->type)); if (cc_full_descr->descriptor->type == BT_COMPONENT_CLASS_TYPE_SOURCE ||