< prev index next >

src/share/vm/prims/jvm.cpp

Print this page

        

@@ -64,10 +64,11 @@
 #include "runtime/vm_operations.hpp"
 #include "services/attachListener.hpp"
 #include "services/management.hpp"
 #include "services/threadService.hpp"
 #include "trace/tracing.hpp"
+#include "evtrace/traceEvents.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/defaultStream.hpp"
 #include "utilities/dtrace.hpp"
 #include "utilities/events.hpp"
 #include "utilities/histogram.hpp"

@@ -3347,10 +3348,13 @@
 JVM_ENTRY(void, JVM_SetNativeThreadName(JNIEnv* env, jobject jthread, jstring name))
   JVMWrapper("JVM_SetNativeThreadName");
   ResourceMark rm(THREAD);
   oop java_thread = JNIHandles::resolve_non_null(jthread);
   JavaThread* thr = java_lang_Thread::thread(java_thread);
+  if (EnableEventTracing) {
+    TraceEvents::write_thread_name_change(thr);
+  }
   // Thread naming only supported for the current thread, doesn't work for
   // target threads.
   if (Thread::current() == thr && !thr->has_attached_via_jni()) {
     // we don't set the name of an attached thread to avoid stepping
     // on other programs
< prev index next >