src/hotspot/share/utilities/events.cpp
changeset 54973 0927d8c7296f
parent 54623 1126f0607c70
child 55074 ea1e4a818785
equal deleted inserted replaced
54972:f98a0ab24887 54973:0927d8c7296f
   106   double timestamp = fetch_timestamp();
   106   double timestamp = fetch_timestamp();
   107   // Unloading events are single threaded.
   107   // Unloading events are single threaded.
   108   int index = compute_log_index();
   108   int index = compute_log_index();
   109   _records[index].thread = thread;
   109   _records[index].thread = thread;
   110   _records[index].timestamp = timestamp;
   110   _records[index].timestamp = timestamp;
   111   stringStream st = _records[index].data.stream();
   111   stringStream st(_records[index].data.buffer(),
       
   112                   _records[index].data.size());
   112   st.print("Unloading class " INTPTR_FORMAT " ", p2i(ik));
   113   st.print("Unloading class " INTPTR_FORMAT " ", p2i(ik));
   113   ik->name()->print_value_on(&st);
   114   ik->name()->print_value_on(&st);
   114 }
   115 }
   115 
   116 
   116 void ExceptionsEventLog::log(Thread* thread, Handle h_exception, const char* message, const char* file, int line) {
   117 void ExceptionsEventLog::log(Thread* thread, Handle h_exception, const char* message, const char* file, int line) {
   119   double timestamp = fetch_timestamp();
   120   double timestamp = fetch_timestamp();
   120   MutexLocker ml(&_mutex, Mutex::_no_safepoint_check_flag);
   121   MutexLocker ml(&_mutex, Mutex::_no_safepoint_check_flag);
   121   int index = compute_log_index();
   122   int index = compute_log_index();
   122   _records[index].thread = thread;
   123   _records[index].thread = thread;
   123   _records[index].timestamp = timestamp;
   124   _records[index].timestamp = timestamp;
   124   stringStream st = _records[index].data.stream();
   125   stringStream st(_records[index].data.buffer(),
       
   126                   _records[index].data.size());
   125   st.print("Exception <");
   127   st.print("Exception <");
   126   h_exception->print_value_on(&st);
   128   h_exception->print_value_on(&st);
   127   st.print("%s%s> (" INTPTR_FORMAT ") \n"
   129   st.print("%s%s> (" INTPTR_FORMAT ") \n"
   128            "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT,
   130            "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT,
   129            message ? ": " : "", message ? message : "",
   131            message ? ": " : "", message ? message : "",