51 52 EventLog::EventLog() { 53 // This normally done during bootstrap when we're only single 54 // threaded but use a ThreadCritical to ensure inclusion in case 55 // some are created slightly late. 56 ThreadCritical tc; 57 _next = Events::_logs; 58 Events::_logs = this; 59 } 60 61 // For each registered event logger, print out the current contents of 62 // the buffer. This is normally called when the JVM is crashing. 63 void Events::print_all(outputStream* out) { 64 EventLog* log = _logs; 65 while (log != NULL) { 66 log->print_log_on(out); 67 log = log->next(); 68 } 69 } 70 71 void Events::init() { 72 if (LogEvents) { 73 _messages = new StringEventLog("Events"); 74 _exceptions = new StringEventLog("Internal exceptions"); 75 _deopt_messages = new StringEventLog("Deoptimization events"); 76 } 77 } 78 79 void eventlog_init() { 80 Events::init(); 81 } 82 83 /////////////////////////////////////////////////////////////////////////// 84 // EventMark 85 86 EventMark::EventMark(const char* format, ...) { 87 if (LogEvents) { 88 va_list ap; 89 va_start(ap, format); 90 // Save a copy of begin message and log it. | 51 52 EventLog::EventLog() { 53 // This normally done during bootstrap when we're only single 54 // threaded but use a ThreadCritical to ensure inclusion in case 55 // some are created slightly late. 56 ThreadCritical tc; 57 _next = Events::_logs; 58 Events::_logs = this; 59 } 60 61 // For each registered event logger, print out the current contents of 62 // the buffer. This is normally called when the JVM is crashing. 63 void Events::print_all(outputStream* out) { 64 EventLog* log = _logs; 65 while (log != NULL) { 66 log->print_log_on(out); 67 log = log->next(); 68 } 69 } 70 71 void Events::print() { 72 print_all(tty); 73 } 74 75 void Events::init() { 76 if (LogEvents) { 77 _messages = new StringEventLog("Events"); 78 _exceptions = new StringEventLog("Internal exceptions"); 79 _deopt_messages = new StringEventLog("Deoptimization events"); 80 } 81 } 82 83 void eventlog_init() { 84 Events::init(); 85 } 86 87 /////////////////////////////////////////////////////////////////////////// 88 // EventMark 89 90 EventMark::EventMark(const char* format, ...) { 91 if (LogEvents) { 92 va_list ap; 93 va_start(ap, format); 94 // Save a copy of begin message and log it. |