8204477: Count linkage errors and print in Exceptions::print_exception_counts_on_error
Reviewed-by: stuefe, coleenp
This commit is contained in:
parent
83ece1407f
commit
673a629875
@ -37,6 +37,7 @@
|
|||||||
#include "runtime/os.hpp"
|
#include "runtime/os.hpp"
|
||||||
#include "runtime/thread.inline.hpp"
|
#include "runtime/thread.inline.hpp"
|
||||||
#include "runtime/threadCritical.hpp"
|
#include "runtime/threadCritical.hpp"
|
||||||
|
#include "runtime/atomic.hpp"
|
||||||
#include "utilities/events.hpp"
|
#include "utilities/events.hpp"
|
||||||
#include "utilities/exceptions.hpp"
|
#include "utilities/exceptions.hpp"
|
||||||
|
|
||||||
@ -151,6 +152,10 @@ void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exc
|
|||||||
count_out_of_memory_exceptions(h_exception);
|
count_out_of_memory_exceptions(h_exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (h_exception->is_a(SystemDictionary::LinkageError_klass())) {
|
||||||
|
Atomic::inc(&_linkage_errors);
|
||||||
|
}
|
||||||
|
|
||||||
assert(h_exception->is_a(SystemDictionary::Throwable_klass()), "exception is not a subclass of java/lang/Throwable");
|
assert(h_exception->is_a(SystemDictionary::Throwable_klass()), "exception is not a subclass of java/lang/Throwable");
|
||||||
|
|
||||||
// set the pending exception
|
// set the pending exception
|
||||||
@ -425,6 +430,7 @@ void Exceptions::wrap_dynamic_exception(Thread* THREAD) {
|
|||||||
|
|
||||||
// Exception counting for hs_err file
|
// Exception counting for hs_err file
|
||||||
volatile int Exceptions::_stack_overflow_errors = 0;
|
volatile int Exceptions::_stack_overflow_errors = 0;
|
||||||
|
volatile int Exceptions::_linkage_errors = 0;
|
||||||
volatile int Exceptions::_out_of_memory_error_java_heap_errors = 0;
|
volatile int Exceptions::_out_of_memory_error_java_heap_errors = 0;
|
||||||
volatile int Exceptions::_out_of_memory_error_metaspace_errors = 0;
|
volatile int Exceptions::_out_of_memory_error_metaspace_errors = 0;
|
||||||
volatile int Exceptions::_out_of_memory_error_class_metaspace_errors = 0;
|
volatile int Exceptions::_out_of_memory_error_class_metaspace_errors = 0;
|
||||||
@ -458,6 +464,9 @@ void Exceptions::print_exception_counts_on_error(outputStream* st) {
|
|||||||
if (_stack_overflow_errors > 0) {
|
if (_stack_overflow_errors > 0) {
|
||||||
st->print_cr("StackOverflowErrors=%d", _stack_overflow_errors);
|
st->print_cr("StackOverflowErrors=%d", _stack_overflow_errors);
|
||||||
}
|
}
|
||||||
|
if (_linkage_errors > 0) {
|
||||||
|
st->print_cr("LinkageErrors=%d", _linkage_errors);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implementation of ExceptionMark
|
// Implementation of ExceptionMark
|
||||||
|
@ -108,6 +108,9 @@ class Exceptions {
|
|||||||
static volatile int _out_of_memory_error_java_heap_errors;
|
static volatile int _out_of_memory_error_java_heap_errors;
|
||||||
static volatile int _out_of_memory_error_metaspace_errors;
|
static volatile int _out_of_memory_error_metaspace_errors;
|
||||||
static volatile int _out_of_memory_error_class_metaspace_errors;
|
static volatile int _out_of_memory_error_class_metaspace_errors;
|
||||||
|
|
||||||
|
// Count linkage errors
|
||||||
|
static volatile int _linkage_errors;
|
||||||
public:
|
public:
|
||||||
// this enum is defined to indicate whether it is safe to
|
// this enum is defined to indicate whether it is safe to
|
||||||
// ignore the encoding scheme of the original message string.
|
// ignore the encoding scheme of the original message string.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user