193 static void print_all(outputStream* out);
194
195 // Dump all events to the tty
196 static void print();
197
198 // Logs a generic message with timestamp and format as printf.
199 static void log(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
200
201 // Log exception related message
202 static void log_exception(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
203
204 static void log_redefinition(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
205
206 static void log_deopt_message(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
207
208 // Register default loggers
209 static void init();
210 };
211
212 inline void Events::log(Thread* thread, const char* format, ...) {
213 if (LogEvents) {
214 va_list ap;
215 va_start(ap, format);
216 _messages->logv(thread, format, ap);
217 va_end(ap);
218 }
219 }
220
221 inline void Events::log_exception(Thread* thread, const char* format, ...) {
222 if (LogEvents) {
223 va_list ap;
224 va_start(ap, format);
225 _exceptions->logv(thread, format, ap);
226 va_end(ap);
227 }
228 }
229
230 inline void Events::log_redefinition(Thread* thread, const char* format, ...) {
231 if (LogEvents) {
232 va_list ap;
233 va_start(ap, format);
234 _redefinitions->logv(thread, format, ap);
235 va_end(ap);
236 }
237 }
238
239 inline void Events::log_deopt_message(Thread* thread, const char* format, ...) {
240 if (LogEvents) {
241 va_list ap;
242 va_start(ap, format);
243 _deopt_messages->logv(thread, format, ap);
244 va_end(ap);
245 }
246 }
247
248
249 template <class T>
250 inline void EventLogBase<T>::print_log_on(outputStream* out) {
251 if (Thread::current_or_null() == NULL) {
252 // Not yet attached? Don't try to use locking
253 print_log_impl(out);
254 } else {
255 MutexLockerEx ml(&_mutex, Mutex::_no_safepoint_check_flag);
256 print_log_impl(out);
257 }
258 }
259
260 // Dump the ring buffer entries that current have entries.
|
193 static void print_all(outputStream* out);
194
195 // Dump all events to the tty
196 static void print();
197
198 // Logs a generic message with timestamp and format as printf.
199 static void log(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
200
201 // Log exception related message
202 static void log_exception(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
203
204 static void log_redefinition(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
205
206 static void log_deopt_message(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
207
208 // Register default loggers
209 static void init();
210 };
211
212 inline void Events::log(Thread* thread, const char* format, ...) {
213 if (LogEvents && _messages != NULL) {
214 va_list ap;
215 va_start(ap, format);
216 _messages->logv(thread, format, ap);
217 va_end(ap);
218 }
219 }
220
221 inline void Events::log_exception(Thread* thread, const char* format, ...) {
222 if (LogEvents && _exceptions != NULL) {
223 va_list ap;
224 va_start(ap, format);
225 _exceptions->logv(thread, format, ap);
226 va_end(ap);
227 }
228 }
229
230 inline void Events::log_redefinition(Thread* thread, const char* format, ...) {
231 if (LogEvents && _redefinitions != NULL) {
232 va_list ap;
233 va_start(ap, format);
234 _redefinitions->logv(thread, format, ap);
235 va_end(ap);
236 }
237 }
238
239 inline void Events::log_deopt_message(Thread* thread, const char* format, ...) {
240 if (LogEvents && _deopt_messages != NULL) {
241 va_list ap;
242 va_start(ap, format);
243 _deopt_messages->logv(thread, format, ap);
244 va_end(ap);
245 }
246 }
247
248
249 template <class T>
250 inline void EventLogBase<T>::print_log_on(outputStream* out) {
251 if (Thread::current_or_null() == NULL) {
252 // Not yet attached? Don't try to use locking
253 print_log_impl(out);
254 } else {
255 MutexLockerEx ml(&_mutex, Mutex::_no_safepoint_check_flag);
256 print_log_impl(out);
257 }
258 }
259
260 // Dump the ring buffer entries that current have entries.
|