hotspot/src/share/vm/runtime/safepoint.cpp
changeset 33222 e0a340f4ab6e
parent 33148 68fa8b6c4340
child 33589 7cbd1b2c139b
equal deleted inserted replaced
33219:08f642d9214f 33222:e0a340f4ab6e
   336     jlong current_time = os::javaTimeNanos();
   336     jlong current_time = os::javaTimeNanos();
   337     if (safepoint_limit_time < current_time) {
   337     if (safepoint_limit_time < current_time) {
   338       tty->print_cr("# SafepointSynchronize: Finished after "
   338       tty->print_cr("# SafepointSynchronize: Finished after "
   339                     INT64_FORMAT_W(6) " ms",
   339                     INT64_FORMAT_W(6) " ms",
   340                     ((current_time - safepoint_limit_time) / MICROUNITS +
   340                     ((current_time - safepoint_limit_time) / MICROUNITS +
   341                      SafepointTimeoutDelay));
   341                      (jlong)SafepointTimeoutDelay));
   342     }
   342     }
   343   }
   343   }
   344 #endif
   344 #endif
   345 
   345 
   346   assert((_safepoint_counter & 0x1) == 0, "must be even");
   346   assert((_safepoint_counter & 0x1) == 0, "must be even");
  1048 }
  1048 }
  1049 
  1049 
  1050 void SafepointSynchronize::deferred_initialize_stat() {
  1050 void SafepointSynchronize::deferred_initialize_stat() {
  1051   if (init_done) return;
  1051   if (init_done) return;
  1052 
  1052 
  1053   if (PrintSafepointStatisticsCount <= 0) {
       
  1054     fatal("Wrong PrintSafepointStatisticsCount");
       
  1055   }
       
  1056 
       
  1057   // If PrintSafepointStatisticsTimeout is specified, the statistics data will
  1053   // If PrintSafepointStatisticsTimeout is specified, the statistics data will
  1058   // be printed right away, in which case, _safepoint_stats will regress to
  1054   // be printed right away, in which case, _safepoint_stats will regress to
  1059   // a single element array. Otherwise, it is a circular ring buffer with default
  1055   // a single element array. Otherwise, it is a circular ring buffer with default
  1060   // size of PrintSafepointStatisticsCount.
  1056   // size of PrintSafepointStatisticsCount.
  1061   int stats_array_size;
  1057   int stats_array_size;
  1162   }
  1158   }
  1163   // Only the sync time longer than the specified
  1159   // Only the sync time longer than the specified
  1164   // PrintSafepointStatisticsTimeout will be printed out right away.
  1160   // PrintSafepointStatisticsTimeout will be printed out right away.
  1165   // By default, it is -1 meaning all samples will be put into the list.
  1161   // By default, it is -1 meaning all samples will be put into the list.
  1166   if ( PrintSafepointStatisticsTimeout > 0) {
  1162   if ( PrintSafepointStatisticsTimeout > 0) {
  1167     if (spstat->_time_to_sync > PrintSafepointStatisticsTimeout * MICROUNITS) {
  1163     if (spstat->_time_to_sync > (jlong)PrintSafepointStatisticsTimeout * MICROUNITS) {
  1168       print_statistics();
  1164       print_statistics();
  1169     }
  1165     }
  1170   } else {
  1166   } else {
  1171     // The safepoint statistics will be printed out when the _safepoin_stats
  1167     // The safepoint statistics will be printed out when the _safepoin_stats
  1172     // array fills up.
  1168     // array fills up.
  1228   // Approximate the vm op time.
  1224   // Approximate the vm op time.
  1229   _safepoint_stats[_cur_stat_index]._time_to_exec_vmop =
  1225   _safepoint_stats[_cur_stat_index]._time_to_exec_vmop =
  1230     os::javaTimeNanos() - cleanup_end_time;
  1226     os::javaTimeNanos() - cleanup_end_time;
  1231 
  1227 
  1232   if ( PrintSafepointStatisticsTimeout < 0 ||
  1228   if ( PrintSafepointStatisticsTimeout < 0 ||
  1233        spstat->_time_to_sync > PrintSafepointStatisticsTimeout * MICROUNITS) {
  1229        spstat->_time_to_sync > (jlong)PrintSafepointStatisticsTimeout * MICROUNITS) {
  1234     print_statistics();
  1230     print_statistics();
  1235   }
  1231   }
  1236   tty->cr();
  1232   tty->cr();
  1237 
  1233 
  1238   // Print out polling page sampling status.
  1234   // Print out polling page sampling status.