123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- #ifndef MBED_STATS_H
- #define MBED_STATS_H
- #include <stdint.h>
- #include <stddef.h>
- #include "hal/ticker_api.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- #ifdef MBED_ALL_STATS_ENABLED
- #define MBED_SYS_STATS_ENABLED 1
- #define MBED_STACK_STATS_ENABLED 1
- #define MBED_CPU_STATS_ENABLED 1
- #define MBED_HEAP_STATS_ENABLED 1
- #define MBED_THREAD_STATS_ENABLED 1
- #endif
- typedef struct {
- uint32_t current_size;
- uint32_t max_size;
- uint32_t total_size;
- uint32_t reserved_size;
- uint32_t alloc_cnt;
- uint32_t alloc_fail_cnt;
- } mbed_stats_heap_t;
- void mbed_stats_heap_get(mbed_stats_heap_t *stats);
- typedef struct {
- uint32_t thread_id;
- uint32_t max_size;
- uint32_t reserved_size;
- uint32_t stack_cnt;
- } mbed_stats_stack_t;
- void mbed_stats_stack_get(mbed_stats_stack_t *stats);
- size_t mbed_stats_stack_get_each(mbed_stats_stack_t *stats, size_t count);
- typedef struct {
- us_timestamp_t uptime;
- us_timestamp_t idle_time;
- us_timestamp_t sleep_time;
- us_timestamp_t deep_sleep_time;
- } mbed_stats_cpu_t;
- void mbed_stats_cpu_get(mbed_stats_cpu_t *stats);
- typedef struct {
- uint32_t id;
- uint32_t state;
- uint32_t priority;
- uint32_t stack_size;
- uint32_t stack_space;
- const char *name;
- } mbed_stats_thread_t;
- size_t mbed_stats_thread_get_each(mbed_stats_thread_t *stats, size_t count);
- typedef enum {
- ARM = 1,
- GCC_ARM,
- IAR
- } mbed_compiler_id_t;
- typedef struct {
- uint32_t os_version;
- uint32_t cpu_id;
- mbed_compiler_id_t compiler_id;
- uint32_t compiler_version;
- } mbed_stats_sys_t;
- void mbed_stats_sys_get(mbed_stats_sys_t *stats);
- #ifdef __cplusplus
- }
- #endif
- #endif
|