804 ResourceMark rm; 805 stringStream s; 806 // Dump code cache state into a buffer before locking the tty, 807 // because log_state() will use locks causing lock conflicts. 808 CodeCache::log_state(&s); 809 810 ttyLocker ttyl; 811 xtty->begin_elem("sweeper state='%s' traversals='" INTX_FORMAT "' ", msg, (intx)traversal_count()); 812 if (format != NULL) { 813 va_list ap; 814 va_start(ap, format); 815 xtty->vprint(format, ap); 816 va_end(ap); 817 } 818 xtty->print("%s", s.as_string()); 819 xtty->stamp(); 820 xtty->end_elem(); 821 } 822 } 823 824 void NMethodSweeper::print() { 825 ttyLocker ttyl; 826 tty->print_cr("Code cache sweeper statistics:"); 827 tty->print_cr(" Total sweep time: %1.0lfms", (double)_total_time_sweeping.value()/1000000); 828 tty->print_cr(" Total number of full sweeps: %ld", _total_nof_code_cache_sweeps); 829 tty->print_cr(" Total number of flushed methods: %ld(%ld C2 methods)", _total_nof_methods_reclaimed, 830 _total_nof_c2_methods_reclaimed); 831 tty->print_cr(" Total size of flushed methods: " SIZE_FORMAT "kB", _total_flushed_size/K); 832 } | 804 ResourceMark rm; 805 stringStream s; 806 // Dump code cache state into a buffer before locking the tty, 807 // because log_state() will use locks causing lock conflicts. 808 CodeCache::log_state(&s); 809 810 ttyLocker ttyl; 811 xtty->begin_elem("sweeper state='%s' traversals='" INTX_FORMAT "' ", msg, (intx)traversal_count()); 812 if (format != NULL) { 813 va_list ap; 814 va_start(ap, format); 815 xtty->vprint(format, ap); 816 va_end(ap); 817 } 818 xtty->print("%s", s.as_string()); 819 xtty->stamp(); 820 xtty->end_elem(); 821 } 822 } 823 824 void NMethodSweeper::print(outputStream *st) { 825 ttyLocker ttyl; 826 st->print_cr("Code cache sweeper statistics:"); 827 st->print_cr(" Total sweep time: %1.0lfms", (double)_total_time_sweeping.value()/1000000); 828 st->print_cr(" Total number of full sweeps: %ld", _total_nof_code_cache_sweeps); 829 st->print_cr(" Total number of flushed methods: %ld(%ld C2 methods)", _total_nof_methods_reclaimed, 830 _total_nof_c2_methods_reclaimed); 831 st->print_cr(" Total size of flushed methods: " SIZE_FORMAT "kB", _total_flushed_size/K); 832 } |