summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-11-27 13:25:22 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-11-28 13:09:07 +0100
commit2c3c657625f5129e3062058a2c83f0020fd6bab5 (patch)
tree1b6b2a5b125d4dffc1268768bc067f021c35a412 /cpukit/libcsupport
parentlibcsupport: Delete malloc statistics (diff)
downloadrtems-2c3c657625f5129e3062058a2c83f0020fd6bab5.tar.bz2
score: Return heap stats via _Heap_Get_information
Print out heap statistics via the MALLOC and WKSPACE shell commands.
Diffstat (limited to 'cpukit/libcsupport')
-rw-r--r--cpukit/libcsupport/src/resource_snapshot.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/cpukit/libcsupport/src/resource_snapshot.c b/cpukit/libcsupport/src/resource_snapshot.c
index 6f5038de31..6e4c4ca86f 100644
--- a/cpukit/libcsupport/src/resource_snapshot.c
+++ b/cpukit/libcsupport/src/resource_snapshot.c
@@ -98,6 +98,12 @@ static int open_files(void)
return (int) rtems_libio_number_iops - free_count;
}
+static void get_heap_info(Heap_Control *heap, Heap_Information_block *info)
+{
+ _Heap_Get_information(heap, info);
+ memset(&info->Stats, 0, sizeof(info->Stats));
+}
+
void rtems_resource_snapshot_take(rtems_resource_snapshot *snapshot)
{
uint32_t *active = &snapshot->rtems_api.active_barriers;
@@ -107,13 +113,8 @@ void rtems_resource_snapshot_take(rtems_resource_snapshot *snapshot)
_Thread_Kill_zombies();
- #ifdef HEAP_PROTECTION
- _Heap_Protection_free_all_delayed_blocks(RTEMS_Malloc_Heap);
- _Heap_Protection_free_all_delayed_blocks(&_Workspace_Area);
- #endif
-
- _Heap_Get_information(RTEMS_Malloc_Heap, &snapshot->heap_info);
- _Heap_Get_information(&_Workspace_Area, &snapshot->workspace_info);
+ get_heap_info(RTEMS_Malloc_Heap, &snapshot->heap_info);
+ get_heap_info(&_Workspace_Area, &snapshot->workspace_info);
for (i = 0; i < RTEMS_ARRAY_SIZE(objects_info_table); ++i) {
active [i] = _Objects_Active_count(objects_info_table[i]);