Changeset 2c3c657 in rtems
- Timestamp:
- 11/27/14 12:25:22 (9 years ago)
- Branches:
- 4.11, 5, master
- Children:
- d006b46d
- Parents:
- 01557b0
- git-author:
- Sebastian Huber <sebastian.huber@…> (11/27/14 12:25:22)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (11/28/14 12:09:07)
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libcsupport/src/resource_snapshot.c
r01557b0 r2c3c657 99 99 } 100 100 101 static void get_heap_info(Heap_Control *heap, Heap_Information_block *info) 102 { 103 _Heap_Get_information(heap, info); 104 memset(&info->Stats, 0, sizeof(info->Stats)); 105 } 106 101 107 void rtems_resource_snapshot_take(rtems_resource_snapshot *snapshot) 102 108 { … … 108 114 _Thread_Kill_zombies(); 109 115 110 #ifdef HEAP_PROTECTION 111 _Heap_Protection_free_all_delayed_blocks(RTEMS_Malloc_Heap); 112 _Heap_Protection_free_all_delayed_blocks(&_Workspace_Area); 113 #endif 114 115 _Heap_Get_information(RTEMS_Malloc_Heap, &snapshot->heap_info); 116 _Heap_Get_information(&_Workspace_Area, &snapshot->workspace_info); 116 get_heap_info(RTEMS_Malloc_Heap, &snapshot->heap_info); 117 get_heap_info(&_Workspace_Area, &snapshot->workspace_info); 117 118 118 119 for (i = 0; i < RTEMS_ARRAY_SIZE(objects_info_table); ++i) { -
cpukit/libmisc/shell/internal.h
r01557b0 r2c3c657 33 33 34 34 extern void rtems_shell_print_heap_info( 35 const char *c,36 Heap_Information *h35 const char *c, 36 const Heap_Information *h 37 37 ); 38 38 39 extern void rtems_shell_print_heap_stats( 40 const Heap_Statistics *s 41 ); 39 42 40 43 extern void rtems_shell_print_unified_work_area_message(void); -
cpukit/libmisc/shell/main_mallocinfo.c
r01557b0 r2c3c657 38 38 rtems_shell_print_heap_info( "free", &info.Free ); 39 39 rtems_shell_print_heap_info( "used", &info.Used ); 40 rtems_shell_print_heap_stats( &info.Stats ); 40 41 } 41 42 -
cpukit/libmisc/shell/main_wkspaceinfo.c
r01557b0 r2c3c657 25 25 void rtems_shell_print_unified_work_area_message(void) 26 26 { 27 printf( " \nC Program Heap and RTEMS Workspace are %s.\n",27 printf( "C Program Heap and RTEMS Workspace are %s.\n", 28 28 rtems_configuration_get_unified_work_area() ? "the same" : "separate" 29 29 ); … … 42 42 rtems_shell_print_heap_info( "free", &info.Free ); 43 43 rtems_shell_print_heap_info( "used", &info.Used ); 44 rtems_shell_print_heap_stats( &info.Stats ); 44 45 45 46 return 0; -
cpukit/libmisc/shell/print_heapinfo.c
r01557b0 r2c3c657 15 15 16 16 #include <inttypes.h> 17 #include <stdio.h> 17 18 18 #include <rtems.h>19 #include <rtems/shell.h>20 19 #include "internal.h" 21 20 22 21 void rtems_shell_print_heap_info( 23 const char *c,24 Heap_Information *h22 const char *c, 23 const Heap_Information *h 25 24 ) 26 25 { 27 26 printf( 28 "Number of %s blocks: %" PRId32 "\n"29 "Largest %s block: %" PRId32 "\n"30 "Total bytes %s: %" PRId32 "\n",27 "Number of %s blocks: %12" PRId32 "\n" 28 "Largest %s block: %12" PRId32 "\n" 29 "Total bytes %s: %12" PRId32 "\n", 31 30 c, h->number, 32 31 c, h->largest, … … 34 33 ); 35 34 } 35 36 void rtems_shell_print_heap_stats( 37 const Heap_Statistics *s 38 ) 39 { 40 printf( 41 "Instance number: %12" PRIu32 "\n" 42 "Size of the allocatable area in bytes: %12" PRIuPTR "\n" 43 "Minimum free size ever in bytes: %12" PRIuPTR "\n" 44 "Maximum number of free blocks ever: %12" PRIu32 "\n" 45 "Maximum number of blocks searched ever: %12" PRIu32 "\n" 46 "Total number of successful allocations: %12" PRIu32 "\n" 47 "Total number of searches ever: %12" PRIu32 "\n" 48 "Total number of successful calls to free: %12" PRIu32 "\n" 49 "Total number of successful resizes: %12" PRIu32 "\n", 50 s->instance, 51 s->size, 52 s->min_free_size, 53 s->max_free_blocks, 54 s->max_search, 55 s->allocs, 56 s->searches, 57 s->frees, 58 s->resizes 59 ); 60 } -
cpukit/score/include/rtems/score/heap.h
r01557b0 r2c3c657 314 314 315 315 /** 316 * @brief Total number of suc eessful calls to free.316 * @brief Total number of successful calls to free. 317 317 */ 318 318 uint32_t frees; … … 367 367 Heap_Information Free; 368 368 Heap_Information Used; 369 Heap_Statistics Stats; 369 370 } Heap_Information_block; 370 371 -
cpukit/score/src/heapgetinfo.c
r01557b0 r2c3c657 51 51 _Heap_Protection_free_all_delayed_blocks( the_heap ); 52 52 _Heap_Iterate( the_heap, _Heap_Get_information_visitor, the_info ); 53 the_info->Stats = the_heap->stats; 53 54 } -
doc/shell/memory.t
r01557b0 r2c3c657 547 547 @item Largest used block 548 548 @item Total bytes used 549 @item Instance number 550 @item Size of the allocatable area in bytes 551 @item Minimum free size ever in bytes 552 @item Maximum number of free blocks ever 553 @item Maximum number of blocks searched ever 554 @item Total number of successful allocations 555 @item Total number of searches ever 556 @item Total number of successful calls to free 557 @item Total number of successful resizes 549 558 @end itemize 550 559 … … 566 575 @example 567 576 SHLL [/] $ malloc 568 Number of free blocks: 3 569 Largest free block: 3626672 570 Total bytes free: 3627768 571 Number of used blocks: 130 572 Largest used block: 1048 573 Total bytes used: 10136 577 C Program Heap and RTEMS Workspace are the same. 578 Number of free blocks: 14 579 Largest free block: 266157192 580 Total bytes free: 266164928 581 Number of used blocks: 167 582 Largest used block: 16424 583 Total bytes used: 90888 584 Instance number: 0 585 Size of the allocatable area in bytes: 266255816 586 Minimum free size ever in bytes: 266156136 587 Maximum number of free blocks ever: 15 588 Maximum number of blocks searched ever: 15 589 Total number of successful allocations: 186 590 Total number of searches ever: 186 591 Total number of successful calls to free: 19 592 Total number of successful resizes: 0 574 593 SHLL [/] $ malloc walk 575 594 malloc walk
Note: See TracChangeset
for help on using the changeset viewer.