changeset 10937:d3295ddedb55

8154041: JVMTI trace to Unified Logging Reviewed-by: sspitsyn, mlarsson
author rehn
date Tue, 19 Apr 2016 14:14:04 +0200
parents 33d34e159776
children f5039ced9a85
files src/share/vm/logging/logTag.hpp src/share/vm/prims/jvmtiEnter.xsl src/share/vm/prims/jvmtiEventController.cpp src/share/vm/prims/jvmtiExport.cpp src/share/vm/prims/jvmtiImpl.cpp src/share/vm/prims/jvmtiImpl.hpp src/share/vm/prims/jvmtiManageCapabilities.cpp src/share/vm/prims/jvmtiThreadState.cpp src/share/vm/prims/jvmtiTrace.cpp
diffstat 9 files changed, 189 insertions(+), 179 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/logging/logTag.hpp	Tue Apr 19 12:30:00 2016 +0200
+++ b/src/share/vm/logging/logTag.hpp	Tue Apr 19 14:14:04 2016 +0200
@@ -62,6 +62,7 @@
   LOG_TAG(ihop) \
   LOG_TAG(itables) \
   LOG_TAG(jni) \
+  LOG_TAG(jvmti) \
   LOG_TAG(liveness) \
   LOG_TAG(logging) \
   LOG_TAG(marking) \
--- a/src/share/vm/prims/jvmtiEnter.xsl	Tue Apr 19 12:30:00 2016 +0200
+++ b/src/share/vm/prims/jvmtiEnter.xsl	Tue Apr 19 14:14:04 2016 +0200
@@ -40,6 +40,7 @@
 # include "memory/resourceArea.hpp"
 # include "utilities/macros.hpp"
 #if INCLUDE_JVMTI
+# include "logging/log.hpp"
 # include "oops/oop.inline.hpp"
 # include "prims/jvmtiEnter.hpp"
 # include "prims/jvmtiRawMonitor.hpp"
@@ -415,7 +416,7 @@
     <xsl:value-of select="$space"/>
     <xsl:text>  if (trace_flags) {</xsl:text>
     <xsl:value-of select="$space"/>
-    <xsl:text>    tty->print_cr("JVMTI [non-attached thread] %s %s",  func_name,</xsl:text>
+    <xsl:text>    log_trace(jvmti)("[non-attached thread] %s %s",  func_name,</xsl:text>
     <xsl:value-of select="$space"/>
     <xsl:text>    JvmtiUtil::error_name(JVMTI_ERROR_UNATTACHED_THREAD));</xsl:text>
     <xsl:value-of select="$space"/>
@@ -452,7 +453,7 @@
 </xsl:text>
     <xsl:if test="$trace='Trace'">
       <xsl:text>    if (trace_flags) {
-          tty->print_cr("JVMTI [%s] %s %s",  curr_thread_name, func_name, 
+          log_trace(jvmti)("[%s] %s %s",  curr_thread_name, func_name, 
                     JvmtiUtil::error_name(JVMTI_ERROR_MUST_POSSESS_CAPABILITY));
     }
 </xsl:text>
@@ -486,7 +487,7 @@
 </xsl:text>
     <xsl:if test="$trace='Trace'">
       <xsl:text>    if (trace_flags) {
-          tty->print_cr("JVMTI [-] %s %s",  func_name, 
+          log_trace(jvmti)("[-] %s %s",  func_name, 
                     JvmtiUtil::error_name(JVMTI_ERROR_WRONG_PHASE));
     }
 </xsl:text>
@@ -509,7 +510,7 @@
 </xsl:text>
     <xsl:if test="$trace='Trace'">
       <xsl:text>    if (trace_flags) {
-          tty->print_cr("JVMTI [-] %s %s",  func_name, 
+          log_trace(jvmti)("[-] %s %s",  func_name, 
                     JvmtiUtil::error_name(JVMTI_ERROR_WRONG_PHASE));
     }
 </xsl:text>
@@ -522,7 +523,7 @@
 </xsl:text>
     <xsl:if test="$trace='Trace'">
       <xsl:text>    if (trace_flags) {
-          tty->print_cr("JVMTI [-] %s %s",  func_name, 
+          log_trace(jvmti)("[-] %s %s",  func_name, 
                     JvmtiUtil::error_name(JVMTI_ERROR_WRONG_PHASE));
     }
 </xsl:text>
@@ -541,7 +542,7 @@
 </xsl:text>
     <xsl:if test="$trace='Trace'">
       <xsl:text>    if (trace_flags) {
-          tty->print_cr("JVMTI [%s] %s %s  env=" PTR_FORMAT,  curr_thread_name, func_name, 
+          log_trace(jvmti)("[%s] %s %s  env=" PTR_FORMAT,  curr_thread_name, func_name, 
                     JvmtiUtil::error_name(JVMTI_ERROR_INVALID_ENVIRONMENT), p2i(env));
     }
 </xsl:text>
@@ -667,7 +668,7 @@
     <xsl:with-param name="endParam" select="."/>
   </xsl:apply-templates>
   <xsl:text>      }
-        tty->print_cr("JVMTI [%s] %s } %s - erroneous arg is </xsl:text>
+        log_error(jvmti)("[%s] %s } %s - erroneous arg is </xsl:text>
     <xsl:value-of select="@id"/>
     <xsl:value-of select="$comment"/>
     <xsl:text>",  curr_thread_name, func_name, 
@@ -692,10 +693,10 @@
 </xsl:text>
     <xsl:apply-templates select="." mode="traceIn"/>
     <xsl:text>    }
-    tty->print_cr("JVMTI [%s] %s } %s",  curr_thread_name, func_name, 
+    log_error(jvmti)("[%s] %s } %s",  curr_thread_name, func_name, 
                   JvmtiUtil::error_name(err));
   } else if ((trace_flags &amp; JvmtiTrace::SHOW_OUT) != 0) {
-    tty->print_cr("JVMTI [%s] %s }",  curr_thread_name, func_name);
+    log_trace(jvmti)("[%s] %s }",  curr_thread_name, func_name);
   }
 </xsl:text>
   </xsl:if>
@@ -703,7 +704,7 @@
 
 <xsl:template match="function" mode="traceIn">
   <xsl:param name="endParam"></xsl:param>
-  <xsl:text>          tty->print_cr("JVMTI [%s] %s { </xsl:text>
+  <xsl:text>          log_trace(jvmti)("[%s] %s { </xsl:text>
   <xsl:apply-templates select="parameters" mode="traceInFormat">
     <xsl:with-param name="endParam" select="$endParam"/>    
   </xsl:apply-templates>
--- a/src/share/vm/prims/jvmtiEventController.cpp	Tue Apr 19 12:30:00 2016 +0200
+++ b/src/share/vm/prims/jvmtiEventController.cpp	Tue Apr 19 14:14:04 2016 +0200
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "interpreter/interpreter.hpp"
 #include "jvmtifiles/jvmtiEnv.hpp"
+#include "logging/log.hpp"
 #include "memory/resourceArea.hpp"
 #include "prims/jvmtiEventController.hpp"
 #include "prims/jvmtiEventController.inline.hpp"
@@ -42,7 +43,7 @@
 #define EC_TRACE(out) do { \
   if (JvmtiTrace::trace_event_controller()) { \
     SafeResourceMark rm; \
-    tty->print_cr out; \
+    log_trace(jvmti) out; \
   } \
 } while (0)
 #else
@@ -344,7 +345,7 @@
 
 
 void JvmtiEventControllerPrivate::enter_interp_only_mode(JvmtiThreadState *state) {
-  EC_TRACE(("JVMTI [%s] # Entering interpreter only mode",
+  EC_TRACE(("[%s] # Entering interpreter only mode",
             JvmtiTrace::safe_get_thread_name(state->get_thread())));
 
   VM_EnterInterpOnlyMode op(state);
@@ -354,7 +355,7 @@
 
 void
 JvmtiEventControllerPrivate::leave_interp_only_mode(JvmtiThreadState *state) {
-  EC_TRACE(("JVMTI [%s] # Leaving interpreter only mode",
+  EC_TRACE(("[%s] # Leaving interpreter only mode",
             JvmtiTrace::safe_get_thread_name(state->get_thread())));
   state->leave_interp_only_mode();
 }
@@ -370,7 +371,7 @@
       jlong bit = JvmtiEventEnabled::bit_for((jvmtiEvent)ei);
       if (changed & bit) {
         // it changed, print it
-        tty->print_cr("JVMTI [%s] # %s event %s",
+         log_trace(jvmti)("[%s] # %s event %s",
                       JvmtiTrace::safe_get_thread_name(state->get_thread()),
                       (now_enabled & bit)? "Enabling" : "Disabling", JvmtiTrace::event_name((jvmtiEvent)ei));
       }
@@ -390,7 +391,7 @@
       jlong bit = JvmtiEventEnabled::bit_for((jvmtiEvent)ei);
       if (changed & bit) {
         // it changed, print it
-        tty->print_cr("JVMTI [-] # %s event %s",
+         log_trace(jvmti)("[-] # %s event %s",
                       (now_enabled & bit)? "Enabling" : "Disabling", JvmtiTrace::event_name((jvmtiEvent)ei));
       }
     }
@@ -563,7 +564,7 @@
   jlong was_any_env_thread_enabled = JvmtiEventController::_universal_global_event_enabled.get_bits();
   jlong any_env_thread_enabled = 0;
 
-  EC_TRACE(("JVMTI [-] # recompute enabled - before " UINT64_FORMAT_X, was_any_env_thread_enabled));
+  EC_TRACE(("[-] # recompute enabled - before " UINT64_FORMAT_X, was_any_env_thread_enabled));
 
   // compute non-thread-filters events.
   // This must be done separately from thread-filtered events, since some
@@ -643,7 +644,7 @@
 
   }
 
-  EC_TRACE(("JVMTI [-] # recompute enabled - after " UINT64_FORMAT_X, any_env_thread_enabled));
+  EC_TRACE(("[-] # recompute enabled - after " UINT64_FORMAT_X, any_env_thread_enabled));
 }
 
 
@@ -653,7 +654,7 @@
   assert(thread == Thread::current(), "must be current thread");
   assert(JvmtiEnvBase::environments_might_exist(), "to enter event controller, JVM TI environments must exist");
 
-  EC_TRACE(("JVMTI [%s] # thread started", JvmtiTrace::safe_get_thread_name(thread)));
+  EC_TRACE(("[%s] # thread started", JvmtiTrace::safe_get_thread_name(thread)));
 
   // if we have any thread filtered events globally enabled, create/update the thread state
   if ((JvmtiEventController::_universal_global_event_enabled.get_bits() & THREAD_FILTERED_EVENT_BITS) != 0) {
@@ -673,7 +674,7 @@
   // May be called after all environments have been disposed.
   assert(JvmtiThreadState_lock->is_locked(), "sanity check");
 
-  EC_TRACE(("JVMTI [%s] # thread ended", JvmtiTrace::safe_get_thread_name(thread)));
+  EC_TRACE(("[%s] # thread ended", JvmtiTrace::safe_get_thread_name(thread)));
 
   JvmtiThreadState *state = thread->jvmti_thread_state();
   assert(state != NULL, "else why are we here?");
@@ -684,7 +685,7 @@
                                                       const jvmtiEventCallbacks* callbacks,
                                                       jint size_of_callbacks) {
   assert(Threads::number_of_threads() == 0 || JvmtiThreadState_lock->is_locked(), "sanity check");
-  EC_TRACE(("JVMTI [*] # set event callbacks"));
+  EC_TRACE(("[*] # set event callbacks"));
 
   env->set_event_callbacks(callbacks, size_of_callbacks);
   jlong enabled_bits = 0;
@@ -704,7 +705,7 @@
                                                           jvmtiExtensionEvent callback)
 {
   assert(Threads::number_of_threads() == 0 || JvmtiThreadState_lock->is_locked(), "sanity check");
-  EC_TRACE(("JVMTI [*] # set extension event callback"));
+  EC_TRACE(("[*] # set extension event callback"));
 
   // extension events are allocated below JVMTI_MIN_EVENT_TYPE_VAL
   assert(extension_event_index >= (jint)EXT_MIN_EVENT_TYPE_VAL &&
@@ -750,7 +751,7 @@
 void
 JvmtiEventControllerPrivate::env_initialize(JvmtiEnvBase *env) {
   assert(Threads::number_of_threads() == 0 || JvmtiThreadState_lock->is_locked(), "sanity check");
-  EC_TRACE(("JVMTI [*] # env initialize"));
+  EC_TRACE(("[*] # env initialize"));
 
   if (JvmtiEnvBase::is_vm_live()) {
     // if we didn't initialize event info already (this is a late
@@ -772,7 +773,7 @@
 void
 JvmtiEventControllerPrivate::env_dispose(JvmtiEnvBase *env) {
   assert(Threads::number_of_threads() == 0 || JvmtiThreadState_lock->is_locked(), "sanity check");
-  EC_TRACE(("JVMTI [*] # env dispose"));
+  EC_TRACE(("[*] # env dispose"));
 
   // Before the environment is marked disposed, disable all events on this
   // environment (by zapping the callbacks).  As a result, the disposed
@@ -794,7 +795,7 @@
                                           jvmtiEvent event_type, bool enabled) {
   assert(Threads::number_of_threads() == 0 || JvmtiThreadState_lock->is_locked(), "sanity check");
 
-  EC_TRACE(("JVMTI [%s] # user %s event %s",
+  EC_TRACE(("[%s] # user %s event %s",
             thread==NULL? "ALL": JvmtiTrace::safe_get_thread_name(thread),
             enabled? "enabled" : "disabled", JvmtiTrace::event_name(event_type)));
 
@@ -813,7 +814,7 @@
 
 void
 JvmtiEventControllerPrivate::set_frame_pop(JvmtiEnvThreadState *ets, JvmtiFramePop fpop) {
-  EC_TRACE(("JVMTI [%s] # set frame pop - frame=%d",
+  EC_TRACE(("[%s] # set frame pop - frame=%d",
             JvmtiTrace::safe_get_thread_name(ets->get_thread()),
             fpop.frame_number() ));
 
@@ -824,7 +825,7 @@
 
 void
 JvmtiEventControllerPrivate::clear_frame_pop(JvmtiEnvThreadState *ets, JvmtiFramePop fpop) {
-  EC_TRACE(("JVMTI [%s] # clear frame pop - frame=%d",
+  EC_TRACE(("[%s] # clear frame pop - frame=%d",
             JvmtiTrace::safe_get_thread_name(ets->get_thread()),
             fpop.frame_number() ));
 
@@ -837,7 +838,7 @@
 JvmtiEventControllerPrivate::clear_to_frame_pop(JvmtiEnvThreadState *ets, JvmtiFramePop fpop) {
   int cleared_cnt = ets->get_frame_pops()->clear_to(fpop);
 
-  EC_TRACE(("JVMTI [%s] # clear to frame pop - frame=%d, count=%d",
+  EC_TRACE(("[%s] # clear to frame pop - frame=%d, count=%d",
             JvmtiTrace::safe_get_thread_name(ets->get_thread()),
             fpop.frame_number(),
             cleared_cnt ));
@@ -863,7 +864,7 @@
     return;
   }
 
-  EC_TRACE(("JVMTI [-] # change field watch - %s %s count=%d",
+  EC_TRACE(("[-] # change field watch - %s %s count=%d",
             event_type==JVMTI_EVENT_FIELD_MODIFICATION? "modification" : "access",
             added? "add" : "remove",
             *count_addr));
@@ -893,7 +894,7 @@
     return;
   }
 
-  EC_TRACE(("JVMTI [-] # VM live"));
+  EC_TRACE(("[-] # VM live"));
 
 #ifdef ASSERT
   // check that our idea and the spec's idea of threaded events match
--- a/src/share/vm/prims/jvmtiExport.cpp	Tue Apr 19 12:30:00 2016 +0200
+++ b/src/share/vm/prims/jvmtiExport.cpp	Tue Apr 19 14:14:04 2016 +0200
@@ -29,6 +29,8 @@
 #include "code/scopeDesc.hpp"
 #include "interpreter/interpreter.hpp"
 #include "jvmtifiles/jvmtiEnv.hpp"
+#include "logging/log.hpp"
+#include "logging/logStream.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/objArrayKlass.hpp"
 #include "oops/objArrayOop.hpp"
@@ -60,8 +62,8 @@
 #endif // INCLUDE_ALL_GCS
 
 #ifdef JVMTI_TRACE
-#define EVT_TRACE(evt,out) if ((JvmtiTrace::event_trace_flags(evt) & JvmtiTrace::SHOW_EVENT_SENT) != 0) { SafeResourceMark rm; tty->print_cr out; }
-#define EVT_TRIG_TRACE(evt,out) if ((JvmtiTrace::event_trace_flags(evt) & JvmtiTrace::SHOW_EVENT_TRIGGER) != 0) { SafeResourceMark rm; tty->print_cr out; }
+#define EVT_TRACE(evt,out) if ((JvmtiTrace::event_trace_flags(evt) & JvmtiTrace::SHOW_EVENT_SENT) != 0) { SafeResourceMark rm; log_trace(jvmti) out; }
+#define EVT_TRIG_TRACE(evt,out) if ((JvmtiTrace::event_trace_flags(evt) & JvmtiTrace::SHOW_EVENT_TRIGGER) != 0) { SafeResourceMark rm; log_trace(jvmti) out; }
 #else
 #define EVT_TRIG_TRACE(evt,out)
 #define EVT_TRACE(evt,out)
@@ -423,7 +425,9 @@
                          THREAD);
 
   if (HAS_PENDING_EXCEPTION) {
-    java_lang_Throwable::print(PENDING_EXCEPTION, tty);
+    LogTarget(Trace, jvmti) log;
+    LogStreamCHeap log_stream(log);
+    java_lang_Throwable::print(PENDING_EXCEPTION, &log_stream);
     CLEAR_PENDING_EXCEPTION;
     return;
   }
@@ -465,7 +469,7 @@
 //
 
 void JvmtiExport::post_early_vm_start() {
-  EVT_TRIG_TRACE(JVMTI_EVENT_VM_START, ("JVMTI Trg Early VM start event triggered" ));
+  EVT_TRIG_TRACE(JVMTI_EVENT_VM_START, ("Trg Early VM start event triggered" ));
 
   // can now enable some events
   JvmtiEventController::vm_start();
@@ -474,7 +478,7 @@
   for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
     // Only early vmstart envs post early VMStart event
     if (env->early_vmstart_env() && env->is_enabled(JVMTI_EVENT_VM_START)) {
-      EVT_TRACE(JVMTI_EVENT_VM_START, ("JVMTI Evt Early VM start event sent" ));
+      EVT_TRACE(JVMTI_EVENT_VM_START, ("Evt Early VM start event sent" ));
       JavaThread *thread  = JavaThread::current();
       JvmtiThreadEventMark jem(thread);
       JvmtiJavaThreadEventTransition jet(thread);
@@ -487,7 +491,7 @@
 }
 
 void JvmtiExport::post_vm_start() {
-  EVT_TRIG_TRACE(JVMTI_EVENT_VM_START, ("JVMTI Trg VM start event triggered" ));
+  EVT_TRIG_TRACE(JVMTI_EVENT_VM_START, ("Trg VM start event triggered" ));
 
   // can now enable some events
   JvmtiEventController::vm_start();
@@ -496,7 +500,7 @@
   for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
     // Early vmstart envs do not post normal VMStart event
     if (!env->early_vmstart_env() && env->is_enabled(JVMTI_EVENT_VM_START)) {
-      EVT_TRACE(JVMTI_EVENT_VM_START, ("JVMTI Evt VM start event sent" ));
+      EVT_TRACE(JVMTI_EVENT_VM_START, ("Evt VM start event sent" ));
 
       JavaThread *thread  = JavaThread::current();
       JvmtiThreadEventMark jem(thread);
@@ -511,7 +515,7 @@
 
 
 void JvmtiExport::post_vm_initialized() {
-  EVT_TRIG_TRACE(JVMTI_EVENT_VM_INIT, ("JVMTI Trg VM init event triggered" ));
+  EVT_TRIG_TRACE(JVMTI_EVENT_VM_INIT, ("Trg VM init event triggered" ));
 
   // can now enable events
   JvmtiEventController::vm_init();
@@ -519,7 +523,7 @@
   JvmtiEnvIterator it;
   for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
     if (env->is_enabled(JVMTI_EVENT_VM_INIT)) {
-      EVT_TRACE(JVMTI_EVENT_VM_INIT, ("JVMTI Evt VM init event sent" ));
+      EVT_TRACE(JVMTI_EVENT_VM_INIT, ("Evt VM init event sent" ));
 
       JavaThread *thread  = JavaThread::current();
       JvmtiThreadEventMark jem(thread);
@@ -534,12 +538,12 @@
 
 
 void JvmtiExport::post_vm_death() {
-  EVT_TRIG_TRACE(JVMTI_EVENT_VM_DEATH, ("JVMTI Trg VM death event triggered" ));
+  EVT_TRIG_TRACE(JVMTI_EVENT_VM_DEATH, ("Trg VM death event triggered" ));
 
   JvmtiEnvIterator it;
   for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
     if (env->is_enabled(JVMTI_EVENT_VM_DEATH)) {
-      EVT_TRACE(JVMTI_EVENT_VM_DEATH, ("JVMTI Evt VM death event sent" ));
+      EVT_TRACE(JVMTI_EVENT_VM_DEATH, ("Evt VM death event sent" ));
 
       JavaThread *thread  = JavaThread::current();
       JvmtiEventMark jem(thread);
@@ -632,9 +636,6 @@
   }
 
   void post() {
-//    EVT_TRIG_TRACE(JVMTI_EVENT_CLASS_FILE_LOAD_HOOK,
-//                   ("JVMTI [%s] class file load hook event triggered",
-//                    JvmtiTrace::safe_get_thread_name(_thread)));
     post_all_envs();
     copy_modified_data();
   }
@@ -670,11 +671,6 @@
     }
     unsigned char *new_data = NULL;
     jint new_len = 0;
-//    EVT_TRACE(JVMTI_EVENT_CLASS_FILE_LOAD_HOOK,
-//     ("JVMTI [%s] class file load hook event sent %s  data_ptr = %d, data_len = %d",
-//               JvmtiTrace::safe_get_thread_name(_thread),
-//               _h_name == NULL ? "NULL" : _h_name->as_utf8(),
-//               _curr_data, _curr_len ));
     JvmtiClassFileLoadEventMark jem(_thread, _h_name, _class_loader,
                                     _h_protection_domain,
                                     _h_class_being_redefined);
@@ -840,7 +836,7 @@
   }
   JavaThread* thread = JavaThread::current();
   EVT_TRIG_TRACE(JVMTI_EVENT_COMPILED_METHOD_UNLOAD,
-                 ("JVMTI [%s] method compile unload event triggered",
+                 ("[%s] method compile unload event triggered",
                   JvmtiTrace::safe_get_thread_name(thread)));
 
   // post the event for each environment that has this event enabled.
@@ -851,7 +847,7 @@
         continue;
       }
       EVT_TRACE(JVMTI_EVENT_COMPILED_METHOD_UNLOAD,
-                ("JVMTI [%s] class compile method unload event sent jmethodID " PTR_FORMAT,
+                ("[%s] class compile method unload event sent jmethodID " PTR_FORMAT,
                  JvmtiTrace::safe_get_thread_name(thread), p2i(method)));
 
       ResourceMark rm(thread);
@@ -879,7 +875,7 @@
   if (state == NULL) {
     return;
   }
-  EVT_TRIG_TRACE(JVMTI_EVENT_BREAKPOINT, ("JVMTI [%s] Trg Breakpoint triggered",
+  EVT_TRIG_TRACE(JVMTI_EVENT_BREAKPOINT, ("[%s] Trg Breakpoint triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
   JvmtiEnvThreadStateIterator it(state);
   for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
@@ -887,7 +883,7 @@
     if (!ets->breakpoint_posted() && ets->is_enabled(JVMTI_EVENT_BREAKPOINT)) {
       ThreadState old_os_state = thread->osthread()->get_state();
       thread->osthread()->set_state(BREAKPOINTED);
-      EVT_TRACE(JVMTI_EVENT_BREAKPOINT, ("JVMTI [%s] Evt Breakpoint sent %s.%s @ " INTX_FORMAT,
+      EVT_TRACE(JVMTI_EVENT_BREAKPOINT, ("[%s] Evt Breakpoint sent %s.%s @ " INTX_FORMAT,
                      JvmtiTrace::safe_get_thread_name(thread),
                      (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                      (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),
@@ -965,7 +961,7 @@
   if (state == NULL) {
     return;
   }
-  EVT_TRIG_TRACE(JVMTI_EVENT_SINGLE_STEP, ("JVMTI [%s] Trg Single Step triggered",
+  EVT_TRIG_TRACE(JVMTI_EVENT_SINGLE_STEP, ("[%s] Trg Single Step triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
   if (!state->hide_single_stepping()) {
     if (state->is_pending_step_for_popframe()) {
@@ -1004,7 +1000,7 @@
   HandleMark hm(thread);
   KlassHandle kh(thread, klass);
 
-  EVT_TRIG_TRACE(JVMTI_EVENT_CLASS_LOAD, ("JVMTI [%s] Trg Class Load triggered",
+  EVT_TRIG_TRACE(JVMTI_EVENT_CLASS_LOAD, ("[%s] Trg Class Load triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
   JvmtiThreadState* state = thread->jvmti_thread_state();
   if (state == NULL) {
@@ -1017,7 +1013,7 @@
       if (env->phase() == JVMTI_PHASE_PRIMORDIAL) {
         continue;
       }
-      EVT_TRACE(JVMTI_EVENT_CLASS_LOAD, ("JVMTI [%s] Evt Class Load sent %s",
+      EVT_TRACE(JVMTI_EVENT_CLASS_LOAD, ("[%s] Evt Class Load sent %s",
                                          JvmtiTrace::safe_get_thread_name(thread),
                                          kh()==NULL? "NULL" : kh()->external_name() ));
       JvmtiClassEventMark jem(thread, kh());
@@ -1038,7 +1034,7 @@
   HandleMark hm(thread);
   KlassHandle kh(thread, klass);
 
-  EVT_TRIG_TRACE(JVMTI_EVENT_CLASS_PREPARE, ("JVMTI [%s] Trg Class Prepare triggered",
+  EVT_TRIG_TRACE(JVMTI_EVENT_CLASS_PREPARE, ("[%s] Trg Class Prepare triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
   JvmtiThreadState* state = thread->jvmti_thread_state();
   if (state == NULL) {
@@ -1051,7 +1047,7 @@
       if (env->phase() == JVMTI_PHASE_PRIMORDIAL) {
         continue;
       }
-      EVT_TRACE(JVMTI_EVENT_CLASS_PREPARE, ("JVMTI [%s] Evt Class Prepare sent %s",
+      EVT_TRACE(JVMTI_EVENT_CLASS_PREPARE, ("[%s] Evt Class Prepare sent %s",
                                             JvmtiTrace::safe_get_thread_name(thread),
                                             kh()==NULL? "NULL" : kh()->external_name() ));
       JvmtiClassEventMark jem(thread, kh());
@@ -1072,7 +1068,7 @@
   HandleMark hm(thread);
   KlassHandle kh(thread, klass);
 
-  EVT_TRIG_TRACE(EXT_EVENT_CLASS_UNLOAD, ("JVMTI [?] Trg Class Unload triggered" ));
+  EVT_TRIG_TRACE(EXT_EVENT_CLASS_UNLOAD, ("[?] Trg Class Unload triggered" ));
   if (JvmtiEventController::is_enabled((jvmtiEvent)EXT_EVENT_CLASS_UNLOAD)) {
     assert(thread->is_VM_thread(), "wrong thread");
 
@@ -1086,7 +1082,7 @@
         continue;
       }
       if (env->is_enabled((jvmtiEvent)EXT_EVENT_CLASS_UNLOAD)) {
-        EVT_TRACE(EXT_EVENT_CLASS_UNLOAD, ("JVMTI [?] Evt Class Unload sent %s",
+        EVT_TRACE(EXT_EVENT_CLASS_UNLOAD, ("[?] Evt Class Unload sent %s",
                   kh()==NULL? "NULL" : kh()->external_name() ));
 
         // do everything manually, since this is a proxy - needs special care
@@ -1125,7 +1121,7 @@
   }
   assert(thread->thread_state() == _thread_in_vm, "must be in vm state");
 
-  EVT_TRIG_TRACE(JVMTI_EVENT_THREAD_START, ("JVMTI [%s] Trg Thread Start event triggered",
+  EVT_TRIG_TRACE(JVMTI_EVENT_THREAD_START, ("[%s] Trg Thread Start event triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
 
   // do JVMTI thread initialization (if needed)
@@ -1140,7 +1136,7 @@
         continue;
       }
       if (env->is_enabled(JVMTI_EVENT_THREAD_START)) {
-        EVT_TRACE(JVMTI_EVENT_THREAD_START, ("JVMTI [%s] Evt Thread Start event sent",
+        EVT_TRACE(JVMTI_EVENT_THREAD_START, ("[%s] Evt Thread Start event sent",
                      JvmtiTrace::safe_get_thread_name(thread) ));
 
         JvmtiThreadEventMark jem(thread);
@@ -1159,7 +1155,7 @@
   if (JvmtiEnv::get_phase() < JVMTI_PHASE_PRIMORDIAL) {
     return;
   }
-  EVT_TRIG_TRACE(JVMTI_EVENT_THREAD_END, ("JVMTI [%s] Trg Thread End event triggered",
+  EVT_TRIG_TRACE(JVMTI_EVENT_THREAD_END, ("[%s] Trg Thread End event triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
 
   JvmtiThreadState *state = thread->jvmti_thread_state();
@@ -1178,7 +1174,7 @@
         if (env->phase() == JVMTI_PHASE_PRIMORDIAL) {
           continue;
         }
-        EVT_TRACE(JVMTI_EVENT_THREAD_END, ("JVMTI [%s] Evt Thread End event sent",
+        EVT_TRACE(JVMTI_EVENT_THREAD_END, ("[%s] Evt Thread End event sent",
                      JvmtiTrace::safe_get_thread_name(thread) ));
 
         JvmtiThreadEventMark jem(thread);
@@ -1196,8 +1192,8 @@
   assert(SafepointSynchronize::is_at_safepoint(), "must be executed at safepoint");
   assert(env->is_enabled(JVMTI_EVENT_OBJECT_FREE), "checking");
 
-  EVT_TRIG_TRACE(JVMTI_EVENT_OBJECT_FREE, ("JVMTI [?] Trg Object Free triggered" ));
-  EVT_TRACE(JVMTI_EVENT_OBJECT_FREE, ("JVMTI [?] Evt Object Free sent"));
+  EVT_TRIG_TRACE(JVMTI_EVENT_OBJECT_FREE, ("[?] Trg Object Free triggered" ));
+  EVT_TRACE(JVMTI_EVENT_OBJECT_FREE, ("[?] Evt Object Free sent"));
 
   jvmtiEventObjectFree callback = env->callbacks()->ObjectFree;
   if (callback != NULL) {
@@ -1206,12 +1202,12 @@
 }
 
 void JvmtiExport::post_resource_exhausted(jint resource_exhausted_flags, const char* description) {
-  EVT_TRIG_TRACE(JVMTI_EVENT_RESOURCE_EXHAUSTED, ("JVMTI Trg resource exhausted event triggered" ));
+  EVT_TRIG_TRACE(JVMTI_EVENT_RESOURCE_EXHAUSTED, ("Trg resource exhausted event triggered" ));
 
   JvmtiEnvIterator it;
   for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
     if (env->is_enabled(JVMTI_EVENT_RESOURCE_EXHAUSTED)) {
-      EVT_TRACE(JVMTI_EVENT_RESOURCE_EXHAUSTED, ("JVMTI Evt resource exhausted event sent" ));
+      EVT_TRACE(JVMTI_EVENT_RESOURCE_EXHAUSTED, ("Evt resource exhausted event sent" ));
 
       JavaThread *thread  = JavaThread::current();
       JvmtiThreadEventMark jem(thread);
@@ -1229,7 +1225,7 @@
   HandleMark hm(thread);
   methodHandle mh(thread, method);
 
-  EVT_TRIG_TRACE(JVMTI_EVENT_METHOD_ENTRY, ("JVMTI [%s] Trg Method Entry triggered %s.%s",
+  EVT_TRIG_TRACE(JVMTI_EVENT_METHOD_ENTRY, ("[%s] Trg Method Entry triggered %s.%s",
                      JvmtiTrace::safe_get_thread_name(thread),
                      (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                      (mh() == NULL) ? "NULL" : mh()->name()->as_C_string() ));
@@ -1246,7 +1242,7 @@
     JvmtiEnvThreadStateIterator it(state);
     for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
       if (ets->is_enabled(JVMTI_EVENT_METHOD_ENTRY)) {
-        EVT_TRACE(JVMTI_EVENT_METHOD_ENTRY, ("JVMTI [%s] Evt Method Entry sent %s.%s",
+        EVT_TRACE(JVMTI_EVENT_METHOD_ENTRY, ("[%s] Evt Method Entry sent %s.%s",
                                              JvmtiTrace::safe_get_thread_name(thread),
                                              (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                                              (mh() == NULL) ? "NULL" : mh()->name()->as_C_string() ));
@@ -1267,7 +1263,7 @@
   HandleMark hm(thread);
   methodHandle mh(thread, method);
 
-  EVT_TRIG_TRACE(JVMTI_EVENT_METHOD_EXIT, ("JVMTI [%s] Trg Method Exit triggered %s.%s",
+  EVT_TRIG_TRACE(JVMTI_EVENT_METHOD_EXIT, ("[%s] Trg Method Exit triggered %s.%s",
                      JvmtiTrace::safe_get_thread_name(thread),
                      (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                      (mh() == NULL) ? "NULL" : mh()->name()->as_C_string() ));
@@ -1303,7 +1299,7 @@
     JvmtiEnvThreadStateIterator it(state);
     for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
       if (ets->is_enabled(JVMTI_EVENT_METHOD_EXIT)) {
-        EVT_TRACE(JVMTI_EVENT_METHOD_EXIT, ("JVMTI [%s] Evt Method Exit sent %s.%s",
+        EVT_TRACE(JVMTI_EVENT_METHOD_EXIT, ("[%s] Evt Method Exit sent %s.%s",
                                             JvmtiTrace::safe_get_thread_name(thread),
                                             (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                                             (mh() == NULL) ? "NULL" : mh()->name()->as_C_string() ));
@@ -1332,7 +1328,7 @@
         // we have a NotifyFramePop entry for this frame.
         // now check that this env/thread wants this event
         if (ets->is_enabled(JVMTI_EVENT_FRAME_POP)) {
-          EVT_TRACE(JVMTI_EVENT_FRAME_POP, ("JVMTI [%s] Evt Frame Pop sent %s.%s",
+          EVT_TRACE(JVMTI_EVENT_FRAME_POP, ("[%s] Evt Frame Pop sent %s.%s",
                                             JvmtiTrace::safe_get_thread_name(thread),
                                             (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                                             (mh() == NULL) ? "NULL" : mh()->name()->as_C_string() ));
@@ -1370,7 +1366,7 @@
   for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
     ets->compare_and_set_current_location(mh(), location, JVMTI_EVENT_SINGLE_STEP);
     if (!ets->single_stepping_posted() && ets->is_enabled(JVMTI_EVENT_SINGLE_STEP)) {
-      EVT_TRACE(JVMTI_EVENT_SINGLE_STEP, ("JVMTI [%s] Evt Single Step sent %s.%s @ " INTX_FORMAT,
+      EVT_TRACE(JVMTI_EVENT_SINGLE_STEP, ("[%s] Evt Single Step sent %s.%s @ " INTX_FORMAT,
                     JvmtiTrace::safe_get_thread_name(thread),
                     (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                     (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),
@@ -1401,7 +1397,7 @@
     return;
   }
 
-  EVT_TRIG_TRACE(JVMTI_EVENT_EXCEPTION, ("JVMTI [%s] Trg Exception thrown triggered",
+  EVT_TRIG_TRACE(JVMTI_EVENT_EXCEPTION, ("[%s] Trg Exception thrown triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
   if (!state->is_exception_detected()) {
     state->set_exception_detected();
@@ -1410,7 +1406,7 @@
       if (ets->is_enabled(JVMTI_EVENT_EXCEPTION) && (exception != NULL)) {
 
         EVT_TRACE(JVMTI_EVENT_EXCEPTION,
-                     ("JVMTI [%s] Evt Exception thrown sent %s.%s @ " INTX_FORMAT,
+                     ("[%s] Evt Exception thrown sent %s.%s @ " INTX_FORMAT,
                       JvmtiTrace::safe_get_thread_name(thread),
                       (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                       (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),
@@ -1486,7 +1482,7 @@
     return;
   }
   EVT_TRIG_TRACE(JVMTI_EVENT_EXCEPTION_CATCH,
-                    ("JVMTI [%s] Trg unwind_due_to_exception triggered %s.%s @ %s" INTX_FORMAT " - %s",
+                    ("[%s] Trg unwind_due_to_exception triggered %s.%s @ %s" INTX_FORMAT " - %s",
                      JvmtiTrace::safe_get_thread_name(thread),
                      (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                      (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),
@@ -1521,7 +1517,7 @@
       for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
         if (ets->is_enabled(JVMTI_EVENT_EXCEPTION_CATCH) && (exception_handle() != NULL)) {
           EVT_TRACE(JVMTI_EVENT_EXCEPTION_CATCH,
-                     ("JVMTI [%s] Evt ExceptionCatch sent %s.%s @ " INTX_FORMAT,
+                     ("[%s] Evt ExceptionCatch sent %s.%s @ " INTX_FORMAT,
                       JvmtiTrace::safe_get_thread_name(thread),
                       (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                       (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),
@@ -1610,12 +1606,12 @@
   if (state == NULL) {
     return;
   }
-  EVT_TRIG_TRACE(JVMTI_EVENT_FIELD_ACCESS, ("JVMTI [%s] Trg Field Access event triggered",
+  EVT_TRIG_TRACE(JVMTI_EVENT_FIELD_ACCESS, ("[%s] Trg Field Access event triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
   JvmtiEnvThreadStateIterator it(state);
   for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
     if (ets->is_enabled(JVMTI_EVENT_FIELD_ACCESS)) {
-      EVT_TRACE(JVMTI_EVENT_FIELD_ACCESS, ("JVMTI [%s] Evt Field Access event sent %s.%s @ " INTX_FORMAT,
+      EVT_TRACE(JVMTI_EVENT_FIELD_ACCESS, ("[%s] Evt Field Access event sent %s.%s @ " INTX_FORMAT,
                      JvmtiTrace::safe_get_thread_name(thread),
                      (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                      (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),
@@ -1772,14 +1768,14 @@
     return;
   }
   EVT_TRIG_TRACE(JVMTI_EVENT_FIELD_MODIFICATION,
-                     ("JVMTI [%s] Trg Field Modification event triggered",
+                     ("[%s] Trg Field Modification event triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
 
   JvmtiEnvThreadStateIterator it(state);
   for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
     if (ets->is_enabled(JVMTI_EVENT_FIELD_MODIFICATION)) {
       EVT_TRACE(JVMTI_EVENT_FIELD_MODIFICATION,
-                   ("JVMTI [%s] Evt Field Modification event sent %s.%s @ " INTX_FORMAT,
+                   ("[%s] Evt Field Modification event sent %s.%s @ " INTX_FORMAT,
                     JvmtiTrace::safe_get_thread_name(thread),
                     (mh() == NULL) ? "NULL" : mh()->klass_name()->as_C_string(),
                     (mh() == NULL) ? "NULL" : mh()->name()->as_C_string(),
@@ -1807,14 +1803,14 @@
   HandleMark hm(thread);
   methodHandle mh(thread, method);
 
-  EVT_TRIG_TRACE(JVMTI_EVENT_NATIVE_METHOD_BIND, ("JVMTI [%s] Trg Native Method Bind event triggered",
+  EVT_TRIG_TRACE(JVMTI_EVENT_NATIVE_METHOD_BIND, ("[%s] Trg Native Method Bind event triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
 
   if (JvmtiEventController::is_enabled(JVMTI_EVENT_NATIVE_METHOD_BIND)) {
     JvmtiEnvIterator it;
     for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
       if (env->is_enabled(JVMTI_EVENT_NATIVE_METHOD_BIND)) {
-        EVT_TRACE(JVMTI_EVENT_NATIVE_METHOD_BIND, ("JVMTI [%s] Evt Native Method Bind event sent",
+        EVT_TRACE(JVMTI_EVENT_NATIVE_METHOD_BIND, ("[%s] Evt Native Method Bind event sent",
                      JvmtiTrace::safe_get_thread_name(thread) ));
 
         JvmtiMethodEventMark jem(thread, mh);
@@ -1878,7 +1874,7 @@
   JavaThread* thread = JavaThread::current();
 
   EVT_TRIG_TRACE(JVMTI_EVENT_COMPILED_METHOD_LOAD,
-                 ("JVMTI [%s] method compile load event triggered",
+                 ("[%s] method compile load event triggered",
                  JvmtiTrace::safe_get_thread_name(thread)));
 
   JvmtiEnvIterator it;
@@ -1888,7 +1884,7 @@
         continue;
       }
       EVT_TRACE(JVMTI_EVENT_COMPILED_METHOD_LOAD,
-                ("JVMTI [%s] class compile method load event sent %s.%s  ",
+                ("[%s] class compile method load event sent %s.%s  ",
                 JvmtiTrace::safe_get_thread_name(thread),
                 (nm->method() == NULL) ? "NULL" : nm->method()->klass_name()->as_C_string(),
                 (nm->method() == NULL) ? "NULL" : nm->method()->name()->as_C_string()));
@@ -1921,12 +1917,12 @@
   }
   JavaThread* thread = JavaThread::current();
   EVT_TRIG_TRACE(JVMTI_EVENT_COMPILED_METHOD_LOAD,
-                 ("JVMTI [%s] method compile load event triggered (by GenerateEvents)",
+                 ("[%s] method compile load event triggered (by GenerateEvents)",
                  JvmtiTrace::safe_get_thread_name(thread)));
   if (env->is_enabled(JVMTI_EVENT_COMPILED_METHOD_LOAD)) {
 
     EVT_TRACE(JVMTI_EVENT_COMPILED_METHOD_LOAD,
-              ("JVMTI [%s] class compile method load event sent (by GenerateEvents), jmethodID=" PTR_FORMAT,
+              ("[%s] class compile method load event sent (by GenerateEvents), jmethodID=" PTR_FORMAT,
                JvmtiTrace::safe_get_thread_name(thread), p2i(method)));
 
     JvmtiEventMark jem(thread);
@@ -1949,13 +1945,13 @@
   ThreadInVMfromUnknown __tiv;
 
   EVT_TRIG_TRACE(JVMTI_EVENT_DYNAMIC_CODE_GENERATED,
-                 ("JVMTI [%s] method dynamic code generated event triggered",
+                 ("[%s] method dynamic code generated event triggered",
                  JvmtiTrace::safe_get_thread_name(thread)));
   JvmtiEnvIterator it;
   for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
     if (env->is_enabled(JVMTI_EVENT_DYNAMIC_CODE_GENERATED)) {
       EVT_TRACE(JVMTI_EVENT_DYNAMIC_CODE_GENERATED,
-                ("JVMTI [%s] dynamic code generated event sent for %s",
+                ("[%s] dynamic code generated event sent for %s",
                 JvmtiTrace::safe_get_thread_name(thread), name));
       JvmtiEventMark jem(thread);
       JvmtiJavaThreadEventTransition jet(thread);
@@ -1991,11 +1987,11 @@
 {
   JavaThread* thread = JavaThread::current();
   EVT_TRIG_TRACE(JVMTI_EVENT_DYNAMIC_CODE_GENERATED,
-                 ("JVMTI [%s] dynamic code generated event triggered (by GenerateEvents)",
+                 ("[%s] dynamic code generated event triggered (by GenerateEvents)",
                   JvmtiTrace::safe_get_thread_name(thread)));
   if (env->is_enabled(JVMTI_EVENT_DYNAMIC_CODE_GENERATED)) {
     EVT_TRACE(JVMTI_EVENT_DYNAMIC_CODE_GENERATED,
-              ("JVMTI [%s] dynamic code generated event sent for %s",
+              ("[%s] dynamic code generated event sent for %s",
                JvmtiTrace::safe_get_thread_name(thread), name));
     JvmtiEventMark jem(thread);
     JvmtiJavaThreadEventTransition jet(thread);
@@ -2048,13 +2044,13 @@
 void JvmtiExport::post_garbage_collection_finish() {
   Thread *thread = Thread::current(); // this event is posted from VM-Thread.
   EVT_TRIG_TRACE(JVMTI_EVENT_GARBAGE_COLLECTION_FINISH,
-                 ("JVMTI [%s] garbage collection finish event triggered",
+                 ("[%s] garbage collection finish event triggered",
                   JvmtiTrace::safe_get_thread_name(thread)));
   JvmtiEnvIterator it;
   for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
     if (env->is_enabled(JVMTI_EVENT_GARBAGE_COLLECTION_FINISH)) {
       EVT_TRACE(JVMTI_EVENT_GARBAGE_COLLECTION_FINISH,
-                ("JVMTI [%s] garbage collection finish event sent ",
+                ("[%s] garbage collection finish event sent",
                  JvmtiTrace::safe_get_thread_name(thread)));
       JvmtiThreadEventTransition jet(thread);
       // JNIEnv is NULL here because this event is posted from VM Thread
@@ -2069,13 +2065,13 @@
 void JvmtiExport::post_garbage_collection_start() {
   Thread* thread = Thread::current(); // this event is posted from vm-thread.
   EVT_TRIG_TRACE(JVMTI_EVENT_GARBAGE_COLLECTION_START,
-                 ("JVMTI [%s] garbage collection start event triggered",
+                 ("[%s] garbage collection start event triggered",
                   JvmtiTrace::safe_get_thread_name(thread)));
   JvmtiEnvIterator it;
   for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
     if (env->is_enabled(JVMTI_EVENT_GARBAGE_COLLECTION_START)) {
       EVT_TRACE(JVMTI_EVENT_GARBAGE_COLLECTION_START,
-                ("JVMTI [%s] garbage collection start event sent ",
+                ("[%s] garbage collection start event sent",
                  JvmtiTrace::safe_get_thread_name(thread)));
       JvmtiThreadEventTransition jet(thread);
       // JNIEnv is NULL here because this event is posted from VM Thread
@@ -2090,13 +2086,13 @@
 void JvmtiExport::post_data_dump() {
   Thread *thread = Thread::current();
   EVT_TRIG_TRACE(JVMTI_EVENT_DATA_DUMP_REQUEST,
-                 ("JVMTI [%s] data dump request event triggered",
+                 ("[%s] data dump request event triggered",
                   JvmtiTrace::safe_get_thread_name(thread)));
   JvmtiEnvIterator it;
   for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
     if (env->is_enabled(JVMTI_EVENT_DATA_DUMP_REQUEST)) {
       EVT_TRACE(JVMTI_EVENT_DATA_DUMP_REQUEST,
-                ("JVMTI [%s] data dump request event sent ",
+                ("[%s] data dump request event sent",
                  JvmtiTrace::safe_get_thread_name(thread)));
      JvmtiThreadEventTransition jet(thread);
      // JNIEnv is NULL here because this event is posted from VM Thread
@@ -2123,14 +2119,14 @@
   Handle h(thread, object);
 
   EVT_TRIG_TRACE(JVMTI_EVENT_MONITOR_CONTENDED_ENTER,
-                     ("JVMTI [%s] montior contended enter event triggered",
+                     ("[%s] montior contended enter event triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
 
   JvmtiEnvThreadStateIterator it(state);
   for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
     if (ets->is_enabled(JVMTI_EVENT_MONITOR_CONTENDED_ENTER)) {
       EVT_TRACE(JVMTI_EVENT_MONITOR_CONTENDED_ENTER,
-                   ("JVMTI [%s] monitor contended enter event sent",
+                   ("[%s] monitor contended enter event sent",
                     JvmtiTrace::safe_get_thread_name(thread)));
       JvmtiMonitorEventMark  jem(thread, h());
       JvmtiEnv *env = ets->get_env();
@@ -2158,14 +2154,14 @@
   Handle h(thread, object);
 
   EVT_TRIG_TRACE(JVMTI_EVENT_MONITOR_CONTENDED_ENTERED,
-                     ("JVMTI [%s] montior contended entered event triggered",
+                     ("[%s] montior contended entered event triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
 
   JvmtiEnvThreadStateIterator it(state);
   for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
     if (ets->is_enabled(JVMTI_EVENT_MONITOR_CONTENDED_ENTERED)) {
       EVT_TRACE(JVMTI_EVENT_MONITOR_CONTENDED_ENTERED,
-                   ("JVMTI [%s] monitor contended enter event sent",
+                   ("[%s] monitor contended enter event sent",
                     JvmtiTrace::safe_get_thread_name(thread)));
       JvmtiMonitorEventMark  jem(thread, h());
       JvmtiEnv *env = ets->get_env();
@@ -2189,14 +2185,14 @@
   Handle h(thread, object);
 
   EVT_TRIG_TRACE(JVMTI_EVENT_MONITOR_WAIT,
-                     ("JVMTI [%s] montior wait event triggered",
+                     ("[%s] montior wait event triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
 
   JvmtiEnvThreadStateIterator it(state);
   for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
     if (ets->is_enabled(JVMTI_EVENT_MONITOR_WAIT)) {
       EVT_TRACE(JVMTI_EVENT_MONITOR_WAIT,
-                   ("JVMTI [%s] monitor wait event sent ",
+                   ("[%s] monitor wait event sent",
                     JvmtiTrace::safe_get_thread_name(thread)));
       JvmtiMonitorEventMark  jem(thread, h());
       JvmtiEnv *env = ets->get_env();
@@ -2225,14 +2221,14 @@
   Handle h(thread, object);
 
   EVT_TRIG_TRACE(JVMTI_EVENT_MONITOR_WAITED,
-                     ("JVMTI [%s] montior waited event triggered",
+                     ("[%s] montior waited event triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
 
   JvmtiEnvThreadStateIterator it(state);
   for (JvmtiEnvThreadState* ets = it.first(); ets != NULL; ets = it.next(ets)) {
     if (ets->is_enabled(JVMTI_EVENT_MONITOR_WAITED)) {
       EVT_TRACE(JVMTI_EVENT_MONITOR_WAITED,
-                   ("JVMTI [%s] monitor waited event sent ",
+                   ("[%s] monitor waited event sent",
                     JvmtiTrace::safe_get_thread_name(thread)));
       JvmtiMonitorEventMark  jem(thread, h());
       JvmtiEnv *env = ets->get_env();
@@ -2248,7 +2244,7 @@
 
 
 void JvmtiExport::post_vm_object_alloc(JavaThread *thread,  oop object) {
-  EVT_TRIG_TRACE(JVMTI_EVENT_VM_OBJECT_ALLOC, ("JVMTI [%s] Trg vm object alloc triggered",
+  EVT_TRIG_TRACE(JVMTI_EVENT_VM_OBJECT_ALLOC, ("[%s] Trg vm object alloc triggered",
                       JvmtiTrace::safe_get_thread_name(thread)));
   if (object == NULL) {
     return;
@@ -2258,7 +2254,7 @@
   JvmtiEnvIterator it;
   for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) {
     if (env->is_enabled(JVMTI_EVENT_VM_OBJECT_ALLOC)) {
-      EVT_TRACE(JVMTI_EVENT_VM_OBJECT_ALLOC, ("JVMTI [%s] Evt vmobject alloc sent %s",
+      EVT_TRACE(JVMTI_EVENT_VM_OBJECT_ALLOC, ("[%s] Evt vmobject alloc sent %s",
                                          JvmtiTrace::safe_get_thread_name(thread),
                                          object==NULL? "NULL" : object->klass()->external_name()));
 
--- a/src/share/vm/prims/jvmtiImpl.cpp	Tue Apr 19 12:30:00 2016 +0200
+++ b/src/share/vm/prims/jvmtiImpl.cpp	Tue Apr 19 14:14:04 2016 +0200
@@ -27,6 +27,8 @@
 #include "interpreter/interpreter.hpp"
 #include "interpreter/oopMapCache.hpp"
 #include "jvmtifiles/jvmtiEnv.hpp"
+#include "logging/log.hpp"
+#include "logging/logStream.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/oop.inline.hpp"
@@ -321,12 +323,12 @@
   each_method_version_do(&Method::clear_breakpoint);
 }
 
-void JvmtiBreakpoint::print() {
+void JvmtiBreakpoint::print(outputStream* out) {
 #ifndef PRODUCT
+  ResourceMark rm;
   const char *class_name  = (_method == NULL) ? "NULL" : _method->klass_name()->as_C_string();
   const char *method_name = (_method == NULL) ? "NULL" : _method->name()->as_C_string();
-
-  tty->print("Breakpoint(%s,%s,%d,%p)",class_name, method_name, _bci, getBcp());
+  out->print("Breakpoint(%s,%s,%d,%p)", class_name, method_name, _bci, getBcp());
 #endif
 }
 
@@ -389,16 +391,17 @@
   _bps.gc_epilogue();
 }
 
-void  JvmtiBreakpoints::print() {
+void JvmtiBreakpoints::print() {
 #ifndef PRODUCT
-  ResourceMark rm;
+  LogTarget(Trace, jvmti) log;
+  LogStreamCHeap log_stream(log);
 
   int n = _bps.length();
   for (int i=0; i<n; i++) {
     JvmtiBreakpoint& bp = _bps.at(i);
-    tty->print("%d: ", i);
-    bp.print();
-    tty->cr();
+    log_stream.print("%d: ", i);
+    bp.print(&log_stream);
+    log_stream.cr();
   }
 #endif
 }
@@ -875,22 +878,21 @@
 void JvmtiSuspendControl::print() {
 #ifndef PRODUCT
   MutexLocker mu(Threads_lock);
-  ResourceMark rm;
-
-  tty->print("Suspended Threads: [");
+  LogStreamHandle(Trace, jvmti) log_stream;
+  log_stream.print("Suspended Threads: [");
   for (JavaThread *thread = Threads::first(); thread != NULL; thread = thread->next()) {
 #ifdef JVMTI_TRACE
     const char *name   = JvmtiTrace::safe_get_thread_name(thread);
 #else
     const char *name   = "";
 #endif /*JVMTI_TRACE */
-    tty->print("%s(%c ", name, thread->is_being_ext_suspended() ? 'S' : '_');
+    log_stream.print("%s(%c ", name, thread->is_being_ext_suspended() ? 'S' : '_');
     if (!thread->has_last_Java_frame()) {
-      tty->print("no stack");
+      log_stream.print("no stack");
     }
-    tty->print(") ");
+    log_stream.print(") ");
   }
-  tty->print_cr("]");
+  log_stream.print_cr("]");
 #endif
 }
 
--- a/src/share/vm/prims/jvmtiImpl.hpp	Tue Apr 19 12:30:00 2016 +0200
+++ b/src/share/vm/prims/jvmtiImpl.hpp	Tue Apr 19 14:14:04 2016 +0200
@@ -34,6 +34,7 @@
 #include "prims/jvmtiUtil.hpp"
 #include "runtime/stackValueCollection.hpp"
 #include "runtime/vm_operations.hpp"
+#include "utilities/ostream.hpp"
 
 //
 // Forward Declarations
@@ -186,7 +187,7 @@
   void each_method_version_do(method_action meth_act);
   void set();
   void clear();
-  void print();
+  void print(outputStream* out);
 
   Method* method() { return _method; }
 
--- a/src/share/vm/prims/jvmtiManageCapabilities.cpp	Tue Apr 19 12:30:00 2016 +0200
+++ b/src/share/vm/prims/jvmtiManageCapabilities.cpp	Tue Apr 19 14:14:04 2016 +0200
@@ -24,8 +24,10 @@
 
 #include "precompiled.hpp"
 #include "jvmtifiles/jvmtiEnv.hpp"
+#include "logging/log.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "prims/jvmtiManageCapabilities.hpp"
+
 static const jint CAPA_SIZE = (JVMTI_INTERNAL_CAPABILITY_COUNT + 7) / 8;
 
   // capabilities which are always potentially available
@@ -373,87 +375,87 @@
 #ifndef PRODUCT
 
 void JvmtiManageCapabilities:: print(const jvmtiCapabilities* cap) {
-  tty->print_cr("----- capabilities -----");
+  log_trace(jvmti)("----- capabilities -----");
   if (cap->can_tag_objects)
-    tty->print_cr("can_tag_objects");
+    log_trace(jvmti)("can_tag_objects");
   if (cap->can_generate_field_modification_events)
-    tty->print_cr("can_generate_field_modification_events");
+    log_trace(jvmti)("can_generate_field_modification_events");
   if (cap->can_generate_field_access_events)
-    tty->print_cr("can_generate_field_access_events");
+    log_trace(jvmti)("can_generate_field_access_events");
   if (cap->can_get_bytecodes)
-    tty->print_cr("can_get_bytecodes");
+    log_trace(jvmti)("can_get_bytecodes");
   if (cap->can_get_synthetic_attribute)
-    tty->print_cr("can_get_synthetic_attribute");
+    log_trace(jvmti)("can_get_synthetic_attribute");
   if (cap->can_get_owned_monitor_info)
-    tty->print_cr("can_get_owned_monitor_info");
+    log_trace(jvmti)("can_get_owned_monitor_info");
   if (cap->can_get_current_contended_monitor)
-    tty->print_cr("can_get_current_contended_monitor");
+    log_trace(jvmti)("can_get_current_contended_monitor");
   if (cap->can_get_monitor_info)
-    tty->print_cr("can_get_monitor_info");
+    log_trace(jvmti)("can_get_monitor_info");
   if (cap->can_get_constant_pool)
-    tty->print_cr("can_get_constant_pool");
+    log_trace(jvmti)("can_get_constant_pool");
   if (cap->can_pop_frame)
-    tty->print_cr("can_pop_frame");
+    log_trace(jvmti)("can_pop_frame");
   if (cap->can_force_early_return)
-    tty->print_cr("can_force_early_return");
+    log_trace(jvmti)("can_force_early_return");
   if (cap->can_redefine_classes)
-    tty->print_cr("can_redefine_classes");
+    log_trace(jvmti)("can_redefine_classes");
   if (cap->can_retransform_classes)
-    tty->print_cr("can_retransform_classes");
+    log_trace(jvmti)("can_retransform_classes");
   if (cap->can_signal_thread)
-    tty->print_cr("can_signal_thread");
+    log_trace(jvmti)("can_signal_thread");
   if (cap->can_get_source_file_name)
-    tty->print_cr("can_get_source_file_name");
+    log_trace(jvmti)("can_get_source_file_name");
   if (cap->can_get_line_numbers)
-    tty->print_cr("can_get_line_numbers");
+    log_trace(jvmti)("can_get_line_numbers");
   if (cap->can_get_source_debug_extension)
-    tty->print_cr("can_get_source_debug_extension");
+    log_trace(jvmti)("can_get_source_debug_extension");
   if (cap->can_access_local_variables)
-    tty->print_cr("can_access_local_variables");
+    log_trace(jvmti)("can_access_local_variables");
   if (cap->can_maintain_original_method_order)
-    tty->print_cr("can_maintain_original_method_order");
+    log_trace(jvmti)("can_maintain_original_method_order");
   if (cap->can_generate_single_step_events)
-    tty->print_cr("can_generate_single_step_events");
+    log_trace(jvmti)("can_generate_single_step_events");
   if (cap->can_generate_exception_events)
-    tty->print_cr("can_generate_exception_events");
+    log_trace(jvmti)("can_generate_exception_events");
   if (cap->can_generate_frame_pop_events)
-    tty->print_cr("can_generate_frame_pop_events");
+    log_trace(jvmti)("can_generate_frame_pop_events");
   if (cap->can_generate_breakpoint_events)
-    tty->print_cr("can_generate_breakpoint_events");
+    log_trace(jvmti)("can_generate_breakpoint_events");
   if (cap->can_suspend)
-    tty->print_cr("can_suspend");
+    log_trace(jvmti)("can_suspend");
   if (cap->can_redefine_any_class )
-    tty->print_cr("can_redefine_any_class");
+    log_trace(jvmti)("can_redefine_any_class");
   if (cap->can_retransform_any_class )
-    tty->print_cr("can_retransform_any_class");
+    log_trace(jvmti)("can_retransform_any_class");
   if (cap->can_get_current_thread_cpu_time)
-    tty->print_cr("can_get_current_thread_cpu_time");
+    log_trace(jvmti)("can_get_current_thread_cpu_time");
   if (cap->can_get_thread_cpu_time)
-    tty->print_cr("can_get_thread_cpu_time");
+    log_trace(jvmti)("can_get_thread_cpu_time");
   if (cap->can_generate_method_entry_events)
-    tty->print_cr("can_generate_method_entry_events");
+    log_trace(jvmti)("can_generate_method_entry_events");
   if (cap->can_generate_method_exit_events)
-    tty->print_cr("can_generate_method_exit_events");
+    log_trace(jvmti)("can_generate_method_exit_events");
   if (cap->can_generate_all_class_hook_events)
-    tty->print_cr("can_generate_all_class_hook_events");
+    log_trace(jvmti)("can_generate_all_class_hook_events");
   if (cap->can_generate_compiled_method_load_events)
-    tty->print_cr("can_generate_compiled_method_load_events");
+    log_trace(jvmti)("can_generate_compiled_method_load_events");
   if (cap->can_generate_monitor_events)
-    tty->print_cr("can_generate_monitor_events");
+    log_trace(jvmti)("can_generate_monitor_events");
   if (cap->can_generate_vm_object_alloc_events)
-    tty->print_cr("can_generate_vm_object_alloc_events");
+    log_trace(jvmti)("can_generate_vm_object_alloc_events");
   if (cap->can_generate_native_method_bind_events)
-    tty->print_cr("can_generate_native_method_bind_events");
+    log_trace(jvmti)("can_generate_native_method_bind_events");
   if (cap->can_generate_garbage_collection_events)
-    tty->print_cr("can_generate_garbage_collection_events");
+    log_trace(jvmti)("can_generate_garbage_collection_events");
   if (cap->can_generate_object_free_events)
-    tty->print_cr("can_generate_object_free_events");
+    log_trace(jvmti)("can_generate_object_free_events");
   if (cap->can_generate_resource_exhaustion_heap_events)
-    tty->print_cr("can_generate_resource_exhaustion_heap_events");
+    log_trace(jvmti)("can_generate_resource_exhaustion_heap_events");
   if (cap->can_generate_resource_exhaustion_threads_events)
-    tty->print_cr("can_generate_resource_exhaustion_threads_events");
+    log_trace(jvmti)("can_generate_resource_exhaustion_threads_events");
   if (cap->can_generate_early_vmstart)
-    tty->print_cr("can_generate_early_vmstart");
+    log_trace(jvmti)("can_generate_early_vmstart");
 }
 
 #endif
--- a/src/share/vm/prims/jvmtiThreadState.cpp	Tue Apr 19 12:30:00 2016 +0200
+++ b/src/share/vm/prims/jvmtiThreadState.cpp	Tue Apr 19 14:14:04 2016 +0200
@@ -224,18 +224,11 @@
   RegisterMap reg_map(get_thread());
   javaVFrame *jvf = get_thread()->last_java_vframe(&reg_map);
   int n = 0;
-  // tty->print_cr("CSD: counting frames on %s ...",
-  //               JvmtiTrace::safe_get_thread_name(get_thread()));
   while (jvf != NULL) {
     Method* method = jvf->method();
-    // tty->print_cr("CSD: frame - method %s.%s - loc %d",
-    //               method->klass_name()->as_C_string(),
-    //               method->name()->as_C_string(),
-    //               jvf->bci() );
     jvf = jvf->java_sender();
     n++;
   }
-  // tty->print_cr("CSD: frame count: %d", n);
   return n;
 }
 
--- a/src/share/vm/prims/jvmtiTrace.cpp	Tue Apr 19 12:30:00 2016 +0200
+++ b/src/share/vm/prims/jvmtiTrace.cpp	Tue Apr 19 14:14:04 2016 +0200
@@ -24,6 +24,8 @@
 
 #include "precompiled.hpp"
 #include "jvmtifiles/jvmtiEnv.hpp"
+#include "logging/log.hpp"
+#include "logging/logConfiguration.hpp"
 #include "memory/resourceArea.hpp"
 #include "prims/jvmtiTrace.hpp"
 
@@ -80,6 +82,17 @@
   } else {
     curr = "";  // hack in fixed tracing here
   }
+
+  // Enable UL for JVMTI tracing
+  if (strlen(curr) > 0) {
+    if (!log_is_enabled(Trace, jvmti)) {
+      log_warning(arguments)("-XX:+TraceJVMTI specified, "
+         "but no log output configured for the 'jvmti' tag on Trace level. "
+         "Defaulting to -Xlog:jvmti=trace");
+      LogConfiguration::configure_stdout(LogLevel::Trace, true, LOG_TAGS(jvmti));
+    }
+  }
+
   very_end = curr + strlen(curr);
   while (curr < very_end) {
     const char *curr_end = strchr(curr, ',');
@@ -127,7 +140,7 @@
         bits |= SHOW_EVENT_SENT;
         break;
       default:
-        tty->print_cr("Invalid trace flag '%c'", *flags);
+        log_warning(jvmti)("Invalid trace flag '%c'", *flags);
         break;
       }
     }
@@ -152,7 +165,7 @@
       domain = ALL_EVENT | EVENT;
     } else if (len==2 && strncmp(curr, "ec", 2)==0) {
       _trace_event_controller = true;
-      tty->print_cr("JVMTI Tracing the event controller");
+      log_trace(jvmti)("Tracing the event controller");
     } else {
       domain = FUNC | EVENT;  // go searching
     }
@@ -161,9 +174,9 @@
     if (domain & FUNC) {
       if (domain & ALL_FUNC) {
         if (domain & EXCLUDE) {
-          tty->print("JVMTI Tracing all significant functions");
+          log_trace(jvmti)("Tracing all significant functions");
         } else {
-          tty->print_cr("JVMTI Tracing all functions");
+          log_trace(jvmti)("Tracing all functions");
         }
       }
       for (int i = 0; i <= _max_function_index; ++i) {
@@ -178,7 +191,7 @@
             if (fname != NULL) {
               size_t fnlen = strlen(fname);
               if (len==fnlen && strncmp(curr, fname, fnlen)==0) {
-                tty->print_cr("JVMTI Tracing the function: %s", fname);
+                log_trace(jvmti)("Tracing the function: %s", fname);
                 do_op = true;
               }
             }
@@ -196,7 +209,7 @@
     }
     if (domain & EVENT) {
       if (domain & ALL_EVENT) {
-        tty->print_cr("JVMTI Tracing all events");
+        log_trace(jvmti)("Tracing all events");
       }
       for (int i = 0; i <= _max_event_index; ++i) {
         bool do_op = false;
@@ -207,7 +220,7 @@
           if (ename != NULL) {
             size_t evtlen = strlen(ename);
             if (len==evtlen && strncmp(curr, ename, evtlen)==0) {
-              tty->print_cr("JVMTI Tracing the event: %s", ename);
+              log_trace(jvmti)("Tracing the event: %s", ename);
               do_op = true;
             }
           }
@@ -223,7 +236,7 @@
       }
     }
     if (!_on && (domain & (FUNC|EVENT))) {
-      tty->print_cr("JVMTI Trace domain not found");
+      log_warning(jvmti)("Trace domain not found");
     }
     curr = curr_end + 1;
   }