< prev index next >
src/share/vm/runtime/safepoint.cpp
Print this page
@@ -1106,20 +1106,24 @@
static bool need_to_track_page_armed_status = false;
static bool init_done = false;
// 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() {
if (init_done) return;
@@ -1247,41 +1251,40 @@
}
}
}
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,
sstats->_time_to_do_cleanups / MICROUNITS,
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);
}
}
// This method will be called when VM exits. It will first call
// print_statistics to print out the rest of the sampling. Then
< prev index next >