@@ -235,6 +235,9 @@ class Events : AllStatic {
235235
236236 // Class unloading events
237237 static UnloadingEventLog* _class_unloading;
238+
239+ // Class loading events
240+ static StringEventLog* _class_loading;
238241 public:
239242
240243 // Print all event logs; limit number of events per event log to be printed with max
@@ -260,6 +263,8 @@ class Events : AllStatic {
260263
261264 static void log_class_unloading (Thread* thread, InstanceKlass* ik);
262265
266+ static void log_class_loading (Thread* thread, const char * format, ...) ATTRIBUTE_PRINTF(2 , 3 );
267+
263268 static void log_deopt_message (Thread* thread, const char * format, ...) ATTRIBUTE_PRINTF(2 , 3 );
264269
265270 // Register default loggers
@@ -314,6 +319,15 @@ inline void Events::log_class_unloading(Thread* thread, InstanceKlass* ik) {
314319 }
315320}
316321
322+ inline void Events::log_class_loading (Thread* thread, const char * format, ...) {
323+ if (LogEvents && _class_loading != NULL ) {
324+ va_list ap;
325+ va_start (ap, format);
326+ _class_loading->logv (thread, format, ap);
327+ va_end (ap);
328+ }
329+ }
330+
317331inline void Events::log_deopt_message (Thread* thread, const char * format, ...) {
318332 if (LogEvents && _deopt_messages != NULL ) {
319333 va_list ap;
@@ -473,4 +487,7 @@ typedef EventMarkWithLogFunction<Events::log> EventMark;
473487// These end up in the vm_operation log.
474488typedef EventMarkWithLogFunction<Events::log_vm_operation> EventMarkVMOperation;
475489
490+ // These end up in the class loading log.
491+ typedef EventMarkWithLogFunction<Events::log_class_loading> EventMarkClassLoading;
492+
476493#endif // SHARE_UTILITIES_EVENTS_HPP
0 commit comments