summaryrefslogtreecommitdiff
path: root/ofproto
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2011-08-12 14:10:15 -0700
committerEthan Jackson <ethan@nicira.com>2011-08-12 15:30:35 -0700
commiteb9e1c2613587b9b08ca849b6af5ccae2b2d9227 (patch)
treedc81e11cc916dbe0058bd37ab547820f1e9053e1 /ofproto
parentf694937d4ec5342b218b760cabbf7a48d19110e8 (diff)
downloadopenvswitch-eb9e1c2613587b9b08ca849b6af5ccae2b2d9227.tar.gz
ofproto-dpif: Print register values in trace.
I found this patch useful in tracking down a bug recently.
Diffstat (limited to 'ofproto')
-rw-r--r--ofproto/ofproto-dpif.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index fdef4afa5..a6e1782e4 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -4019,6 +4019,20 @@ trace_format_flow(struct ds *result, int level, const char *title,
}
static void
+trace_format_regs(struct ds *result, int level, const char *title,
+ struct ofproto_trace *trace)
+{
+ size_t i;
+
+ ds_put_char_multiple(result, '\t', level);
+ ds_put_format(result, "%s:", title);
+ for (i = 0; i < FLOW_N_REGS; i++) {
+ ds_put_format(result, " reg%zu=0x%"PRIx32, i, trace->flow.regs[i]);
+ }
+ ds_put_char(result, '\n');
+}
+
+static void
trace_resubmit(struct action_xlate_ctx *ctx, struct rule_dpif *rule)
{
struct ofproto_trace *trace = CONTAINER_OF(ctx, struct ofproto_trace, ctx);
@@ -4026,6 +4040,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_rule(result, ctx->table_id, ctx->recurse + 1, rule);
}