zephyr/include/kernel/stats.h
Peter Mitsis 0ebd6c7f26 kernel/sched: enable/disable runtime stats
Adds support to enable/disable both thread and cpu runtime
stats.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2022-01-10 10:38:06 -05:00

27 lines
672 B
C

/*
* Copyright (c) 2021, Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_KERNEL_STATS_H_
#define ZEPHYR_INCLUDE_KERNEL_STATS_H_
#include <stdint.h>
/*
* [k_cycle_stats] is used to track internal statistics about both thread
* and CPU usage.
*/
struct k_cycle_stats {
uint64_t total; /* total usage in cycles */
#ifdef CONFIG_SCHED_THREAD_USAGE_ANALYSIS
uint64_t current; /* # of cycles in current usage window */
uint64_t longest; /* # of cycles in longest usage window */
uint32_t num_windows; /* # of usage windows */
#endif
bool track_usage; /* true if gathering usage stats */
};
#endif