From d006b46df31f6e5f28237fe40eafb135e684b739 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 28 Nov 2014 11:53:55 +0100 Subject: score: Add heap statistics Add lifetime bytes allocated and freed since they were present in the malloc statistics. Add number of failed allocations. --- cpukit/score/include/rtems/score/heap.h | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'cpukit/score/include/rtems/score/heap.h') diff --git a/cpukit/score/include/rtems/score/heap.h b/cpukit/score/include/rtems/score/heap.h index 6042a13bf2..f20b4e6651 100644 --- a/cpukit/score/include/rtems/score/heap.h +++ b/cpukit/score/include/rtems/score/heap.h @@ -256,6 +256,20 @@ struct Heap_Block { * performed on a single allocation call. */ typedef struct { + /** + * @brief Lifetime number of bytes allocated from this heap. + * + * This value is an integral multiple of the page size. + */ + uint64_t lifetime_allocated; + + /** + * @brief Lifetime number of bytes freed to this heap. + * + * This value is an integral multiple of the page size. + */ + uint64_t lifetime_freed; + /** * @brief Instance number of this heap. */ @@ -302,18 +316,23 @@ typedef struct { */ uint32_t max_search; + /** + * @brief Total number of searches. + */ + uint32_t searches; + /** * @brief Total number of successful allocations. */ uint32_t allocs; /** - * @brief Total number of searches ever. + * @brief Total number of failed allocations. */ - uint32_t searches; + uint32_t failed_allocs; /** - * @brief Total number of successful calls to free. + * @brief Total number of successful frees. */ uint32_t frees; -- cgit v1.2.3