3383 public: 3384 // Not MT-safe; so do not pass around these StackObj's 3385 // where they may be accessed by other threads. 3386 jlong wallclock_millis() { 3387 assert(_wallclock.is_active(), "Wall clock should not stop"); 3388 _wallclock.stop(); // to record time 3389 jlong ret = _wallclock.milliseconds(); 3390 _wallclock.start(); // restart 3391 return ret; 3392 } 3393 }; 3394 3395 CMSPhaseAccounting::CMSPhaseAccounting(CMSCollector *collector, 3396 const char *phase, 3397 bool print_cr) : 3398 _collector(collector), _phase(phase), _print_cr(print_cr) { 3399 3400 if (PrintCMSStatistics != 0) { 3401 _collector->resetYields(); 3402 } 3403 if (PrintGCDetails && PrintGCTimeStamps) { 3404 gclog_or_tty->date_stamp(PrintGCDateStamps); 3405 gclog_or_tty->stamp(); 3406 gclog_or_tty->print_cr(": [%s-concurrent-%s-start]", 3407 _collector->cmsGen()->short_name(), _phase); 3408 } 3409 _collector->resetTimer(); 3410 _wallclock.start(); 3411 _collector->startTimer(); 3412 } 3413 3414 CMSPhaseAccounting::~CMSPhaseAccounting() { 3415 assert(_wallclock.is_active(), "Wall clock should not have stopped"); 3416 _collector->stopTimer(); 3417 _wallclock.stop(); 3418 if (PrintGCDetails) { 3419 gclog_or_tty->date_stamp(PrintGCDateStamps); 3420 gclog_or_tty->stamp(PrintGCTimeStamps); 3421 gclog_or_tty->print("[%s-concurrent-%s: %3.3f/%3.3f secs]", 3422 _collector->cmsGen()->short_name(), 3423 _phase, _collector->timerValue(), _wallclock.seconds()); 3424 if (_print_cr) { 3425 gclog_or_tty->print_cr(""); 3426 } | 3383 public: 3384 // Not MT-safe; so do not pass around these StackObj's 3385 // where they may be accessed by other threads. 3386 jlong wallclock_millis() { 3387 assert(_wallclock.is_active(), "Wall clock should not stop"); 3388 _wallclock.stop(); // to record time 3389 jlong ret = _wallclock.milliseconds(); 3390 _wallclock.start(); // restart 3391 return ret; 3392 } 3393 }; 3394 3395 CMSPhaseAccounting::CMSPhaseAccounting(CMSCollector *collector, 3396 const char *phase, 3397 bool print_cr) : 3398 _collector(collector), _phase(phase), _print_cr(print_cr) { 3399 3400 if (PrintCMSStatistics != 0) { 3401 _collector->resetYields(); 3402 } 3403 if (PrintGCDetails) { 3404 gclog_or_tty->date_stamp(PrintGCDateStamps); 3405 gclog_or_tty->stamp(PrintGCTimeStamps); 3406 gclog_or_tty->print_cr("[%s-concurrent-%s-start]", 3407 _collector->cmsGen()->short_name(), _phase); 3408 } 3409 _collector->resetTimer(); 3410 _wallclock.start(); 3411 _collector->startTimer(); 3412 } 3413 3414 CMSPhaseAccounting::~CMSPhaseAccounting() { 3415 assert(_wallclock.is_active(), "Wall clock should not have stopped"); 3416 _collector->stopTimer(); 3417 _wallclock.stop(); 3418 if (PrintGCDetails) { 3419 gclog_or_tty->date_stamp(PrintGCDateStamps); 3420 gclog_or_tty->stamp(PrintGCTimeStamps); 3421 gclog_or_tty->print("[%s-concurrent-%s: %3.3f/%3.3f secs]", 3422 _collector->cmsGen()->short_name(), 3423 _phase, _collector->timerValue(), _wallclock.seconds()); 3424 if (_print_cr) { 3425 gclog_or_tty->print_cr(""); 3426 } |