lib: rename bt_graph_consume() -> bt_graph_run_once()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sun, 4 Aug 2019 05:09:28 +0000 (01:09 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 5 Aug 2019 19:10:13 +0000 (15:10 -0400)
While bt_graph_run() makes the graph run until the end,
bt_graph_run_once() makes it run a single time, that is, a single sink's
(next in the queue) "consume" operation.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I65dc06c93425d5b5aa1f9e31edf3e22bbeaf77f0
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1818
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
include/babeltrace2/graph/graph.h
src/lib/graph/graph.c

index 800592950d39e0cf7c1a1793cae9678a7fd6331a..30459fc497a0dd74ef0b0084fee50a2b35d385a9 100644 (file)
@@ -163,15 +163,15 @@ typedef enum bt_graph_run_status {
 
 extern bt_graph_run_status bt_graph_run(bt_graph *graph);
 
 
 extern bt_graph_run_status bt_graph_run(bt_graph *graph);
 
-typedef enum bt_graph_consume_status {
-       BT_GRAPH_CONSUME_STATUS_OK              = __BT_FUNC_STATUS_OK,
-       BT_GRAPH_CONSUME_STATUS_ERROR           = __BT_FUNC_STATUS_ERROR,
-       BT_GRAPH_CONSUME_STATUS_MEMORY_ERROR    = __BT_FUNC_STATUS_MEMORY_ERROR,
-       BT_GRAPH_CONSUME_STATUS_AGAIN           = __BT_FUNC_STATUS_AGAIN,
-       BT_GRAPH_CONSUME_STATUS_END             = __BT_FUNC_STATUS_END,
-} bt_graph_consume_status;
-
-extern bt_graph_consume_status bt_graph_consume(bt_graph *graph);
+typedef enum bt_graph_run_once_status {
+       BT_GRAPH_RUN_ONCE_STATUS_OK             = __BT_FUNC_STATUS_OK,
+       BT_GRAPH_RUN_ONCE_STATUS_ERROR          = __BT_FUNC_STATUS_ERROR,
+       BT_GRAPH_RUN_ONCE_STATUS_MEMORY_ERROR   = __BT_FUNC_STATUS_MEMORY_ERROR,
+       BT_GRAPH_RUN_ONCE_STATUS_AGAIN          = __BT_FUNC_STATUS_AGAIN,
+       BT_GRAPH_RUN_ONCE_STATUS_END            = __BT_FUNC_STATUS_END,
+} bt_graph_run_once_status;
+
+extern bt_graph_run_once_status bt_graph_run_once(bt_graph *graph);
 
 typedef enum bt_graph_add_listener_status {
        BT_GRAPH_ADD_LISTENER_STATUS_OK                 = __BT_FUNC_STATUS_OK,
 
 typedef enum bt_graph_add_listener_status {
        BT_GRAPH_ADD_LISTENER_STATUS_OK                 = __BT_FUNC_STATUS_OK,
index e4aed1f28143550eb647d4a7065274289e257b07..fe79fb20ab9a3bff034c45b45b4acdff847be998 100644 (file)
@@ -700,9 +700,9 @@ end:
        return status;
 }
 
        return status;
 }
 
-enum bt_graph_consume_status bt_graph_consume(struct bt_graph *graph)
+enum bt_graph_run_once_status bt_graph_run_once(struct bt_graph *graph)
 {
 {
-       enum bt_graph_consume_status status;
+       enum bt_graph_run_once_status status;
 
        BT_ASSERT_PRE_DEV_NON_NULL(graph, "Graph");
        BT_ASSERT_PRE_DEV(graph->can_consume,
 
        BT_ASSERT_PRE_DEV_NON_NULL(graph, "Graph");
        BT_ASSERT_PRE_DEV(graph->can_consume,
@@ -1352,7 +1352,8 @@ int add_component_with_init_method_data(
 
        /*
         * If it's a sink component, it needs to be part of the graph's
 
        /*
         * If it's a sink component, it needs to be part of the graph's
-        * sink queue to be consumed by bt_graph_consume().
+        * sink queue to be consumed by bt_graph_run() or
+        * bt_graph_run_once().
         */
        if (bt_component_is_sink(component)) {
                graph->has_sink = true;
         */
        if (bt_component_is_sink(component)) {
                graph->has_sink = true;
This page took 0.02731 seconds and 4 git commands to generate.