kernel/sched: Add an optional "all" counter for thread_usage

Tally the runtime of all non-idle threads.  Make it optional via
kconfig to avoid overhead.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2021-09-28 09:13:36 -07:00 committed by Anas Nashif
commit b62d6e17a4
3 changed files with 27 additions and 2 deletions

View file

@ -172,6 +172,10 @@ struct z_kernel {
#if defined(CONFIG_THREAD_MONITOR)
struct k_thread *threads; /* singly linked list of ALL threads */
#endif
#ifdef CONFIG_SCHED_THREAD_USAGE_ALL
uint64_t all_thread_usage;
#endif
};
typedef struct z_kernel _kernel_t;