Ejemplo n.º 1
0
void print_statistics() {

#ifdef ASSERT

  if (CountRuntimeCalls) {
    extern Histogram *RuntimeHistogram;
    RuntimeHistogram->print();
  }

  if (CountJNICalls) {
    extern Histogram *JNIHistogram;
    JNIHistogram->print();
  }

  if (CountJVMCalls) {
    extern Histogram *JVMHistogram;
    JVMHistogram->print();
  }

#endif

  if (MemProfiling) {
    MemProfiler::disengage();
  }

  if (CITime) {
    CompileBroker::print_times();
  }

#ifdef COMPILER1
  if ((PrintC1Statistics || LogVMOutput || LogCompilation) && UseCompiler) {
    FlagSetting fs(DisplayVMOutput, DisplayVMOutput && PrintC1Statistics);
    Runtime1::print_statistics();
    Deoptimization::print_statistics();
    nmethod::print_statistics();
  }
#endif /* COMPILER1 */

#ifdef COMPILER2
  if ((PrintOptoStatistics || LogVMOutput || LogCompilation) && UseCompiler) {
    FlagSetting fs(DisplayVMOutput, DisplayVMOutput && PrintOptoStatistics);
    Compile::print_statistics();
#ifndef COMPILER1
    Deoptimization::print_statistics();
    nmethod::print_statistics();
#endif //COMPILER1
    SharedRuntime::print_statistics();
    os::print_statistics();
  }

  if (PrintLockStatistics || PrintPreciseBiasedLockingStatistics) {
    OptoRuntime::print_named_counters();
  }

  if (TimeLivenessAnalysis) {
    MethodLiveness::print_times();
  }
#ifdef ASSERT
  if (CollectIndexSetStatistics) {
    IndexSet::print_statistics();
  }
#endif // ASSERT
#endif // COMPILER2
  if (CountCompiledCalls) {
    print_method_invocation_histogram();
  }
  if (ProfileInterpreter || Tier1UpdateMethodData) {
    print_method_profiling_data();
  }
  if (TimeCompiler) {
    COMPILER2_PRESENT(Compile::print_timers();)
  }
  if (TimeCompilationPolicy) {
    CompilationPolicy::policy()->print_time();
  }
  if (TimeOopMap) {
    GenerateOopMap::print_time();
  }
  if (ProfilerCheckIntervals) {
    PeriodicTask::print_intervals();
  }
  if (PrintSymbolTableSizeHistogram) {
    SymbolTable::print_histogram();
  }
  if (CountBytecodes || TraceBytecodes || StopInterpreterAt) {
    BytecodeCounter::print();
  }
  if (PrintBytecodePairHistogram) {
    BytecodePairHistogram::print();
  }

  if (PrintCodeCache) {
    MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
    CodeCache::print();
  }

  if (PrintCodeCache2) {
    MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
    CodeCache::print_internals();
  }

  if (PrintClassStatistics) {
    SystemDictionary::print_class_statistics();
  }
  if (PrintMethodStatistics) {
    SystemDictionary::print_method_statistics();
  }

  if (PrintVtableStats) {
    klassVtable::print_statistics();
    klassItable::print_statistics();
  }
  if (VerifyOops) {
    tty->print_cr("+VerifyOops count: %d", StubRoutines::verify_oop_count());
  }

  print_bytecode_count();
  if (WizardMode) {
    tty->print("allocation stats: ");
    alloc_stats.print();
    tty->cr();
  }

  if (PrintSystemDictionaryAtExit) {
    SystemDictionary::print();
  }

  if (PrintBiasedLockingStatistics) {
    BiasedLocking::print_counters();
  }

#ifdef ENABLE_ZAP_DEAD_LOCALS
#ifdef COMPILER2
  if (ZapDeadCompiledLocals) {
    tty->print_cr("Compile::CompiledZap_count = %d", Compile::CompiledZap_count);
    tty->print_cr("OptoRuntime::ZapDeadCompiledLocals_count = %d", OptoRuntime::ZapDeadCompiledLocals_count);
  }
#endif // COMPILER2
#endif // ENABLE_ZAP_DEAD_LOCALS
}
Ejemplo n.º 2
0
void print_statistics() {
  
#ifdef ASSERT

  if (CountJNICalls) {
    extern Histogram *JNIHistogram;
JNIHistogram->print(tty);
  }

  if (CountJVMCalls) {
    extern Histogram *JVMHistogram;
JVMHistogram->print(tty);
  }

#endif

  Statistics::stats_print();
  
  if (MemProfiling) {
    MemProfiler::disengage();
  }

  if (CITime) {
CompileBroker::_c1.print_times();
    CompileBroker::_c2.print_times();
  }
  if( PrintStatistics ) {
    SharedRuntime::print_statistics();
CompiledIC::print_statistics();
    Deoptimization::print_statistics();
    if (UseC1) Runtime1::print_statistics();
    if (UseC2) {
Parse::print_statistics();
PhaseCCP::print_statistics();
PhaseRegAlloc::print_statistics();
PhasePeephole::print_statistics();
PhaseIdealLoop::print_statistics();
      if (TimeLivenessAnalysis) MethodLiveness::print_times();
      if (TimeCompiler) Compile::print_timers();
    }
    os::print_statistics();
if(TimeCompilationPolicy)CompilationPolicy::print_time();
#ifndef PRODUCT
    if (LogCompilerOutput) {
      if (UseC1) tty->print_cr("C1 Log Output Size: %ld", Compilation::_c1outputsize);
      if (UseC2) tty->print_cr("C2 Log Output Size: %ld", Compile::_c2outputsize);
    }
#endif
  }
  if (ProfilerCheckIntervals) {
    PeriodicTask::print_intervals();
  }
  if( ProfileMMU ) {
    { 
      MutexLockerAllowGC mu(Threads_lock, JavaThread::current());
      for( JavaThread* X = Threads::first(); X; X = X->next() )
        if( X->mmu() ) X->mmu()->fold_into_global();
    }
    MMU::print(NULL);
  }
  if (PrintSymbolTableSizeHistogram) {
    SymbolTable::print_histogram();
  }
  if (CountBytecodes || TraceBytecodes || StopInterpreterAt) {
    BytecodeCounter::print();
  }  
  if (PrintCodeCache) {
    assert0(Thread::current()->is_Java_thread() && ((JavaThread*)Thread::current())->jvm_locked_by_self());
    CodeCache::print();
    CodeCache::print_internals();
  }

  if (PrintLockContentionAtExit) {
    MutexLocker::print_lock_contention(NULL);
    AzLock::print_lock_hold_times(NULL);
  }

  if (PrintClassStatistics) {
    SystemDictionary::print_class_statistics();
  }
  if (PrintMethodStatistics) {
    SystemDictionary::print_method_statistics();
  }

  print_bytecode_count();

  if (PrintSystemDictionaryAtExit) {
    SystemDictionary::print();
  }

//---------------------------------
/* Turn on for memcpy profiling.  
   See matching code in //azul/main-dev/gnu/newlib-1.11.0/newlib/libc/machine/azul/memcpy.S
  printf("memcpy Size histogram\n");
  jlong total_bytes = 0;
  for( int i=0; i<128; i++ )
    total_bytes += (jlong)i*(jlong)memcpy_size_histogram[i];
  for( int i=7; i<32; i++ )
    total_bytes += (1LL<<i)*(jlong)memcpy_size_histogram[128+i-7];
  jlong invokes = 0;
  for( int i=0; i<sizeof(memcpy_size_histogram)/sizeof(memcpy_size_histogram[0]); i++ )
    invokes += memcpy_size_histogram[i];
  printf("bytes   cnt\n");
  for( int i=0; i<128; i++ )
    print_memcpy_size_histo(i,memcpy_size_histogram[i],total_bytes, invokes);
  for( int i=7; i<32; i++ )
    print_memcpy_size_histo(1L<<i,memcpy_size_histogram[128+(i-7)],total_bytes, invokes);
  printf("\n");
  fflush(stdout);

  printf("memcpy Alignment histogram\n");
  printf("alignment       dst            src|dst          src^dst       src|dst|len\n");
  jlong cum_dst=invokes, cum_src_dst=invokes, cum_src_xor=invokes, cum_src_len=invokes;
  for( int i=0; i<32; i++ ) {
    if( dst_align[i] ||
        src_or_dst_align[i]  ||
        src_xor_dst_align[i]  ||
        src_or_dst_or_len_align[i] ) {
      printf("%8d",1L<<i);
      cum_dst     = print_align(               dst_align[i], cum_dst    , invokes );
      cum_src_dst = print_align(        src_or_dst_align[i], cum_src_dst, invokes );
      cum_src_xor = print_align(       src_xor_dst_align[i], cum_src_xor, invokes );
      cum_src_len = print_align( src_or_dst_or_len_align[i], cum_src_len, invokes );
      printf("\n");
    }
  }
  printf("total word-misaligned bytes moved: %lld  (%5.2f%%)", 
         memcpy_misalign_bytes, (double)memcpy_misalign_bytes/(double)total_bytes);
  printf("\n");
*/
  fflush(stdout);
}