kernel: rename boot time globals
These are renamed to z_timestamp_main and z_timestamp_idle, and now specified in kernel_internal.h. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
fa22ecffec
commit
e6654103ba
5 changed files with 15 additions and 14 deletions
|
@ -23,11 +23,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOOT_TIME_MEASUREMENT
|
||||
extern u32_t __main_time_stamp; /* timestamp when main task starts */
|
||||
extern u32_t __idle_time_stamp; /* timestamp when CPU goes idle */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Kernel APIs
|
||||
* @defgroup kernel_apis Kernel APIs
|
||||
|
|
|
@ -147,9 +147,9 @@ void idle(void *unused1, void *unused2, void *unused3)
|
|||
#ifdef CONFIG_BOOT_TIME_MEASUREMENT
|
||||
/* record timestamp when idling begins */
|
||||
|
||||
extern u32_t __idle_time_stamp;
|
||||
extern u32_t z_timestamp_idle;
|
||||
|
||||
__idle_time_stamp = k_cycle_get_32();
|
||||
z_timestamp_idle = k_cycle_get_32();
|
||||
#endif
|
||||
|
||||
while (true) {
|
||||
|
|
|
@ -295,6 +295,11 @@ extern u64_t z_arch_timing_value_swap_common;
|
|||
extern u64_t z_arch_timing_value_swap_temp;
|
||||
#endif /* CONFIG_EXECUTION_BENCHMARKING */
|
||||
|
||||
#ifdef CONFIG_BOOT_TIME_MEASUREMENT
|
||||
extern u32_t z_timestamp_main; /* timestamp when main task starts */
|
||||
extern u32_t z_timestamp_idle; /* timestamp when CPU goes idle */
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -66,8 +66,8 @@ LOG_MODULE_REGISTER(os);
|
|||
/* boot time measurement items */
|
||||
|
||||
#ifdef CONFIG_BOOT_TIME_MEASUREMENT
|
||||
u32_t __noinit __main_time_stamp; /* timestamp when main task starts */
|
||||
u32_t __noinit __idle_time_stamp; /* timestamp when CPU goes idle */
|
||||
u32_t __noinit z_timestamp_main; /* timestamp when main task starts */
|
||||
u32_t __noinit z_timestamp_idle; /* timestamp when CPU goes idle */
|
||||
#endif
|
||||
|
||||
/* init/main and idle threads */
|
||||
|
@ -283,7 +283,7 @@ static void bg_thread_main(void *unused1, void *unused2, void *unused3)
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_BOOT_TIME_MEASUREMENT
|
||||
__main_time_stamp = k_cycle_get_32();
|
||||
z_timestamp_main = k_cycle_get_32();
|
||||
#endif
|
||||
|
||||
extern void main(void);
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include <zephyr.h>
|
||||
#include <tc_util.h>
|
||||
#include <kernel_internal.h>
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
@ -34,17 +35,17 @@ void main(void)
|
|||
|
||||
int freq = sys_clock_hw_cycles_per_sec() / 1000000;
|
||||
|
||||
main_us = __main_time_stamp / freq;
|
||||
main_us = z_timestamp_main / freq;
|
||||
task_us = task_time_stamp / freq;
|
||||
idle_us = __idle_time_stamp / freq;
|
||||
idle_us = z_timestamp_idle / freq;
|
||||
|
||||
TC_START("Boot Time Measurement");
|
||||
TC_PRINT("Boot Result: Clock Frequency: %d MHz\n", freq);
|
||||
TC_PRINT("_start->main(): %u cycles, %u us\n", __main_time_stamp,
|
||||
TC_PRINT("_start->main(): %u cycles, %u us\n", z_timestamp_main,
|
||||
main_us);
|
||||
TC_PRINT("_start->task : %u cycles, %u us\n", task_time_stamp,
|
||||
task_us);
|
||||
TC_PRINT("_start->idle : %u cycles, %u us\n", __idle_time_stamp,
|
||||
TC_PRINT("_start->idle : %u cycles, %u us\n", z_timestamp_idle,
|
||||
idle_us);
|
||||
TC_PRINT("Boot Time Measurement finished\n");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue