Skip to content

Commit 2c767cb

Browse files
dnltzdanieldegrasse
authored andcommitted
net: lib: zperf: Fix 'kbps' in output
zperf should only return 'Kbps'. There are still two left-overs from converting shell prints to 'Kbps'. Align all prints to make it easier for scripting and parsing content from console output. Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
1 parent 63ebb75 commit 2c767cb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

subsys/net/lib/zperf/zperf_shell.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -809,8 +809,9 @@ static int execute_upload(const struct shell *sh,
809809
shell_fprintf(sh, SHELL_NORMAL, "\n");
810810
shell_fprintf(sh, SHELL_NORMAL, "Packet size:\t%u bytes\n",
811811
param->packet_size);
812-
shell_fprintf(sh, SHELL_NORMAL, "Rate:\t\t%u kbps\n",
813-
param->rate_kbps);
812+
shell_fprintf(sh, SHELL_NORMAL, "Rate:\t\t");
813+
print_number(sh, param->rate_kbps, KBPS, KBPS_UNIT);
814+
shell_fprintf(sh, SHELL_NORMAL, "\n");
814815

815816
if (IS_ENABLED(CONFIG_ZPERF_SESSION_PER_THREAD) &&
816817
COND_CODE_1(CONFIG_ZPERF_SESSION_PER_THREAD,
@@ -1646,8 +1647,9 @@ static void session_cb(struct session *ses,
16461647
print_number_64(sh,
16471648
(uint64_t)ses->async_upload_ctx.param.duration_ms * USEC_PER_MSEC,
16481649
TIME_US, TIME_US_UNIT);
1649-
shell_fprintf(sh, SHELL_NORMAL, "\t\t%u kbps\n",
1650-
ses->async_upload_ctx.param.rate_kbps);
1650+
shell_fprintf(sh, SHELL_NORMAL, "\t\t");
1651+
print_number(sh, ses->async_upload_ctx.param.rate_kbps, KBPS, KBPS_UNIT);
1652+
shell_fprintf(sh, SHELL_NORMAL, "\n");
16511653

16521654
data->finalized_count++;
16531655
}

0 commit comments

Comments
 (0)