Top


定義場所(file name)

hotspot/src/share/vm/runtime/safepoint.cpp

名前(function name)

void SafepointSynchronize::begin_statistics(int nof_threads, int nof_running) {

本体部(body)

  {- -------------------------------------------
  (1) (assert)
      ---------------------------------------- -}

      assert(init_done, "safepoint statistics array hasn't been initialized");

  {- -------------------------------------------
  (1) _safepoint_stats[_cur_stat_index] に入っている統計情報, 及び _safepoint_reasons 内の統計情報を更新する.
      ---------------------------------------- -}

      SafepointStats *spstat = &_safepoint_stats[_cur_stat_index];

      spstat->_time_stamp = _ts_of_current_safepoint;

      VM_Operation *op = VMThread::vm_operation();
      spstat->_vmop_type = (op != NULL ? op->type() : -1);
      if (op != NULL) {
        _safepoint_reasons[spstat->_vmop_type]++;
      }

      spstat->_nof_total_threads = nof_threads;
      spstat->_nof_initial_running_threads = nof_running;
      spstat->_nof_threads_hit_page_trap = 0;

      // Records the start time of spinning. The real time spent on spinning
      // will be adjusted when spin is done. Same trick is applied for time
      // spent on waiting for threads to block.
      if (nof_running != 0) {
        spstat->_time_to_spin = os::javaTimeNanos();
      }  else {
        spstat->_time_to_spin = 0;
      }
    }

This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.