mbed-os for GR-LYCHEE

Dependents:   mbed-os-example-blinky-gr-lychee GR-Boads_Camera_sample GR-Boards_Audio_Recoder GR-Boads_Camera_DisplayApp ... more

Committer:
dkato
Date:
Fri Feb 02 05:42:23 2018 +0000
Revision:
0:f782d9c66c49
mbed-os for GR-LYCHEE

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dkato 0:f782d9c66c49 1
dkato 0:f782d9c66c49 2 /** \addtogroup platform */
dkato 0:f782d9c66c49 3 /** @{*/
dkato 0:f782d9c66c49 4 /* mbed Microcontroller Library
dkato 0:f782d9c66c49 5 * Copyright (c) 2016-2016 ARM Limited
dkato 0:f782d9c66c49 6 *
dkato 0:f782d9c66c49 7 * Licensed under the Apache License, Version 2.0 (the "License");
dkato 0:f782d9c66c49 8 * you may not use this file except in compliance with the License.
dkato 0:f782d9c66c49 9 * You may obtain a copy of the License at
dkato 0:f782d9c66c49 10 *
dkato 0:f782d9c66c49 11 * http://www.apache.org/licenses/LICENSE-2.0
dkato 0:f782d9c66c49 12 *
dkato 0:f782d9c66c49 13 * Unless required by applicable law or agreed to in writing, software
dkato 0:f782d9c66c49 14 * distributed under the License is distributed on an "AS IS" BASIS,
dkato 0:f782d9c66c49 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dkato 0:f782d9c66c49 16 * See the License for the specific language governing permissions and
dkato 0:f782d9c66c49 17 * limitations under the License.
dkato 0:f782d9c66c49 18 */
dkato 0:f782d9c66c49 19 #ifndef MBED_STATS_H
dkato 0:f782d9c66c49 20 #define MBED_STATS_H
dkato 0:f782d9c66c49 21 #include <stdint.h>
dkato 0:f782d9c66c49 22 #include <stddef.h>
dkato 0:f782d9c66c49 23
dkato 0:f782d9c66c49 24 #ifdef __cplusplus
dkato 0:f782d9c66c49 25 extern "C" {
dkato 0:f782d9c66c49 26 #endif
dkato 0:f782d9c66c49 27
dkato 0:f782d9c66c49 28 typedef struct {
dkato 0:f782d9c66c49 29 uint32_t current_size; /**< Bytes allocated currently. */
dkato 0:f782d9c66c49 30 uint32_t max_size; /**< Max bytes allocated at a given time. */
dkato 0:f782d9c66c49 31 uint32_t total_size; /**< Cumulative sum of bytes ever allocated. */
dkato 0:f782d9c66c49 32 uint32_t reserved_size; /**< Current number of bytes allocated for the heap. */
dkato 0:f782d9c66c49 33 uint32_t alloc_cnt; /**< Current number of allocations. */
dkato 0:f782d9c66c49 34 uint32_t alloc_fail_cnt; /**< Number of failed allocations. */
dkato 0:f782d9c66c49 35 } mbed_stats_heap_t;
dkato 0:f782d9c66c49 36
dkato 0:f782d9c66c49 37 /**
dkato 0:f782d9c66c49 38 * Fill the passed in heap stat structure with heap stats.
dkato 0:f782d9c66c49 39 *
dkato 0:f782d9c66c49 40 * @param stats A pointer to the mbed_stats_heap_t structure to fill
dkato 0:f782d9c66c49 41 */
dkato 0:f782d9c66c49 42 void mbed_stats_heap_get(mbed_stats_heap_t *stats);
dkato 0:f782d9c66c49 43
dkato 0:f782d9c66c49 44 typedef struct {
dkato 0:f782d9c66c49 45 uint32_t thread_id; /**< Identifier for thread that owns the stack. */
dkato 0:f782d9c66c49 46 uint32_t max_size; /**< Sum of the maximum number of bytes used in each stack. */
dkato 0:f782d9c66c49 47 uint32_t reserved_size; /**< Current number of bytes allocated for all stacks. */
dkato 0:f782d9c66c49 48 uint32_t stack_cnt; /**< Number of stacks currently allocated. */
dkato 0:f782d9c66c49 49 } mbed_stats_stack_t;
dkato 0:f782d9c66c49 50
dkato 0:f782d9c66c49 51 /**
dkato 0:f782d9c66c49 52 * Fill the passed in structure with stack stats.
dkato 0:f782d9c66c49 53 *
dkato 0:f782d9c66c49 54 * @param stats A pointer to the mbed_stats_stack_t structure to fill
dkato 0:f782d9c66c49 55 */
dkato 0:f782d9c66c49 56 void mbed_stats_stack_get(mbed_stats_stack_t *stats);
dkato 0:f782d9c66c49 57
dkato 0:f782d9c66c49 58 /**
dkato 0:f782d9c66c49 59 * Fill the passed array of stat structures with the stack stats
dkato 0:f782d9c66c49 60 * for each available stack.
dkato 0:f782d9c66c49 61 *
dkato 0:f782d9c66c49 62 * @param stats A pointer to an array of mbed_stats_stack_t structures to fill
dkato 0:f782d9c66c49 63 * @param count The number of mbed_stats_stack_t structures in the provided array
dkato 0:f782d9c66c49 64 * @return The number of mbed_stats_stack_t structures that have been filled,
dkato 0:f782d9c66c49 65 * this is equal to the number of stacks on the system.
dkato 0:f782d9c66c49 66 */
dkato 0:f782d9c66c49 67 size_t mbed_stats_stack_get_each(mbed_stats_stack_t *stats, size_t count);
dkato 0:f782d9c66c49 68
dkato 0:f782d9c66c49 69 #ifdef __cplusplus
dkato 0:f782d9c66c49 70 }
dkato 0:f782d9c66c49 71 #endif
dkato 0:f782d9c66c49 72
dkato 0:f782d9c66c49 73 #endif
dkato 0:f782d9c66c49 74
dkato 0:f782d9c66c49 75 /** @}*/