From bfcf2e51596c13fdeac57df5cb6e37a43e2886d4 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 6 Feb 2023 10:38:18 +0100 Subject: [PATCH] sys/test_utils/print_stack_usage: reduce `MIN_SIZE` for fmt --- sys/test_utils/print_stack_usage/print_stack_usage.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/test_utils/print_stack_usage/print_stack_usage.c b/sys/test_utils/print_stack_usage/print_stack_usage.c index 6b67d6d1acc35..b4e8f7c7761ef 100644 --- a/sys/test_utils/print_stack_usage/print_stack_usage.c +++ b/sys/test_utils/print_stack_usage/print_stack_usage.c @@ -26,7 +26,11 @@ #include #endif +#if MODULE_FMT +# define MIN_SIZE (THREAD_STACKSIZE_TINY) +#else # define MIN_SIZE (THREAD_STACKSIZE_TINY + THREAD_EXTRA_STACKSIZE_PRINTF) +#endif void print_stack_usage_metric(const char *name, void *stack, unsigned max_size) { @@ -37,7 +41,7 @@ void print_stack_usage_metric(const char *name, void *stack, unsigned max_size) #if MODULE_FMT print_str("{ \"threads\": [{ \"name\": \""); print_str(name); - print_str(", \"stack_size\": "); + print_str("\", \"stack_size\": "); print_u32_dec(max_size); print_str(", \"stack_used\": "); print_u32_dec(max_size - free);