src/hotspot/share/utilities/exceptions.cpp
changeset 50516 77f9fece2f19
parent 50217 843fc56f4686
child 53745 a535ba736cab
--- a/src/hotspot/share/utilities/exceptions.cpp	Wed May 30 14:46:17 2018 +0200
+++ b/src/hotspot/share/utilities/exceptions.cpp	Wed May 30 14:46:17 2018 +0200
@@ -37,6 +37,7 @@
 #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"
 
@@ -151,6 +152,10 @@
     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
@@ -425,6 +430,7 @@
 
 // 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;
@@ -458,6 +464,9 @@
   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