Changeset 59adc2b in mainline
- Timestamp:
- 2006-01-08T15:18:33Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 677a6d5
- Parents:
- 1a67595
- Location:
- generic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/include/mm/buddy.h
r1a67595 r59adc2b 56 56 extern bool buddy_system_can_alloc(buddy_system_t *b, __u8 order); 57 57 extern void buddy_system_free(buddy_system_t *b, link_t *block); 58 extern void buddy_system_structure_print(buddy_system_t *b );58 extern void buddy_system_structure_print(buddy_system_t *b, size_t elem_size); 59 59 60 60 -
generic/src/mm/buddy.c
r1a67595 r59adc2b 239 239 * @param es Element size 240 240 */ 241 void buddy_system_structure_print(buddy_system_t *b ) {241 void buddy_system_structure_print(buddy_system_t *b, size_t elem_size) { 242 242 index_t i; 243 243 count_t cnt, elem_count = 0, block_count = 0; … … 245 245 246 246 247 printf("Order\t Statistics\n");248 printf("-----\t------ --------------------------------\n");247 printf("Order\tBlocks\tSize \tBlock size\tElems per block\n"); 248 printf("-----\t------\t--------\t----------\t---------------\n"); 249 249 250 250 for (i=0;i < b->max_order; i++) { … … 254 254 } 255 255 256 printf("#%d :\t%d blocks available (%d elements per block)\n", i, cnt, 1 << i);256 printf("#%d\t%d\t%d kb\t\t%d kb\t\t%d\n", i, cnt, (cnt * (1 << i) * elem_size) >> 10, ((1 << i) * elem_size) >> 10, 1 << i); 257 257 258 258 block_count += cnt; 259 259 elem_count += (1 << i) * cnt; 260 260 } 261 printf("-----\t------ --------------------------------\n");261 printf("-----\t------\t--------\t----------\t---------------\n"); 262 262 printf("Buddy system contains %d elements (%d blocks)\n" , elem_count, block_count); 263 263 -
generic/src/mm/frame.c
r1a67595 r59adc2b 490 490 zone_t *zone = NULL; 491 491 link_t *cur; 492 index_t i = 0;493 492 spinlock_lock(&zone_head_lock); 494 printf(" No.\tBase address\tFree Frames\tBusy Frames\n");495 printf("--- \t------------\t-----------\t-----------\n");493 printf("Base address\tFree Frames\tBusy Frames\n"); 494 printf("------------\t-----------\t-----------\n"); 496 495 for (cur = zone_head.next; cur != &zone_head; cur = cur->next) { 497 496 zone = list_get_instance(cur, zone_t, link); 498 497 spinlock_lock(&zone->lock); 499 printf("% d\t%L\t%d\t\t%d\n",i++,zone->base, zone->free_count, zone->busy_count);498 printf("%L\t%d\t\t%d\n",zone->base, zone->free_count, zone->busy_count); 500 499 } 501 500 spinlock_unlock(&zone_head_lock); … … 537 536 538 537 printf("\nBuddy allocator structures:\n\n"); 539 buddy_system_structure_print(zone->buddy_system); 540 538 buddy_system_structure_print(zone->buddy_system, FRAME_SIZE); 541 539 542 540 spinlock_unlock(&zone->lock);
Note:
See TracChangeset
for help on using the changeset viewer.