@@ -42,17 +42,17 @@ extern "C" {
42
42
* struct mbed_stats_heap_t definition
43
43
*/
44
44
typedef struct {
45
- uint32_t current_size ; /**< Bytes allocated currently. */
46
- uint32_t max_size ; /**< Max bytes allocated at a given time. */
47
- uint32_t total_size ; /**< Cumulative sum of bytes ever allocated. */
48
- uint32_t reserved_size ; /**< Current number of bytes allocated for the heap. */
49
- uint32_t alloc_cnt ; /**< Current number of allocations. */
50
- uint32_t alloc_fail_cnt ; /**< Number of failed allocations. */
51
- uint32_t overhead_size ; /**< Overhead added to heap for stats. */
45
+ uint32_t current_size ; /**< Bytes currently allocated on the heap */
46
+ uint32_t max_size ; /**< Maximum bytes allocated on the heap at one time since reset */
47
+ uint32_t total_size ; /**< Cumulative sum of bytes allocated on the heap that have not been freed */
48
+ uint32_t reserved_size ; /**< Current number of bytes reserved for the heap */
49
+ uint32_t alloc_cnt ; /**< Current number of allocations that have not been freed since reset */
50
+ uint32_t alloc_fail_cnt ; /**< Number of failed allocations since reset */
51
+ uint32_t overhead_size ; /**< Number of bytes used to store heap statistics. This overhead takes up space on the heap, reducing the available heap space */
52
52
} mbed_stats_heap_t ;
53
53
54
54
/**
55
- * Fill the passed in heap stat structure with heap stats .
55
+ * Fill the passed in heap stat structure with the heap statistics .
56
56
*
57
57
* @param stats A pointer to the mbed_stats_heap_t structure to fill
58
58
*/
@@ -62,38 +62,39 @@ void mbed_stats_heap_get(mbed_stats_heap_t *stats);
62
62
* struct mbed_stats_stack_t definition
63
63
*/
64
64
typedef struct {
65
- uint32_t thread_id ; /**< Identifier for thread that owns the stack or 0 if multiple threads. */
66
- uint32_t max_size ; /**< Maximum number of bytes used on the stack. */
67
- uint32_t reserved_size ; /**< Current number of bytes allocated for the stack. */
68
- uint32_t stack_cnt ; /**< Number of stacks stats accumulated in the structure. */
65
+ uint32_t thread_id ; /**< Identifier for the thread that owns the stack or 0 if representing accumulated statistics */
66
+ uint32_t max_size ; /**< Maximum number of bytes used on the stack since the thread was started */
67
+ uint32_t reserved_size ; /**< Current number of bytes reserved for the stack */
68
+ uint32_t stack_cnt ; /**< The number of stacks represented in the accumulated statistics or 1 if repesenting a single stack */
69
69
} mbed_stats_stack_t ;
70
70
71
71
/**
72
- * Fill the passed in structure with stack stats accumulated for all threads. The thread_id will be 0
72
+ * Fill the passed in structure with stack statistics accumulated for all threads. The thread_id will be 0
73
73
* and stack_cnt will represent number of threads.
74
74
*
75
75
* @param stats A pointer to the mbed_stats_stack_t structure to fill
76
76
*/
77
77
void mbed_stats_stack_get (mbed_stats_stack_t * stats );
78
78
79
79
/**
80
- * Fill the passed array of stat structures with the stack stats for each available thread.
80
+ * Fill the passed array of structures with the stack statistics for each available thread.
81
81
*
82
82
* @param stats A pointer to an array of mbed_stats_stack_t structures to fill
83
83
* @param count The number of mbed_stats_stack_t structures in the provided array
84
- * @return The number of mbed_stats_stack_t structures that have been filled,
85
- * this is equal to the number of stacks on the system.
84
+ * @return The number of mbed_stats_stack_t structures that have been filled.
85
+ * If the number of stacks on the system is less than or equal to count, it will equal the number of stacks on the system.
86
+ * If the number of stacks on the system is greater than count, it will equal count.
86
87
*/
87
88
size_t mbed_stats_stack_get_each (mbed_stats_stack_t * stats , size_t count );
88
89
89
90
/**
90
91
* struct mbed_stats_cpu_t definition
91
92
*/
92
93
typedef struct {
93
- us_timestamp_t uptime ; /**< Time since system is up and running */
94
- us_timestamp_t idle_time ; /**< Time spent in idle thread since system is up and running */
95
- us_timestamp_t sleep_time ; /**< Time spent in sleep since system is up and running */
96
- us_timestamp_t deep_sleep_time ; /**< Time spent in deep sleep since system is up and running */
94
+ us_timestamp_t uptime ; /**< Time since the system has started */
95
+ us_timestamp_t idle_time ; /**< Time spent in the idle thread since the system has started */
96
+ us_timestamp_t sleep_time ; /**< Time spent in sleep since the system has started */
97
+ us_timestamp_t deep_sleep_time ; /**< Time spent in deep sleep since the system has started */
97
98
} mbed_stats_cpu_t ;
98
99
99
100
/**
@@ -107,21 +108,22 @@ void mbed_stats_cpu_get(mbed_stats_cpu_t *stats);
107
108
* struct mbed_stats_thread_t definition
108
109
*/
109
110
typedef struct {
110
- uint32_t id ; /**< Thread Object Identifier */
111
- uint32_t state ; /**< Thread Object State */
112
- uint32_t priority ; /**< Thread Priority */
113
- uint32_t stack_size ; /**< Thread Stack Size */
114
- uint32_t stack_space ; /**< Thread remaining stack size */
115
- const char * name ; /**< Thread Object name */
111
+ uint32_t id ; /**< ID of the thread */
112
+ uint32_t state ; /**< State of the thread */
113
+ uint32_t priority ; /**< Priority of the thread (higher number indicates higher priority) */
114
+ uint32_t stack_size ; /**< Current number of bytes reserved for the stack */
115
+ uint32_t stack_space ; /**< Current number of free bytes remaining on the stack */
116
+ const char * name ; /**< Name of the thread */
116
117
} mbed_stats_thread_t ;
117
118
118
119
/**
119
- * Fill the passed array of stat structures with the thread stats for each available thread.
120
+ * Fill the passed array of stat structures with the thread statistics for each available thread.
120
121
*
121
122
* @param stats A pointer to an array of mbed_stats_thread_t structures to fill
122
123
* @param count The number of mbed_stats_thread_t structures in the provided array
123
- * @return The number of mbed_stats_thread_t structures that have been filled,
124
- * this is equal to the number of threads on the system.
124
+ * @return The number of mbed_stats_thread_t structures that have been filled.
125
+ * If the number of threads on the system is less than or equal to count, it will equal the number of threads on the system.
126
+ * If the number of threads on the system is greater than count, it will equal count.
125
127
*/
126
128
size_t mbed_stats_thread_get_each (mbed_stats_thread_t * stats , size_t count );
127
129
@@ -138,14 +140,14 @@ typedef enum {
138
140
* struct mbed_stats_sys_t definition
139
141
*/
140
142
typedef struct {
141
- uint32_t os_version ; /**< Mbed OS Version (Release only) */
142
- uint32_t cpu_id ; /**< CPUID Register data (Cortex-M only supported) */
143
+ uint32_t os_version ; /**< Mbed OS version (populated only for tagged releases ) */
144
+ uint32_t cpu_id ; /**< CPUID register data (Cortex-M only supported) */
143
145
mbed_compiler_id_t compiler_id ; /**< Compiler ID \ref mbed_compiler_id_t */
144
146
uint32_t compiler_version ; /**< Compiler version */
145
147
} mbed_stats_sys_t ;
146
148
147
149
/**
148
- * Fill the passed in sys stat structure with system stats .
150
+ * Fill the passed in system stat structure with system statistics .
149
151
*
150
152
* @param stats A pointer to the mbed_stats_sys_t structure to fill
151
153
*/
0 commit comments