< prev index next >

src/hotspot/share/code/codeCache.cpp

Print this page
rev 50234 : 8204476: Add additional statistics to CodeCache::print_summary


1576           code_size += cb->code_size();
1577           ImmutableOopMapSet* set = cb->oop_maps();
1578           if (set != NULL) {
1579             number_of_oop_maps += set->count();
1580             map_size           += set->nr_of_bytes();
1581           }
1582         }
1583       }
1584     }
1585     tty->print_cr("OopMaps");
1586     tty->print_cr("  #blobs    = %d", number_of_blobs);
1587     tty->print_cr("  code size = %d", code_size);
1588     tty->print_cr("  #oop_maps = %d", number_of_oop_maps);
1589     tty->print_cr("  map size  = %d", map_size);
1590   }
1591 
1592 #endif // !PRODUCT
1593 }
1594 
1595 void CodeCache::print_summary(outputStream* st, bool detailed) {

1596   FOR_ALL_HEAPS(heap_iterator) {
1597     CodeHeap* heap = (*heap_iterator);
1598     size_t total = (heap->high_boundary() - heap->low_boundary());
1599     if (_heaps->length() >= 1) {
1600       st->print("%s:", heap->name());
1601     } else {
1602       st->print("CodeCache:");
1603     }
1604     st->print_cr(" size=" SIZE_FORMAT "Kb used=" SIZE_FORMAT
1605                  "Kb max_used=" SIZE_FORMAT "Kb free=" SIZE_FORMAT "Kb",
1606                  total/K, (total - heap->unallocated_capacity())/K,
1607                  heap->max_allocated_capacity()/K, heap->unallocated_capacity()/K);
1608 
1609     if (detailed) {
1610       st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]",
1611                    p2i(heap->low_boundary()),
1612                    p2i(heap->high()),
1613                    p2i(heap->high_boundary()));


1614     }
1615   }
1616 
1617   if (detailed) {
1618     st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT
1619                        " adapters=" UINT32_FORMAT,
1620                        blob_count(), nmethod_count(), adapter_count());
1621     st->print_cr(" compilation: %s", CompileBroker::should_compile_new_jobs() ?
1622                  "enabled" : Arguments::mode() == Arguments::_int ?
1623                  "disabled (interpreter mode)" :
1624                  "disabled (not enough contiguous free space left)");




1625   }
1626 }
1627 
1628 void CodeCache::print_codelist(outputStream* st) {
1629   MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
1630 
1631   CompiledMethodIterator iter;
1632   while (iter.next_alive()) {
1633     CompiledMethod* cm = iter.method();
1634     ResourceMark rm;
1635     char* method_name = cm->method()->name_and_sig_as_C_string();
1636     st->print_cr("%d %d %d %s [" INTPTR_FORMAT ", " INTPTR_FORMAT " - " INTPTR_FORMAT "]",
1637                  cm->compile_id(), cm->comp_level(), cm->get_state(),
1638                  method_name,
1639                  (intptr_t)cm->header_begin(), (intptr_t)cm->code_begin(), (intptr_t)cm->code_end());
1640   }
1641 }
1642 
1643 void CodeCache::print_layout(outputStream* st) {
1644   MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);




1576           code_size += cb->code_size();
1577           ImmutableOopMapSet* set = cb->oop_maps();
1578           if (set != NULL) {
1579             number_of_oop_maps += set->count();
1580             map_size           += set->nr_of_bytes();
1581           }
1582         }
1583       }
1584     }
1585     tty->print_cr("OopMaps");
1586     tty->print_cr("  #blobs    = %d", number_of_blobs);
1587     tty->print_cr("  code size = %d", code_size);
1588     tty->print_cr("  #oop_maps = %d", number_of_oop_maps);
1589     tty->print_cr("  map size  = %d", map_size);
1590   }
1591 
1592 #endif // !PRODUCT
1593 }
1594 
1595 void CodeCache::print_summary(outputStream* st, bool detailed) {
1596   int full_count = 0;
1597   FOR_ALL_HEAPS(heap_iterator) {
1598     CodeHeap* heap = (*heap_iterator);
1599     size_t total = (heap->high_boundary() - heap->low_boundary());
1600     if (_heaps->length() >= 1) {
1601       st->print("%s:", heap->name());
1602     } else {
1603       st->print("CodeCache:");
1604     }
1605     st->print_cr(" size=" SIZE_FORMAT "Kb used=" SIZE_FORMAT
1606                  "Kb max_used=" SIZE_FORMAT "Kb free=" SIZE_FORMAT "Kb",
1607                  total/K, (total - heap->unallocated_capacity())/K,
1608                  heap->max_allocated_capacity()/K, heap->unallocated_capacity()/K);
1609 
1610     if (detailed) {
1611       st->print_cr(" bounds [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT "]",
1612                    p2i(heap->low_boundary()),
1613                    p2i(heap->high()),
1614                    p2i(heap->high_boundary()));
1615 
1616       full_count += get_codemem_full_count(heap->code_blob_type());
1617     }
1618   }
1619 
1620   if (detailed) {
1621     st->print_cr(" total_blobs=" UINT32_FORMAT " nmethods=" UINT32_FORMAT
1622                        " adapters=" UINT32_FORMAT,
1623                        blob_count(), nmethod_count(), adapter_count());
1624     st->print_cr(" compilation: %s", CompileBroker::should_compile_new_jobs() ?
1625                  "enabled" : Arguments::mode() == Arguments::_int ?
1626                  "disabled (interpreter mode)" :
1627                  "disabled (not enough contiguous free space left)");
1628     st->print_cr("              stopped_count=%d, restarted_count=%d",
1629                  CompileBroker::get_total_compiler_stopped_count(),
1630                  CompileBroker::get_total_compiler_restarted_count());
1631     st->print_cr(" full_count=%d", full_count);
1632   }
1633 }
1634 
1635 void CodeCache::print_codelist(outputStream* st) {
1636   MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
1637 
1638   CompiledMethodIterator iter;
1639   while (iter.next_alive()) {
1640     CompiledMethod* cm = iter.method();
1641     ResourceMark rm;
1642     char* method_name = cm->method()->name_and_sig_as_C_string();
1643     st->print_cr("%d %d %d %s [" INTPTR_FORMAT ", " INTPTR_FORMAT " - " INTPTR_FORMAT "]",
1644                  cm->compile_id(), cm->comp_level(), cm->get_state(),
1645                  method_name,
1646                  (intptr_t)cm->header_begin(), (intptr_t)cm->code_begin(), (intptr_t)cm->code_end());
1647   }
1648 }
1649 
1650 void CodeCache::print_layout(outputStream* st) {
1651   MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);


< prev index next >