< prev index next >

src/share/vm/utilities/events.hpp

Print this page




 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 (ThreadLocalStorage::get_thread_slow() == NULL) {
 252     // Not a regular Java thread so don't bother 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.
 261 template <class T>
 262 inline void EventLogBase<T>::print_log_impl(outputStream* out) {
 263   out->print_cr("%s (%d events):", _name, _count);
 264   if (_count == 0) {
 265     out->print_cr("No events");
 266     out->cr();
 267     return;
 268   }
 269 
 270   if (_count < _length) {
 271     for (int i = 0; i < _count; i++) {
 272       print(out, _records[i]);




 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.
 261 template <class T>
 262 inline void EventLogBase<T>::print_log_impl(outputStream* out) {
 263   out->print_cr("%s (%d events):", _name, _count);
 264   if (_count == 0) {
 265     out->print_cr("No events");
 266     out->cr();
 267     return;
 268   }
 269 
 270   if (_count < _length) {
 271     for (int i = 0; i < _count; i++) {
 272       print(out, _records[i]);


< prev index next >