Remove unused `src/plugins/ctf/common/utils`
[babeltrace.git] / src / cli / babeltrace2.c
index 346938a9e4f367a8f998c0cba733c97856f5b77d..fed54d9bc6cc94fcbc9a64435d7b81c89b12cfe5 100644 (file)
  * modules.
  */
 static const char* log_level_env_var_names[] = {
-       "BABELTRACE_COMMON_LOG_LEVEL",
-       "BABELTRACE_COMPAT_LOG_LEVEL",
-       "BABELTRACE_CTFSER_LOG_LEVEL",
-       "BABELTRACE_FD_CACHE_LOG_LEVEL",
-       "BABELTRACE_FLT_LTTNG_UTILS_DEBUG_INFO_LOG_LEVEL",
-       "BABELTRACE_FLT_UTILS_COUNTER_LOG_LEVEL",
-       "BABELTRACE_FLT_UTILS_MUXER_LOG_LEVEL",
-       "BABELTRACE_FLT_UTILS_TRIMMER_LOG_LEVEL",
-       "BABELTRACE_PLUGIN_CTF_BFCR_LOG_LEVEL",
        "BABELTRACE_PLUGIN_CTF_METADATA_LOG_LEVEL",
-       "BABELTRACE_PLUGIN_CTF_MSG_ITER_LOG_LEVEL",
-       "BABELTRACE_PLUGIN_CTF_UTILS_LOG_LEVEL",
        "BABELTRACE_PYTHON_BT2_LOG_LEVEL",
        "BABELTRACE_SINK_CTF_FS_LOG_LEVEL",
-       "BABELTRACE_SINK_TEXT_PRETTY_LOG_LEVEL",
        "BABELTRACE_SINK_TEXT_DETAILS_LOG_LEVEL",
        "BABELTRACE_SRC_CTF_FS_LOG_LEVEL",
        "BABELTRACE_SRC_CTF_LTTNG_LIVE_LOG_LEVEL",
-       "BABELTRACE_SRC_TEXT_DMESG_LOG_LEVEL",
        NULL,
 };
 
@@ -172,9 +159,9 @@ void destroy_the_query_executor(void)
 }
 
 static
-int query(const bt_component_class *comp_cls, const char *obj,
-               const bt_value *params, const bt_value **user_result,
-               const char **fail_reason)
+int query(struct bt_config *cfg, const bt_component_class *comp_cls,
+               const char *obj, const bt_value *params,
+               const bt_value **user_result, const char **fail_reason)
 {
        const bt_value *result = NULL;
        bt_query_executor_status status;
@@ -200,7 +187,7 @@ int query(const bt_component_class *comp_cls, const char *obj,
 
        while (true) {
                status = bt_query_executor_query(the_query_executor,
-                       comp_cls, obj, params, &result);
+                       comp_cls, obj, params, cfg->log_level, &result);
                switch (status) {
                case BT_QUERY_EXECUTOR_STATUS_OK:
                        goto ok;
@@ -969,7 +956,7 @@ int cmd_query(struct bt_config *cfg)
                goto end;
        }
 
-       ret = query(comp_cls, cfg->cmd_data.query.object->str,
+       ret = query(cfg, comp_cls, cfg->cmd_data.query.object->str,
                cfg->cmd_data.query.cfg_component->params,
                &results, &fail_reason);
        if (ret) {
@@ -1265,7 +1252,7 @@ int cmd_print_lttng_live_sessions(struct bt_config *cfg)
                goto error;
        }
 
-       ret = query(comp_cls, "sessions", params,
+       ret = query(cfg, comp_cls, "sessions", params,
                    &results, &fail_reason);
        if (ret) {
                goto failed;
@@ -1419,7 +1406,7 @@ int cmd_print_ctf_metadata(struct bt_config *cfg)
                goto end;
        }
 
-       ret = query(comp_cls, "metadata-info",
+       ret = query(cfg, comp_cls, "metadata-info",
                params, &results, &fail_reason);
        if (ret) {
                goto failed;
@@ -1782,7 +1769,8 @@ int cmd_run_ctx_connect_upstream_port_to_downstream_component(
                        ctx->connect_ports = false;
                        graph_status = bt_graph_add_filter_component(
                                ctx->graph, trimmer_class, trimmer_name,
-                               trimmer_params, &trimmer);
+                               trimmer_params, ctx->cfg->log_level,
+                               &trimmer);
                        free(trimmer_name);
                        if (graph_status != BT_GRAPH_STATUS_OK) {
                                goto error;
@@ -2177,7 +2165,7 @@ int set_stream_intersections(struct cmd_run_ctx *ctx,
        const bt_component_class *comp_cls =
                bt_component_class_source_as_component_class_const(src_comp_cls);
 
-       ret = query(comp_cls, "trace-info",
+       ret = query(ctx->cfg, comp_cls, "trace-info",
                cfg_comp->params, &query_result,
                &fail_reason);
        if (ret) {
@@ -2390,23 +2378,25 @@ int cmd_run_ctx_create_components_from_config_components(
                        goto error;
                }
 
+               BT_ASSERT(cfg_comp->log_level >= BT_LOG_VERBOSE);
+
                switch (cfg_comp->type) {
                case BT_COMPONENT_CLASS_TYPE_SOURCE:
                        ret = bt_graph_add_source_component(ctx->graph,
                                comp_cls, cfg_comp->instance_name->str,
-                               cfg_comp->params,
+                               cfg_comp->params, cfg_comp->log_level,
                                (void *) &comp);
                        break;
                case BT_COMPONENT_CLASS_TYPE_FILTER:
                        ret = bt_graph_add_filter_component(ctx->graph,
                                comp_cls, cfg_comp->instance_name->str,
-                               cfg_comp->params,
+                               cfg_comp->params, cfg_comp->log_level,
                                (void *) &comp);
                        break;
                case BT_COMPONENT_CLASS_TYPE_SINK:
                        ret = bt_graph_add_sink_component(ctx->graph,
                                comp_cls, cfg_comp->instance_name->str,
-                               cfg_comp->params,
+                               cfg_comp->params, cfg_comp->log_level,
                                (void *) &comp);
                        break;
                default:
This page took 0.025757 seconds and 4 git commands to generate.