X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=src%2Flib%2Fgraph%2Fgraph.h;h=ace6ca2edabf9d7765b764359626c6f9289d7b27;hb=51375aa95adf2f601f74a5a1f1665ca685584388;hp=f22b5800c7fe2bc2bc441a1156ba2242ea3f58ec;hpb=ce53ba7aa47854de310cd47b9553a2ae8ff32aee;p=babeltrace.git diff --git a/src/lib/graph/graph.h b/src/lib/graph/graph.h index f22b5800..ace6ca2e 100644 --- a/src/lib/graph/graph.h +++ b/src/lib/graph/graph.h @@ -38,6 +38,21 @@ #include "component-sink.h" #include "connection.h" +/* Protection: this file uses BT_LIB_LOG*() macros directly */ +#ifndef BT_LIB_LOG_SUPPORTED +# error Please include "lib/logging.h" before including this file. +#endif + +/* Protection: this file uses BT_ASSERT_PRE*() macros directly */ +#ifndef BT_ASSERT_PRE_SUPPORTED +# error Please include "lib/assert-pre.h" before including this file. +#endif + +/* Protection: this file uses BT_ASSERT_POST*() macros directly */ +#ifndef BT_ASSERT_POST_SUPPORTED +# error Please include "lib/assert-post.h" before including this file. +#endif + struct bt_component; struct bt_port; @@ -219,10 +234,7 @@ enum bt_graph_status bt_graph_configure(struct bt_graph *graph) goto end; } -#ifdef BT_ASSERT_PRE BT_ASSERT_PRE(graph->has_sink, "Graph has no sink component: %!+g", graph); -#endif - graph->config_state = BT_GRAPH_CONFIGURATION_STATE_PARTIALLY_CONFIGURED; for (i = 0; i < graph->components->len; i++) { @@ -242,38 +254,26 @@ enum bt_graph_status bt_graph_configure(struct bt_graph *graph) if (comp_cls_sink->methods.graph_is_configured) { enum bt_self_component_status comp_status; -#ifdef BT_LIB_LOGD BT_LIB_LOGD("Calling user's \"graph is configured\" method: " "%![graph-]+g, %![comp-]+c", graph, comp); -#endif - comp_status = comp_cls_sink->methods.graph_is_configured( (void *) comp_sink); - -#ifdef BT_LIB_LOGD BT_LIB_LOGD("User method returned: status=%s", bt_self_component_status_string(comp_status)); -#endif - -#ifdef BT_ASSERT_POST BT_ASSERT_POST(comp_status == BT_SELF_COMPONENT_STATUS_OK || comp_status == BT_SELF_COMPONENT_STATUS_ERROR || comp_status == BT_SELF_COMPONENT_STATUS_NOMEM, "Unexpected returned status: status=%s", bt_self_component_status_string(comp_status)); -#endif if (comp_status != BT_SELF_COMPONENT_STATUS_OK) { status = BT_GRAPH_STATUS_ERROR; -#ifdef BT_LIB_LOGW BT_LIB_LOGW("User's \"graph is configured\" method failed: " "%![comp-]+c, status=%s", comp, bt_self_component_status_string( comp_status)); -#endif - goto end; } } @@ -291,9 +291,7 @@ static inline void bt_graph_make_faulty(struct bt_graph *graph) { graph->config_state = BT_GRAPH_CONFIGURATION_STATE_FAULTY; -#ifdef BT_LIB_LOGI BT_LIB_LOGI("Set graph's state to faulty: %![graph-]+g", graph); -#endif } #endif /* BABELTRACE_GRAPH_GRAPH_INTERNAL_H */