From: Ethan Jackson Date: Sun, 19 Feb 2012 03:10:39 +0000 (-0800) Subject: ofproto: Print odp actions during traces. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ed8d3525139a260587a53d531327012ed3a0664;p=openvswitch ofproto: Print odp actions during traces. I would have found this information useful when debugging a problem recently. Signed-off-by: Ethan Jackson --- diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index c025dff4..ab1cbe7e 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -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); }