ofproto: Print odp actions during traces.
authorEthan Jackson <ethan@nicira.com>
Sun, 19 Feb 2012 03:10:39 +0000 (19:10 -0800)
committerEthan Jackson <ethan@nicira.com>
Tue, 21 Feb 2012 03:34:17 +0000 (19:34 -0800)
I would have found this information useful when debugging a problem
recently.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ofproto/ofproto-dpif.c

index c025dff..ab1cbe7 100644 (file)
@@ -5983,6 +5983,18 @@ trace_format_regs(struct ds *result, int level, const char *title,
     ds_put_char(result, '\n');
 }
 
+static void
+trace_format_odp(struct ds *result, int level, const char *title,
+                 struct ofproto_trace *trace)
+{
+    struct ofpbuf *odp_actions = trace->ctx.odp_actions;
+
+    ds_put_char_multiple(result, '\t', level);
+    ds_put_format(result, "%s: ", title);
+    format_odp_actions(result, odp_actions->data, odp_actions->size);
+    ds_put_char(result, '\n');
+}
+
 static void
 trace_resubmit(struct action_xlate_ctx *ctx, struct rule_dpif *rule)
 {
@@ -5992,6 +6004,7 @@ trace_resubmit(struct action_xlate_ctx *ctx, struct rule_dpif *rule)
     ds_put_char(result, '\n');
     trace_format_flow(result, ctx->recurse + 1, "Resubmitted flow", trace);
     trace_format_regs(result, ctx->recurse + 1, "Resubmitted regs", trace);
+    trace_format_odp(result,  ctx->recurse + 1, "Resubmitted  odp", trace);
     trace_format_rule(result, ctx->table_id, ctx->recurse + 1, rule);
 }