< prev index next >

src/hotspot/share/oops/instanceKlass.cpp

Print this page

        

@@ -78,10 +78,17 @@
 #include "utilities/macros.hpp"
 #include "utilities/stringUtils.hpp"
 #ifdef COMPILER1
 #include "c1/c1_Compiler.hpp"
 #endif
+#if INCLUDE_JFR
+#include "utilities/ticks.hpp"
+#include "jfr/jfr.hpp"
+#include "jfr/jfrEvents.hpp"
+Ticks InstanceKlass::_class_unload_time;
+#endif
+
 
 #ifdef DTRACE_ENABLED
 
 
 #define HOTSPOT_CLASS_INITIALIZATION_required HOTSPOT_CLASS_INITIALIZATION_REQUIRED

@@ -2421,10 +2428,22 @@
     JvmtiExport::post_class_unload(ik);
   }
 
   // notify ClassLoadingService of class unload
   ClassLoadingService::notify_class_unloaded(ik);
+
+#if INCLUDE_JFR
+  if (Jfr::is_enabled()) {
+    assert(ik != NULL, "invariant");
+    EventClassUnload event(UNTIMED);
+    event.set_endtime(class_unload_time());
+    event.set_unloadedClass(ik);
+    event.set_definingClassLoader(ik->class_loader_data());
+    event.commit();
+  }
+#endif
+
 }
 
 void InstanceKlass::release_C_heap_structures(InstanceKlass* ik) {
   // Clean up C heap
   ik->release_C_heap_structures();
< prev index next >