diff options
author | Damjan Marion <damarion@cisco.com> | 2017-02-03 21:16:16 +0100 |
---|---|---|
committer | Damjan Marion <damarion@cisco.com> | 2017-02-03 21:16:16 +0100 |
commit | bfe4dfa7089b5d2c03aa607ab72abbcd840cbbce (patch) | |
tree | f7f95f988229c70a45916367cfce104d0c27eb6c /src/vnet/pg/stream.c | |
parent | 62411e7d82dc4562003651a53e723ea938be2ebd (diff) |
pg: add trace information for pg tx node
Change-Id: I31730d58c34331f25f5b02cd065be94251f1302c
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/pg/stream.c')
-rw-r--r-- | src/vnet/pg/stream.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/vnet/pg/stream.c b/src/vnet/pg/stream.c index 1ed7189ffc9..c46875e11ad 100644 --- a/src/vnet/pg/stream.c +++ b/src/vnet/pg/stream.c @@ -95,6 +95,25 @@ pg_stream_enable_disable (pg_main_t * pg, pg_stream_t * s, int want_enabled) } static u8 * +format_pg_output_trace (u8 * s, va_list * va) +{ + CLIB_UNUSED (vlib_main_t * vm) = va_arg (*va, vlib_main_t *); + CLIB_UNUSED (vlib_node_t * node) = va_arg (*va, vlib_node_t *); + pg_output_trace_t *t = va_arg (*va, pg_output_trace_t *); + uword indent = format_get_indent (s); + + s = format (s, "%Ubuffer 0x%x: %U", + format_white_space, indent, + t->buffer_index, format_vlib_buffer, &t->buffer); + + s = format (s, "\n%U%U", format_white_space, indent, + format_ethernet_header_with_length, t->buffer.pre_data, + sizeof (t->buffer.pre_data)); + + return s; +} + +static u8 * format_pg_interface_name (u8 * s, va_list * args) { pg_main_t *pg = &pg_main; @@ -125,6 +144,7 @@ VNET_DEVICE_CLASS (pg_dev_class) = { .name = "pg", .tx_function = pg_output, .format_device_name = format_pg_interface_name, + .format_tx_trace = format_pg_output_trace, .admin_up_down_function = pg_interface_admin_up_down, }; /* *INDENT-ON* */ |