< prev index next >

src/hotspot/share/utilities/vmError.cpp

Print this page

        

*** 404,423 **** jlong VMError::get_step_start_time() { return Atomic::load(&_step_start_time); } - void VMError::clear_step_start_time() { - return Atomic::store((jlong)0, &_step_start_time); - } - void VMError::report(outputStream* st, bool _verbose) { # define BEGIN if (_current_step == 0) { _current_step = __LINE__; # define STEP(s) } if (_current_step < __LINE__) { _current_step = __LINE__; _current_step_info = s; \ record_step_start_time(); _step_did_timeout = false; ! # define END clear_step_start_time(); } // don't allocate large buffer on stack static char buf[O_BUFLEN]; BEGIN --- 404,419 ---- jlong VMError::get_step_start_time() { return Atomic::load(&_step_start_time); } void VMError::report(outputStream* st, bool _verbose) { # define BEGIN if (_current_step == 0) { _current_step = __LINE__; # define STEP(s) } if (_current_step < __LINE__) { _current_step = __LINE__; _current_step_info = s; \ record_step_start_time(); _step_did_timeout = false; ! # define END } // don't allocate large buffer on stack static char buf[O_BUFLEN]; BEGIN
*** 453,471 **** // TestUnresponsiveErrorHandler: We want to test both step timeouts and global timeout. // Step to global timeout ratio is 4:1, so in order to be absolutely sure we hit the // global timeout, let's execute the timeout step five times. // See corresponding test in test/runtime/ErrorHandling/TimeoutInErrorHandlingTest.java - STEP("setup for test unresponsive error reporting step") - if (_verbose && TestUnresponsiveErrorHandler) { - // We record reporting_start_time for this test here because we - // care about the time spent executing TIMEOUT_TEST_STEP and not - // about the time it took us to get here. - tty->print_cr("Recording reporting_start_time for TestUnresponsiveErrorHandler."); - record_reporting_start_time(); - } - #define TIMEOUT_TEST_STEP STEP("test unresponsive error reporting step") \ if (_verbose && TestUnresponsiveErrorHandler) { os::infinite_sleep(); } TIMEOUT_TEST_STEP TIMEOUT_TEST_STEP TIMEOUT_TEST_STEP --- 449,458 ----
*** 1369,1386 **** // first time _error_reported = true; reporting_started(); ! if (!TestUnresponsiveErrorHandler) { ! // Record reporting_start_time unless we're running the ! // TestUnresponsiveErrorHandler test. For that test we record ! // reporting_start_time at the beginning of the test. ! record_reporting_start_time(); ! } else { ! out.print_raw_cr("Delaying recording reporting_start_time for TestUnresponsiveErrorHandler."); ! } if (ShowMessageBoxOnError || PauseAtExit) { show_message_box(buffer, sizeof(buffer)); // User has asked JVM to abort. Reset ShowMessageBoxOnError so the --- 1356,1366 ---- // first time _error_reported = true; reporting_started(); ! record_reporting_start_time(); if (ShowMessageBoxOnError || PauseAtExit) { show_message_box(buffer, sizeof(buffer)); // User has asked JVM to abort. Reset ShowMessageBoxOnError so the
*** 1683,1695 **** const jlong reporting_start_time_l = get_reporting_start_time(); const jlong now = get_current_timestamp(); // Timestamp is stored in nanos. if (reporting_start_time_l > 0) { const jlong end = reporting_start_time_l + (jlong)ErrorLogTimeout * TIMESTAMP_TO_SECONDS_FACTOR; ! if (end <= now && !_reporting_did_timeout) { ! // We hit ErrorLogTimeout and we haven't interrupted the reporting ! // thread yet. _reporting_did_timeout = true; interrupt_reporting_thread(); return true; // global timeout } } --- 1663,1673 ---- const jlong reporting_start_time_l = get_reporting_start_time(); const jlong now = get_current_timestamp(); // Timestamp is stored in nanos. if (reporting_start_time_l > 0) { const jlong end = reporting_start_time_l + (jlong)ErrorLogTimeout * TIMESTAMP_TO_SECONDS_FACTOR; ! if (end <= now) { _reporting_did_timeout = true; interrupt_reporting_thread(); return true; // global timeout } }
*** 1698,1710 **** if (step_start_time_l > 0) { // A step times out after a quarter of the total timeout. Steps are mostly fast unless they // hang for some reason, so this simple rule allows for three hanging step and still // hopefully leaves time enough for the rest of the steps to finish. const jlong end = step_start_time_l + (jlong)ErrorLogTimeout * TIMESTAMP_TO_SECONDS_FACTOR / 4; ! if (end <= now && !_step_did_timeout) { ! // The step timed out and we haven't interrupted the reporting ! // thread yet. _step_did_timeout = true; interrupt_reporting_thread(); return false; // (Not a global timeout) } } --- 1676,1686 ---- if (step_start_time_l > 0) { // A step times out after a quarter of the total timeout. Steps are mostly fast unless they // hang for some reason, so this simple rule allows for three hanging step and still // hopefully leaves time enough for the rest of the steps to finish. const jlong end = step_start_time_l + (jlong)ErrorLogTimeout * TIMESTAMP_TO_SECONDS_FACTOR / 4; ! if (end <= now) { _step_did_timeout = true; interrupt_reporting_thread(); return false; // (Not a global timeout) } }
< prev index next >