From 1f41c015531c4c3df0c1855456971b9fa78b198d Mon Sep 17 00:00:00 2001 From: Armin Brauns Date: Thu, 10 Nov 2022 14:11:07 +0100 Subject: [PATCH] shell: kernel: right-align stack usage percentages This improves readability by aliging digits with the same significance vertically. Signed-off-by: Armin Brauns --- subsys/shell/modules/kernel_service.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/shell/modules/kernel_service.c b/subsys/shell/modules/kernel_service.c index 09ef669441d..66fd9ece807 100644 --- a/subsys/shell/modules/kernel_service.c +++ b/subsys/shell/modules/kernel_service.c @@ -189,7 +189,7 @@ static void shell_stack_dump(const struct k_thread *thread, void *user_data) shell_print( (const struct shell *)user_data, "%p %-" STRINGIFY(THREAD_MAX_NAM_LEN) "s " - "(real size %4zu):\tunused %4zu\tusage %4zu / %4zu (%u %%)", + "(real size %4zu):\tunused %4zu\tusage %4zu / %4zu (%2u %%)", thread, tname ? tname : "NA", size, unused, size - unused, size, pcnt); } @@ -223,7 +223,7 @@ static int cmd_kernel_stacks(const struct shell *shell, __ASSERT_NO_MSG(err == 0); shell_print(shell, - "%p IRQ %02d %s(real size %4zu):\tunused %4zu\tusage %4zu / %4zu (%zu %%)", + "%p IRQ %02d %s(real size %4zu):\tunused %4zu\tusage %4zu / %4zu (%2zu %%)", &z_interrupt_stacks[i], i, pad, size, unused, size - unused, size, ((size - unused) * 100U) / size); }