mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-07 05:35:02 -05:00
Debug - OS stacks - show current stack usage too
Change-Id: I41f895786e409c3f4ea500f99eb74cbd6cdbe5b6
This commit is contained in:
parent
c5d3468be6
commit
856da7f366
3 changed files with 10 additions and 4 deletions
|
|
@ -196,6 +196,7 @@ struct thread_debug_info
|
|||
char statusstr[4];
|
||||
char name[32];
|
||||
#ifndef HAVE_SDL_THREADS
|
||||
unsigned int stack_usage_cur;
|
||||
unsigned int stack_usage;
|
||||
#endif
|
||||
#if NUM_CORES > 1
|
||||
|
|
|
|||
|
|
@ -306,6 +306,11 @@ int thread_get_debug_info(unsigned int thread_id,
|
|||
#endif
|
||||
#ifndef HAVE_SDL_THREADS
|
||||
infop->stack_usage = stack_usage(thread->stack, thread->stack_size);
|
||||
|
||||
size_t stack_used_current =
|
||||
thread->stack_size - (thread->context.sp - (uintptr_t)thread->stack);
|
||||
|
||||
infop->stack_usage_cur = stack_used_current * 100 / thread->stack_size;
|
||||
#endif
|
||||
#if NUM_CORES > 1
|
||||
infop->core = thread->core;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue