lib: remove LOADING_ERROR status
[babeltrace.git] / src / lib / plugin / plugin-so.c
index 92f47825e72ed1bc6f556b60c86f955905f1f0f6..ae7955986f6b9cba1d4198127a790f2433d07d9a 100644 (file)
@@ -125,7 +125,7 @@ void bt_plugin_so_shared_lib_handle_destroy(struct bt_object *obj)
        }
 
        if (shared_lib_handle->module) {
-#ifndef BT_DEBUG_MODE
+#ifdef BT_DEBUG_MODE
                /*
                 * Valgrind shows incomplete stack traces when
                 * dynamically loaded libraries are closed before it
@@ -149,7 +149,7 @@ void bt_plugin_so_shared_lib_handle_destroy(struct bt_object *obj)
                        }
 
                        shared_lib_handle->module = NULL;
-#ifndef BT_DEBUG_MODE
+#ifdef BT_DEBUG_MODE
                } else {
                        BT_LOGI("Not closing GModule because `LIBBABELTRACE2_NO_DLCLOSE=1`: "
                                "path=\"%s\"", path);
@@ -364,7 +364,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                const struct __bt_plugin_descriptor_attribute *cur_attr =
                        *cur_attr_ptr;
 
-               if (cur_attr == NULL) {
+               if (!cur_attr) {
                        continue;
                }
 
@@ -406,10 +406,10 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                NULL,
                                        descriptor->name, cur_attr->type_name,
                                        cur_attr->type);
-                               status = BT_FUNC_STATUS_LOADING_ERROR;
+                               status = BT_FUNC_STATUS_ERROR;
                                goto end;
                        } else {
-                               BT_LIB_LOGI(
+                               BT_LIB_LOGW(
                                        "Ignoring unknown plugin descriptor attribute: "
                                        "plugin-path=\"%s\", plugin-name=\"%s\", "
                                        "attr-type-name=\"%s\", attr-type-id=%d",
@@ -434,7 +434,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                        *cur_cc_descr_ptr;
                struct comp_class_full_descriptor full_descriptor = {0};
 
-               if (cur_cc_descr == NULL) {
+               if (!cur_cc_descr) {
                        continue;
                }
 
@@ -457,7 +457,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                        *cur_cc_descr_attr_ptr;
                enum bt_component_class_type cc_type;
 
-               if (cur_cc_descr_attr == NULL) {
+               if (!cur_cc_descr_attr) {
                        continue;
                }
 
@@ -683,10 +683,10 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                        cur_cc_descr_attr->comp_class_descriptor->type),
                                                cur_cc_descr_attr->type_name,
                                                cur_cc_descr_attr->type);
-                                       status = BT_FUNC_STATUS_LOADING_ERROR;
+                                       status = BT_FUNC_STATUS_ERROR;
                                        goto end;
                                } else {
-                                       BT_LIB_LOGI(
+                                       BT_LIB_LOGW(
                                                "Ignoring unknown component class descriptor attribute: "
                                                "plugin-path=\"%s\", "
                                                "plugin-name=\"%s\", "
@@ -728,7 +728,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                status = init_status;
                                goto end;
                        } else {
-                               BT_LIB_LOGI(
+                               BT_LIB_LOGW(
                                        "User's plugin initialization function failed: "
                                        "status=%s",
                                        bt_common_func_status_string(init_status));
@@ -796,10 +796,10 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                        descriptor->name,
                                        cc_full_descr->descriptor->name,
                                        cc_full_descr->descriptor->type);
-                               status = BT_FUNC_STATUS_LOADING_ERROR;
+                               status = BT_FUNC_STATUS_ERROR;
                                goto end;
                        } else {
-                               BT_LIB_LOGI(
+                               BT_LIB_LOGW(
                                        "Ignoring unknown component class type: "
                                        "plugin-path=\"%s\", plugin-name=\"%s\", "
                                        "comp-class-name=\"%s\", comp-class-type=%d",
@@ -1319,7 +1319,7 @@ int bt_plugin_so_create_all_from_sections(
                        descriptors_begin[i];
                struct bt_plugin *plugin;
 
-               if (descriptor == NULL) {
+               if (!descriptor) {
                        continue;
                }
 
@@ -1332,10 +1332,10 @@ int bt_plugin_so_create_all_from_sections(
                                BT_LIB_LOGW_APPEND_CAUSE(
                                        "Unknown ABI major version: abi-major=%d",
                                                descriptor->major);
-                               status = BT_FUNC_STATUS_LOADING_ERROR;
+                               status = BT_FUNC_STATUS_ERROR;
                                goto error;
                        } else {
-                               BT_LIB_LOGI(
+                               BT_LIB_LOGW(
                                        "Unknown ABI major version: abi-major=%d",
                                                descriptor->major);
                                continue;
@@ -1489,8 +1489,6 @@ int bt_plugin_so_create_all_from_file(const char *path,
        if (status != BT_FUNC_STATUS_OK) {
                /* bt_plugin_so_shared_lib_handle_create() logs more details */
                BT_ASSERT(!shared_lib_handle);
-               BT_LIB_LOGE_APPEND_CAUSE(
-                       "Cannot create shared library handle.");
                goto end;
        }
 
@@ -1524,9 +1522,9 @@ int bt_plugin_so_create_all_from_file(const char *path,
                                "Cannot resolve plugin symbol: path=\"%s\", "
                                "symbol=\"%s\"", path,
                                "__bt_get_end_section_plugin_descriptors");
-                       status = BT_FUNC_STATUS_LOADING_ERROR;
+                       status = BT_FUNC_STATUS_ERROR;
                } else {
-                       BT_LIB_LOGI(
+                       BT_LIB_LOGW(
                                "Cannot resolve plugin symbol: path=\"%s\", "
                                "symbol=\"%s\"", path,
                                "__bt_get_end_section_plugin_descriptors");
@@ -1564,9 +1562,9 @@ int bt_plugin_so_create_all_from_file(const char *path,
                                path, "__bt_get_begin_section_plugin_descriptor_attributes",
                                "__bt_get_end_section_plugin_descriptor_attributes",
                                attrs_begin, attrs_end);
-                       status = BT_FUNC_STATUS_LOADING_ERROR;
+                       status = BT_FUNC_STATUS_ERROR;
                } else {
-                       BT_LIB_LOGI(
+                       BT_LIB_LOGW(
                                "Found section start or end symbol, but not both: "
                                "path=\"%s\", symbol-start=\"%s\", "
                                "symbol-end=\"%s\", symbol-start-addr=%p, "
@@ -1608,9 +1606,9 @@ int bt_plugin_so_create_all_from_file(const char *path,
                                path, "__bt_get_begin_section_component_class_descriptors",
                                "__bt_get_end_section_component_class_descriptors",
                                cc_descriptors_begin, cc_descriptors_end);
-                       status = BT_FUNC_STATUS_LOADING_ERROR;
+                       status = BT_FUNC_STATUS_ERROR;
                } else {
-                       BT_LIB_LOGI(
+                       BT_LIB_LOGW(
                                "Found section start or end symbol, but not both: "
                                "path=\"%s\", symbol-start=\"%s\", "
                                "symbol-end=\"%s\", symbol-start-addr=%p, "
@@ -1652,9 +1650,9 @@ int bt_plugin_so_create_all_from_file(const char *path,
                                path, "__bt_get_begin_section_component_class_descriptor_attributes",
                                "__bt_get_end_section_component_class_descriptor_attributes",
                                cc_descr_attrs_begin, cc_descr_attrs_end);
-                       status = BT_FUNC_STATUS_LOADING_ERROR;
+                       status = BT_FUNC_STATUS_ERROR;
                } else {
-                       BT_LIB_LOGI(
+                       BT_LIB_LOGW(
                                "Found section start or end symbol, but not both: "
                                "path=\"%s\", symbol-start=\"%s\", "
                                "symbol-end=\"%s\", symbol-start-addr=%p, "
This page took 0.027474 seconds and 4 git commands to generate.