--- old/src/share/vm/runtime/safepoint.cpp 2017-05-17 12:59:09.960476248 +0200 +++ new/src/share/vm/runtime/safepoint.cpp 2017-05-17 12:59:09.876476453 +0200 @@ -1108,16 +1108,20 @@ // Helper method to print the header. static void print_header() { - tty->print(" vmop " - "[threads: total initially_running wait_to_block] "); - tty->print("[time: spin block sync cleanup vmop] "); + tty->print("%8s ", ""); + tty->print("%-30s ", + "vmop"); + tty->print("[ %8s %8s %17s %13s ]", + "threads:", "total", "initially_running", "wait_to_block"); + tty->print("[ %5s %7s %7s %7s %7s %7s ] ", + "time:", "spin", "block", "sync", "cleanup", "vmop"); // no page armed status printed out if it is always armed. if (need_to_track_page_armed_status) { - tty->print("page_armed "); + tty->print("%10s ", "page_armed"); } - tty->print_cr("page_trap_count"); + tty->print_cr("%15s", "page_trap_count"); } void SafepointSynchronize::deferred_initialize_stat() { @@ -1249,27 +1253,26 @@ } void SafepointSynchronize::print_statistics() { - SafepointStats* sstats = _safepoint_stats; - for (int index = 0; index <= _cur_stat_index; index++) { if (index % 30 == 0) { print_header(); } - sstats = &_safepoint_stats[index]; - tty->print("%.3f: ", sstats->_time_stamp); - tty->print("%-26s [" - INT32_FORMAT_W(8) INT32_FORMAT_W(11) INT32_FORMAT_W(15) - " ] ", - sstats->_vmop_type == -1 ? "no vm operation" : - VM_Operation::name(sstats->_vmop_type), + SafepointStats* sstats = &_safepoint_stats[index]; + tty->print("%8.3f: ", sstats->_time_stamp); + tty->print("%-30s [%8s " + INT32_FORMAT_W(8) " " INT32_FORMAT_W(17) " " INT32_FORMAT_W(13) " " + "]", + (sstats->_vmop_type == -1 ? "no vm operation" : VM_Operation::name(sstats->_vmop_type)), + "", sstats->_nof_total_threads, sstats->_nof_initial_running_threads, sstats->_nof_threads_wait_to_block); // "/ MICROUNITS " is to convert the unit from nanos to millis. - tty->print(" [" - INT64_FORMAT_W(6) INT64_FORMAT_W(6) - INT64_FORMAT_W(6) INT64_FORMAT_W(6) - INT64_FORMAT_W(6) " ] ", + tty->print("[ %5s " + INT64_FORMAT_W(7) " " INT64_FORMAT_W(7) " " + INT64_FORMAT_W(7) " " INT64_FORMAT_W(7) " " + INT64_FORMAT_W(7) " ] ", + "", sstats->_time_to_spin / MICROUNITS, sstats->_time_to_wait_to_block / MICROUNITS, sstats->_time_to_sync / MICROUNITS, @@ -1277,9 +1280,9 @@ sstats->_time_to_exec_vmop / MICROUNITS); if (need_to_track_page_armed_status) { - tty->print(INT32_FORMAT " ", sstats->_page_armed); + tty->print(INT32_FORMAT_W(10) " ", sstats->_page_armed); } - tty->print_cr(INT32_FORMAT " ", sstats->_nof_threads_hit_page_trap); + tty->print_cr(INT32_FORMAT_W(15) " ", sstats->_nof_threads_hit_page_trap); } }