hotspot/src/share/vm/runtime/safepoint.cpp
changeset 24424 2658d7834c6e
parent 24351 61b33cc6d3cf
child 24429 4efc66ee325c
equal deleted inserted replaced
24358:8528b67f6562 24424:2658d7834c6e
    80 #endif // INCLUDE_ALL_GCS
    80 #endif // INCLUDE_ALL_GCS
    81 #ifdef COMPILER1
    81 #ifdef COMPILER1
    82 #include "c1/c1_globals.hpp"
    82 #include "c1/c1_globals.hpp"
    83 #endif
    83 #endif
    84 
    84 
       
    85 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
       
    86 
    85 // --------------------------------------------------------------------------------------------------
    87 // --------------------------------------------------------------------------------------------------
    86 // Implementation of Safepoint begin/end
    88 // Implementation of Safepoint begin/end
    87 
    89 
    88 SafepointSynchronize::SynchronizeState volatile SafepointSynchronize::_state = SafepointSynchronize::_not_synchronized;
    90 SafepointSynchronize::SynchronizeState volatile SafepointSynchronize::_state = SafepointSynchronize::_not_synchronized;
    89 volatile int  SafepointSynchronize::_waiting_to_block = 0;
    91 volatile int  SafepointSynchronize::_waiting_to_block = 0;
   785   tty->print_cr("--Float-|"PTR_FORMAT,new_sp);
   787   tty->print_cr("--Float-|"PTR_FORMAT,new_sp);
   786   tty->print_cr("---FP---|");
   788   tty->print_cr("---FP---|");
   787   old_sp += incr*32;  new_sp += incr*32;  was_oops += incr*32;
   789   old_sp += incr*32;  new_sp += incr*32;  was_oops += incr*32;
   788   for( int i2=0; i2<16; i2++ ) {
   790   for( int i2=0; i2<16; i2++ ) {
   789     tty->print("call %c%d |"PTR_FORMAT" ","LI"[i2>>3],i2&7,new_sp); print_ptrs(*old_sp++,*new_sp++,*was_oops++); }
   791     tty->print("call %c%d |"PTR_FORMAT" ","LI"[i2>>3],i2&7,new_sp); print_ptrs(*old_sp++,*new_sp++,*was_oops++); }
   790   tty->print_cr("");
   792   tty->cr();
   791 }
   793 }
   792 #endif  // SPARC
   794 #endif  // SPARC
   793 #endif  // PRODUCT
   795 #endif  // PRODUCT
   794 
   796 
   795 
   797 
   827 void SafepointSynchronize::print_safepoint_timeout(SafepointTimeoutReason reason) {
   829 void SafepointSynchronize::print_safepoint_timeout(SafepointTimeoutReason reason) {
   828   if (!timeout_error_printed) {
   830   if (!timeout_error_printed) {
   829     timeout_error_printed = true;
   831     timeout_error_printed = true;
   830     // Print out the thread info which didn't reach the safepoint for debugging
   832     // Print out the thread info which didn't reach the safepoint for debugging
   831     // purposes (useful when there are lots of threads in the debugger).
   833     // purposes (useful when there are lots of threads in the debugger).
   832     tty->print_cr("");
   834     tty->cr();
   833     tty->print_cr("# SafepointSynchronize::begin: Timeout detected:");
   835     tty->print_cr("# SafepointSynchronize::begin: Timeout detected:");
   834     if (reason ==  _spinning_timeout) {
   836     if (reason ==  _spinning_timeout) {
   835       tty->print_cr("# SafepointSynchronize::begin: Timed out while spinning to reach a safepoint.");
   837       tty->print_cr("# SafepointSynchronize::begin: Timed out while spinning to reach a safepoint.");
   836     } else if (reason == _blocking_timeout) {
   838     } else if (reason == _blocking_timeout) {
   837       tty->print_cr("# SafepointSynchronize::begin: Timed out while waiting for threads to stop.");
   839       tty->print_cr("# SafepointSynchronize::begin: Timed out while waiting for threads to stop.");
   847       if (cur_thread->thread_state() != _thread_blocked &&
   849       if (cur_thread->thread_state() != _thread_blocked &&
   848           ((reason == _spinning_timeout && cur_state->is_running()) ||
   850           ((reason == _spinning_timeout && cur_state->is_running()) ||
   849            (reason == _blocking_timeout && !cur_state->has_called_back()))) {
   851            (reason == _blocking_timeout && !cur_state->has_called_back()))) {
   850         tty->print("# ");
   852         tty->print("# ");
   851         cur_thread->print();
   853         cur_thread->print();
   852         tty->print_cr("");
   854         tty->cr();
   853       }
   855       }
   854     }
   856     }
   855     tty->print_cr("# SafepointSynchronize::begin: (End of list)");
   857     tty->print_cr("# SafepointSynchronize::begin: (End of list)");
   856   }
   858   }
   857 
   859 
  1320 
  1322 
  1321   if ( PrintSafepointStatisticsTimeout < 0 ||
  1323   if ( PrintSafepointStatisticsTimeout < 0 ||
  1322        spstat->_time_to_sync > PrintSafepointStatisticsTimeout * MICROUNITS) {
  1324        spstat->_time_to_sync > PrintSafepointStatisticsTimeout * MICROUNITS) {
  1323     print_statistics();
  1325     print_statistics();
  1324   }
  1326   }
  1325   tty->print_cr("");
  1327   tty->cr();
  1326 
  1328 
  1327   // Print out polling page sampling status.
  1329   // Print out polling page sampling status.
  1328   if (!need_to_track_page_armed_status) {
  1330   if (!need_to_track_page_armed_status) {
  1329     if (UseCompilerSafepoints) {
  1331     if (UseCompilerSafepoints) {
  1330       tty->print_cr("Polling page always armed");
  1332       tty->print_cr("Polling page always armed");