hotspot/src/share/vm/prims/jvmtiImpl.cpp
changeset 37992 c7ec6a3275f7
parent 29081 c61eb4914428
child 38091 d7e51f40ba2d
equal deleted inserted replaced
37991:ce2e1e55f28f 37992:c7ec6a3275f7
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "classfile/systemDictionary.hpp"
    26 #include "classfile/systemDictionary.hpp"
    27 #include "interpreter/interpreter.hpp"
    27 #include "interpreter/interpreter.hpp"
    28 #include "interpreter/oopMapCache.hpp"
    28 #include "interpreter/oopMapCache.hpp"
    29 #include "jvmtifiles/jvmtiEnv.hpp"
    29 #include "jvmtifiles/jvmtiEnv.hpp"
       
    30 #include "logging/log.hpp"
       
    31 #include "logging/logStream.hpp"
    30 #include "memory/resourceArea.hpp"
    32 #include "memory/resourceArea.hpp"
    31 #include "oops/instanceKlass.hpp"
    33 #include "oops/instanceKlass.hpp"
    32 #include "oops/oop.inline.hpp"
    34 #include "oops/oop.inline.hpp"
    33 #include "prims/jvmtiAgentThread.hpp"
    35 #include "prims/jvmtiAgentThread.hpp"
    34 #include "prims/jvmtiEventController.inline.hpp"
    36 #include "prims/jvmtiEventController.inline.hpp"
   319 
   321 
   320 void JvmtiBreakpoint::clear() {
   322 void JvmtiBreakpoint::clear() {
   321   each_method_version_do(&Method::clear_breakpoint);
   323   each_method_version_do(&Method::clear_breakpoint);
   322 }
   324 }
   323 
   325 
   324 void JvmtiBreakpoint::print() {
   326 void JvmtiBreakpoint::print(outputStream* out) {
   325 #ifndef PRODUCT
   327 #ifndef PRODUCT
       
   328   ResourceMark rm;
   326   const char *class_name  = (_method == NULL) ? "NULL" : _method->klass_name()->as_C_string();
   329   const char *class_name  = (_method == NULL) ? "NULL" : _method->klass_name()->as_C_string();
   327   const char *method_name = (_method == NULL) ? "NULL" : _method->name()->as_C_string();
   330   const char *method_name = (_method == NULL) ? "NULL" : _method->name()->as_C_string();
   328 
   331   out->print("Breakpoint(%s,%s,%d,%p)", class_name, method_name, _bci, getBcp());
   329   tty->print("Breakpoint(%s,%s,%d,%p)",class_name, method_name, _bci, getBcp());
       
   330 #endif
   332 #endif
   331 }
   333 }
   332 
   334 
   333 
   335 
   334 //
   336 //
   387 
   389 
   388 void JvmtiBreakpoints::gc_epilogue() {
   390 void JvmtiBreakpoints::gc_epilogue() {
   389   _bps.gc_epilogue();
   391   _bps.gc_epilogue();
   390 }
   392 }
   391 
   393 
   392 void  JvmtiBreakpoints::print() {
   394 void JvmtiBreakpoints::print() {
   393 #ifndef PRODUCT
   395 #ifndef PRODUCT
   394   ResourceMark rm;
   396   LogTarget(Trace, jvmti) log;
       
   397   LogStreamCHeap log_stream(log);
   395 
   398 
   396   int n = _bps.length();
   399   int n = _bps.length();
   397   for (int i=0; i<n; i++) {
   400   for (int i=0; i<n; i++) {
   398     JvmtiBreakpoint& bp = _bps.at(i);
   401     JvmtiBreakpoint& bp = _bps.at(i);
   399     tty->print("%d: ", i);
   402     log_stream.print("%d: ", i);
   400     bp.print();
   403     bp.print(&log_stream);
   401     tty->cr();
   404     log_stream.cr();
   402   }
   405   }
   403 #endif
   406 #endif
   404 }
   407 }
   405 
   408 
   406 
   409 
   873 
   876 
   874 
   877 
   875 void JvmtiSuspendControl::print() {
   878 void JvmtiSuspendControl::print() {
   876 #ifndef PRODUCT
   879 #ifndef PRODUCT
   877   MutexLocker mu(Threads_lock);
   880   MutexLocker mu(Threads_lock);
   878   ResourceMark rm;
   881   LogStreamHandle(Trace, jvmti) log_stream;
   879 
   882   log_stream.print("Suspended Threads: [");
   880   tty->print("Suspended Threads: [");
       
   881   for (JavaThread *thread = Threads::first(); thread != NULL; thread = thread->next()) {
   883   for (JavaThread *thread = Threads::first(); thread != NULL; thread = thread->next()) {
   882 #ifdef JVMTI_TRACE
   884 #ifdef JVMTI_TRACE
   883     const char *name   = JvmtiTrace::safe_get_thread_name(thread);
   885     const char *name   = JvmtiTrace::safe_get_thread_name(thread);
   884 #else
   886 #else
   885     const char *name   = "";
   887     const char *name   = "";
   886 #endif /*JVMTI_TRACE */
   888 #endif /*JVMTI_TRACE */
   887     tty->print("%s(%c ", name, thread->is_being_ext_suspended() ? 'S' : '_');
   889     log_stream.print("%s(%c ", name, thread->is_being_ext_suspended() ? 'S' : '_');
   888     if (!thread->has_last_Java_frame()) {
   890     if (!thread->has_last_Java_frame()) {
   889       tty->print("no stack");
   891       log_stream.print("no stack");
   890     }
   892     }
   891     tty->print(") ");
   893     log_stream.print(") ");
   892   }
   894   }
   893   tty->print_cr("]");
   895   log_stream.print_cr("]");
   894 #endif
   896 #endif
   895 }
   897 }
   896 
   898 
   897 JvmtiDeferredEvent JvmtiDeferredEvent::compiled_method_load_event(
   899 JvmtiDeferredEvent JvmtiDeferredEvent::compiled_method_load_event(
   898     nmethod* nm) {
   900     nmethod* nm) {