diff options
author | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2019-12-19 11:54:10 +0100 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2019-12-19 19:53:29 +0000 |
commit | ff6cdcca2dc741bb3b0d3757e83ada523c7a4a45 (patch) | |
tree | 0c3cd541a4ffdd996c8b0a76071421d088845676 /src/plugins/hs_apps/sapi/vpp_echo_common.c | |
parent | b22e1f06bbebc48ec72ce8effa529e69ffbb12ca (diff) |
hsa: Add periodic timing
Type: feature
Change-Id: I18cf38d6f77e0d42212c85262f3bb769b9477b29
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/hs_apps/sapi/vpp_echo_common.c')
-rw-r--r-- | src/plugins/hs_apps/sapi/vpp_echo_common.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/hs_apps/sapi/vpp_echo_common.c b/src/plugins/hs_apps/sapi/vpp_echo_common.c index e7829f3ab89..0642ee67429 100644 --- a/src/plugins/hs_apps/sapi/vpp_echo_common.c +++ b/src/plugins/hs_apps/sapi/vpp_echo_common.c @@ -258,6 +258,20 @@ echo_unformat_timing_event (unformat_input_t * input, va_list * args) } u8 * +echo_format_bytes_per_sec (u8 * s, va_list * args) +{ + f64 bps = va_arg (*args, f64) * 8; + if (bps > 1e9) + return format (s, "%.3f Gb/s", bps / 1e9); + else if (bps > 1e6) + return format (s, "%.3f Mb/s", bps / 1e6); + else if (bps > 1e3) + return format (s, "%.3f Kb/s", bps / 1e3); + else + return format (s, "%.3f b/s", bps); +} + +u8 * echo_format_timing_event (u8 * s, va_list * args) { u32 timing_event = va_arg (*args, u32); |