Skip to content

Commit

Permalink
sys/test_utils/print_stack_usage: reduce MIN_SIZE for fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Feb 6, 2023
1 parent 99ebf4f commit bfcf2e5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sys/test_utils/print_stack_usage/print_stack_usage.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
#include <stdio.h>
#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)
{
Expand All @@ -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);
Expand Down

0 comments on commit bfcf2e5

Please sign in to comment.