mirror of https://github.com/ARMmbed/mbed-os.git
Add CPU stats for greentea tests
parent
443e37b00c
commit
35c9ddc356
|
|
@ -39,6 +39,10 @@ static char buf[128];
|
|||
static SingletonPtr<CircularBuffer<thread_info_t, THREAD_BUF_COUNT> > queue;
|
||||
#endif
|
||||
|
||||
#if defined(MBED_CPU_STATS_ENABLED)
|
||||
static void send_CPU_info(void);
|
||||
#endif
|
||||
|
||||
static void send_heap_info(void);
|
||||
#if defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED
|
||||
static void send_stack_info(void);
|
||||
|
|
@ -65,8 +69,24 @@ void greentea_metrics_report()
|
|||
send_stack_info();
|
||||
Thread::attach_terminate_hook(NULL);
|
||||
#endif
|
||||
#if defined(MBED_CPU_STATS_ENABLED)
|
||||
send_CPU_info();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(MBED_CPU_STATS_ENABLED)
|
||||
static void send_CPU_info()
|
||||
{
|
||||
mbed_stats_cpu_t stats;
|
||||
mbed_stats_cpu_get(&stats);
|
||||
|
||||
greentea_send_kv("__cpu_info up time", stats.uptime);
|
||||
greentea_send_kv("__cpu_info sleep time", stats.sleep_time);
|
||||
greentea_send_kv("__cpu_info deepsleep time", stats.deep_sleep_time);
|
||||
greentea_send_kv("__cpu_info % sleep/deep", (stats.sleep_time * 100) / stats.uptime, (stats.deep_sleep_time * 100) / stats.uptime);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void send_heap_info()
|
||||
{
|
||||
mbed_stats_heap_t heap_stats;
|
||||
|
|
|
|||
Loading…
Reference in New Issue