Loading...
Searching...
No Matches
Print stack usage

Print the stack usage of threads in JSON metric format. More...

Detailed Description

Print the stack usage of threads in JSON metric format.

When the module test_utils_print_stack_usage is used, the stack usage of each thread is printed when it exits, and the stack usage of the idle thread is printed when main() returns.

Note
Nothing is printed unless DEVELHELP is enabled, as the stacks are only filled with canaries and the stack sizes and thread names are only stored with DEVELHELP.

Files

file  print_stack_usage.h
 Print the stack usage of threads.
 

Functions

void print_stack_usage_metric (const char *name, void *stack, unsigned max_size)
 Print the stack usage of a stack in JSON metric format.
 

Function Documentation

◆ print_stack_usage_metric()

void print_stack_usage_metric ( const char * name,
void * stack,
unsigned max_size )

Print the stack usage of a stack in JSON metric format.

Does nothing if DEVELHELP is not enabled.

Parameters
[in]nameName of the thread to print.
[in]stackStart of the stack, as passed to thread_create() (may be unaligned).
[in]max_sizeSize of the stack in bytes, as passed to thread_create().