From 374f706bff707b8a4bcf62cb1ff0c48d5a65b3bf Mon Sep 17 00:00:00 2001 From: Dave Wallace Date: Thu, 22 Aug 2019 21:15:54 +0000 Subject: hsa: clean up vpp_echo json output Type: style Change-Id: I8dbf2197b78690b94a346d6ff564648ab42f8235 Signed-off-by: Dave Wallace --- src/plugins/hs_apps/sapi/vpp_echo.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/plugins/hs_apps') diff --git a/src/plugins/hs_apps/sapi/vpp_echo.c b/src/plugins/hs_apps/sapi/vpp_echo.c index 612bdb98e78..18997599113 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo.c +++ b/src/plugins/hs_apps/sapi/vpp_echo.c @@ -128,21 +128,23 @@ print_global_json_stats (echo_main_t * em) u8 *end_evt = format (0, "%U", echo_format_timing_event, em->timing.end_event); fformat (stdout, "{\n"); - fformat (stdout, "\"time\": \"%.9f\",\n", deltat); - fformat (stdout, "\"start_evt\": \"%s\",\n", start_evt); - fformat (stdout, "\"end_evt\": \"%s\",\n", end_evt); - fformat (stdout, "\"rx_data\": %lld,\n", em->stats.rx_total); - fformat (stdout, "\"tx_rx\": %lld,\n", em->stats.tx_total); - fformat (stdout, "\"closing\": {\n"); - fformat (stdout, " \"reset\": { \"q\": %d, \"s\": %d },\n", + fformat (stdout, " \"role\": \"%s\",\n", + em->i_am_master ? "server" : "client"); + fformat (stdout, " \"time\": \"%.9f\",\n", deltat); + fformat (stdout, " \"start_evt\": \"%s\",\n", start_evt); + fformat (stdout, " \"end_evt\": \"%s\",\n", end_evt); + fformat (stdout, " \"rx_data\": %lld,\n", em->stats.rx_total); + fformat (stdout, " \"tx_rx\": %lld,\n", em->stats.tx_total); + fformat (stdout, " \"closing\": {\n"); + fformat (stdout, " \"reset\": { \"q\": %d, \"s\": %d },\n", em->stats.reset_count.q, em->stats.reset_count.s); - fformat (stdout, " \"close\": { \"q\": %d, \"s\": %d },\n", + fformat (stdout, " \"close\": { \"q\": %d, \"s\": %d },\n", em->stats.close_count.q, em->stats.close_count.s); - fformat (stdout, " \"active\": { \"q\": %d, \"s\": %d },\n", + fformat (stdout, " \"active\": { \"q\": %d, \"s\": %d },\n", em->stats.active_count.q, em->stats.active_count.s); - fformat (stdout, " \"clean\": { \"q\": %d, \"s\": %d }\n", + fformat (stdout, " \"clean\": { \"q\": %d, \"s\": %d }\n", em->stats.clean_count.q, em->stats.clean_count.s); - fformat (stdout, "}\n"); + fformat (stdout, " }\n"); fformat (stdout, "}\n"); } -- cgit 1.2.3-korg