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:
Andrew Boie 2019-09-21 16:55:55 -07:00 committed by Anas Nashif
commit e6654103ba
5 changed files with 15 additions and 14 deletions

View file

@ -23,11 +23,6 @@
extern "C" { extern "C" {
#endif #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 * @brief Kernel APIs
* @defgroup kernel_apis Kernel APIs * @defgroup kernel_apis Kernel APIs

View file

@ -147,9 +147,9 @@ void idle(void *unused1, void *unused2, void *unused3)
#ifdef CONFIG_BOOT_TIME_MEASUREMENT #ifdef CONFIG_BOOT_TIME_MEASUREMENT
/* record timestamp when idling begins */ /* 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 #endif
while (true) { while (true) {

View file

@ -295,6 +295,11 @@ extern u64_t z_arch_timing_value_swap_common;
extern u64_t z_arch_timing_value_swap_temp; extern u64_t z_arch_timing_value_swap_temp;
#endif /* CONFIG_EXECUTION_BENCHMARKING */ #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 #ifdef __cplusplus
} }
#endif #endif

View file

@ -66,8 +66,8 @@ LOG_MODULE_REGISTER(os);
/* boot time measurement items */ /* boot time measurement items */
#ifdef CONFIG_BOOT_TIME_MEASUREMENT #ifdef CONFIG_BOOT_TIME_MEASUREMENT
u32_t __noinit __main_time_stamp; /* timestamp when main task starts */ u32_t __noinit z_timestamp_main; /* timestamp when main task starts */
u32_t __noinit __idle_time_stamp; /* timestamp when CPU goes idle */ u32_t __noinit z_timestamp_idle; /* timestamp when CPU goes idle */
#endif #endif
/* init/main and idle threads */ /* init/main and idle threads */
@ -283,7 +283,7 @@ static void bg_thread_main(void *unused1, void *unused2, void *unused3)
#endif #endif
#ifdef CONFIG_BOOT_TIME_MEASUREMENT #ifdef CONFIG_BOOT_TIME_MEASUREMENT
__main_time_stamp = k_cycle_get_32(); z_timestamp_main = k_cycle_get_32();
#endif #endif
extern void main(void); extern void main(void);

View file

@ -17,6 +17,7 @@
#include <zephyr.h> #include <zephyr.h>
#include <tc_util.h> #include <tc_util.h>
#include <kernel_internal.h>
void main(void) void main(void)
{ {
@ -34,17 +35,17 @@ void main(void)
int freq = sys_clock_hw_cycles_per_sec() / 1000000; 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; task_us = task_time_stamp / freq;
idle_us = __idle_time_stamp / freq; idle_us = z_timestamp_idle / freq;
TC_START("Boot Time Measurement"); TC_START("Boot Time Measurement");
TC_PRINT("Boot Result: Clock Frequency: %d MHz\n", freq); 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); main_us);
TC_PRINT("_start->task : %u cycles, %u us\n", task_time_stamp, TC_PRINT("_start->task : %u cycles, %u us\n", task_time_stamp,
task_us); 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); idle_us);
TC_PRINT("Boot Time Measurement finished\n"); TC_PRINT("Boot Time Measurement finished\n");