Like with the recompute stopwatch, each input change handler has a
stopwatch added. This tells us, in contrast to the recompute stopwatch,
the amount of time that is used on engine node input change handlers.

Signed-off-by: Mark Michelson <[email protected]>
---
 lib/inc-proc-eng.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/inc-proc-eng.c b/lib/inc-proc-eng.c
index 7986efa83..98eec6297 100644
--- a/lib/inc-proc-eng.c
+++ b/lib/inc-proc-eng.c
@@ -278,6 +278,9 @@ engine_add_input_impl(struct engine_node *node, struct 
engine_node *input,
     node->inputs[node->n_inputs].node = input;
     node->inputs[node->n_inputs].change_handler = change_handler;
     node->inputs[node->n_inputs].change_handler_name = change_handler_name;
+    if (change_handler) {
+        stopwatch_create(change_handler_name, SW_MS);
+    }
     node->n_inputs ++;
 }
 
@@ -432,7 +435,11 @@ run_recompute_callback(struct engine_node *node)
 static enum engine_input_handler_result
 run_change_handler(struct engine_node *node, struct engine_node_input *input)
 {
-    return input->change_handler(node, node->data);
+    enum engine_input_handler_result ret;
+    stopwatch_start(input->change_handler_name, time_msec());
+    ret = input->change_handler(node, node->data);
+    stopwatch_stop(input->change_handler_name, time_msec());
+    return ret;
 }
 
 /* Do a full recompute (or at least try). If we're not allowed then
-- 
2.51.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to