@@ -238,6 +238,9 @@ class Events : AllStatic {
238238
239239 // Class unloading events
240240 static UnloadingEventLog* _class_unloading;
241+
242+ // Class loading events
243+ static StringEventLog* _class_loading;
241244 public:
242245
243246 // Print all event logs; limit number of events per event log to be printed with max
@@ -263,6 +266,8 @@ class Events : AllStatic {
263266
264267 static void log_class_unloading (Thread* thread, InstanceKlass* ik);
265268
269+ static void log_class_loading (Thread* thread, const char * format, ...) ATTRIBUTE_PRINTF(2 , 3 );
270+
266271 static void log_deopt_message (Thread* thread, const char * format, ...) ATTRIBUTE_PRINTF(2 , 3 );
267272
268273 static void log_dll_message (Thread* thread, const char * format, ...) ATTRIBUTE_PRINTF(2 , 3 );
@@ -319,6 +324,15 @@ inline void Events::log_class_unloading(Thread* thread, InstanceKlass* ik) {
319324 }
320325}
321326
327+ inline void Events::log_class_loading (Thread* thread, const char * format, ...) {
328+ if (LogEvents && _class_loading != NULL ) {
329+ va_list ap;
330+ va_start (ap, format);
331+ _class_loading->logv (thread, format, ap);
332+ va_end (ap);
333+ }
334+ }
335+
322336inline void Events::log_deopt_message (Thread* thread, const char * format, ...) {
323337 if (LogEvents && _deopt_messages != NULL ) {
324338 va_list ap;
@@ -487,4 +501,7 @@ typedef EventMarkWithLogFunction<Events::log> EventMark;
487501// These end up in the vm_operation log.
488502typedef EventMarkWithLogFunction<Events::log_vm_operation> EventMarkVMOperation;
489503
504+ // These end up in the class loading log.
505+ typedef EventMarkWithLogFunction<Events::log_class_loading> EventMarkClassLoading;
506+
490507#endif // SHARE_UTILITIES_EVENTS_HPP
0 commit comments