< prev index next >

src/share/vm/runtime/thread.cpp

Print this page
rev 8910 : full patch for jfr

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -1668,11 +1668,11 @@
     JvmtiExport::post_thread_start(this);
   }
 
   EventThreadStart event;
   if (event.should_commit()) {
-     event.set_javalangthread(java_lang_Thread::thread_id(this->threadObj()));
+     event.set_thread(THREAD_TRACE_ID(this));
      event.commit();
   }
 
   // We call another function to do the rest so we are sure that the stack addresses used
   // from there will be lower than the stack base just computed

@@ -1802,11 +1802,11 @@
 
     // Called before the java thread exit since we want to read info
     // from java_lang_Thread object
     EventThreadEnd event;
     if (event.should_commit()) {
-        event.set_javalangthread(java_lang_Thread::thread_id(this->threadObj()));
+        event.set_thread(THREAD_TRACE_ID(this));
         event.commit();
     }
 
     // Call after last event on thread
     EVENT_THREAD_EXIT(this);

@@ -2183,10 +2183,15 @@
   }
 
   if (check_asyncs) {
     check_and_handle_async_exceptions();
   }
+#if INCLUDE_TRACE
+  if (is_trace_suspend()) {
+    TRACE_SUSPEND_THREAD(this);
+  }
+#endif
 }
 
 void JavaThread::send_thread_stop(oop java_throwable)  {
   assert(Thread::current()->is_VM_thread(), "should be in the vm thread");
   assert(Threads_lock->is_locked(), "Threads_lock should be locked by safepoint code");

@@ -2421,10 +2426,15 @@
       f.deoptimize(thread);
     } else {
       fatal("missed deoptimization!");
     }
   }
+#if INCLUDE_TRACE
+  if (thread->is_trace_suspend()) {
+    TRACE_SUSPEND_THREAD(thread);
+  }
+#endif
 }
 
 // Slow path when the native==>VM/Java barriers detect a safepoint is in
 // progress or when _suspend_flags is non-zero.
 // Current thread needs to self-suspend if there is a suspend request and/or
< prev index next >