dpif: Log each operation in dpif_operate().
authorBen Pfaff <blp@nicira.com>
Mon, 26 Dec 2011 22:42:48 +0000 (14:42 -0800)
committerBen Pfaff <blp@nicira.com>
Mon, 16 Jan 2012 21:37:27 +0000 (13:37 -0800)
Without logging of operation groups, it becomes more difficult to debug
problems related to flow setups, since those go through operation groups.

Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/dpif.c

index d8134698ae7f79363b7aa25e9fcd3cf9c674ca8f..37c001285fb64a53ee53f1862e4f704bc01dee7e 100644 (file)
@@ -992,6 +992,20 @@ dpif_operate(struct dpif *dpif, struct dpif_op **ops, size_t n_ops)
 
     if (dpif->dpif_class->operate) {
         dpif->dpif_class->operate(dpif, ops, n_ops);
+
+        for (i = 0; i < n_ops; i++) {
+            struct dpif_op *op = ops[i];
+
+            switch (op->type) {
+            case DPIF_OP_FLOW_PUT:
+                log_flow_put_message(dpif, &op->u.flow_put, op->error);
+                break;
+
+            case DPIF_OP_EXECUTE:
+                log_execute_message(dpif, &op->u.execute, op->error);
+                break;
+            }
+        }
         return;
     }