< prev index next >
src/hotspot/share/utilities/exceptions.cpp
Print this page
rev 50234 : 8204477: Count linkage errors and print in Exceptions::print_exception_counts_on_error
@@ -35,10 +35,11 @@
#include "runtime/java.hpp"
#include "runtime/javaCalls.hpp"
#include "runtime/os.hpp"
#include "runtime/thread.inline.hpp"
#include "runtime/threadCritical.hpp"
+#include "runtime/atomic.hpp"
#include "utilities/events.hpp"
#include "utilities/exceptions.hpp"
// Implementation of ThreadShadow
void check_ThreadShadow() {
@@ -149,10 +150,14 @@
if (h_exception->is_a(SystemDictionary::OutOfMemoryError_klass())) {
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");
// set the pending exception
thread->set_pending_exception(h_exception(), file, line);
@@ -423,10 +428,11 @@
}
}
// Exception counting for hs_err file
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_metaspace_errors = 0;
volatile int Exceptions::_out_of_memory_error_class_metaspace_errors = 0;
void Exceptions::count_out_of_memory_exceptions(Handle exception) {
@@ -456,10 +462,13 @@
print_oom_count(st, "metaspace_errors", _out_of_memory_error_metaspace_errors);
print_oom_count(st, "class_metaspace_errors", _out_of_memory_error_class_metaspace_errors);
if (_stack_overflow_errors > 0) {
st->print_cr("StackOverflowErrors=%d", _stack_overflow_errors);
}
+ if (_linkage_errors > 0) {
+ st->print_cr("LinkageErrors=%d", _linkage_errors);
+ }
}
// Implementation of ExceptionMark
ExceptionMark::ExceptionMark(Thread*& thread) {
< prev index next >