From 1ed8d3525139a260587a53d531327012ed3a0664 Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Sat, 18 Feb 2012 19:10:39 -0800 Subject: [PATCH] ofproto: Print odp actions during traces. I would have found this information useful when debugging a problem recently. Signed-off-by: Ethan Jackson --- ofproto/ofproto-dpif.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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); } -- 2.30.2