8062307: 'Reference handler' thread triggers assert w/ TraceThreadEvents
authordholmes
Wed, 12 Nov 2014 19:05:59 -0500
changeset 27651 b85a7f15f835
parent 27650 199cbba2f8f9
child 27653 4c2e88d870ed
8062307: 'Reference handler' thread triggers assert w/ TraceThreadEvents Summary: Removed unused and non-working TraceThreadEvents option Reviewed-by: coleenp, jiangli
hotspot/src/share/vm/runtime/globals.hpp
hotspot/src/share/vm/runtime/thread.cpp
hotspot/src/share/vm/runtime/thread.hpp
--- a/hotspot/src/share/vm/runtime/globals.hpp	Wed Nov 12 18:31:05 2014 +0000
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Wed Nov 12 19:05:59 2014 -0500
@@ -1335,9 +1335,6 @@
   develop(bool, TraceJNIHandleAllocation, false,                            \
           "Trace allocation/deallocation of JNI handle blocks")             \
                                                                             \
-  develop(bool, TraceThreadEvents, false,                                   \
-          "Trace all thread events")                                        \
-                                                                            \
   develop(bool, TraceBytecodes, false,                                      \
           "Trace bytecode execution")                                       \
                                                                             \
--- a/hotspot/src/share/vm/runtime/thread.cpp	Wed Nov 12 18:31:05 2014 +0000
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Wed Nov 12 19:05:59 2014 -0500
@@ -374,42 +374,7 @@
 }
 #endif
 
-
-#ifndef PRODUCT
-// Tracing method for basic thread operations
-void Thread::trace(const char* msg, const Thread* const thread) {
-  if (!TraceThreadEvents) return;
-  ResourceMark rm;
-  ThreadCritical tc;
-  const char *name = "non-Java thread";
-  int prio = -1;
-  if (thread->is_Java_thread()
-      && !thread->is_Compiler_thread()) {
-    // The Threads_lock must be held to get information about
-    // this thread but may not be in some situations when
-    // tracing  thread events.
-    bool release_Threads_lock = false;
-    if (!Threads_lock->owned_by_self()) {
-      Threads_lock->lock();
-      release_Threads_lock = true;
-    }
-    JavaThread* jt = (JavaThread *)thread;
-    name = (char *)jt->get_thread_name();
-    oop thread_oop = jt->threadObj();
-    if (thread_oop != NULL) {
-      prio = java_lang_Thread::priority(thread_oop);
-    }
-    if (release_Threads_lock) {
-      Threads_lock->unlock();
-    }
-  }
-  tty->print_cr("Thread::%s " INTPTR_FORMAT " [%lx] %s (prio: %d)", msg, thread, thread->osthread()->thread_id(), name, prio);
-}
-#endif
-
-
 ThreadPriority Thread::get_priority(const Thread* const thread) {
-  trace("get priority", thread);
   ThreadPriority priority;
   // Can return an error!
   (void)os::get_priority(thread, priority);
@@ -418,7 +383,6 @@
 }
 
 void Thread::set_priority(Thread* thread, ThreadPriority priority) {
-  trace("set priority", thread);
   debug_only(check_for_dangling_thread_pointer(thread);)
   // Can return an error!
   (void)os::set_priority(thread, priority);
@@ -426,7 +390,6 @@
 
 
 void Thread::start(Thread* thread) {
-  trace("start", thread);
   // Start is different from resume in that its safety is guaranteed by context or
   // being called from a Java method synchronized on the Thread object.
   if (!DisableStartThread) {
@@ -769,13 +732,11 @@
 }
 
 void Thread::interrupt(Thread* thread) {
-  trace("interrupt", thread);
   debug_only(check_for_dangling_thread_pointer(thread);)
   os::interrupt(thread);
 }
 
 bool Thread::is_interrupted(Thread* thread, bool clear_interrupted) {
-  trace("is_interrupted", thread);
   debug_only(check_for_dangling_thread_pointer(thread);)
   // Note:  If clear_interrupted==false, this simply fetches and
   // returns the value of the field osthread()->interrupted().
@@ -1563,9 +1524,6 @@
                        _dirty_card_queue(&_dirty_card_queue_set)
 #endif // INCLUDE_ALL_GCS
 {
-  if (TraceThreadEvents) {
-    tty->print_cr("creating thread %p", this);
-  }
   initialize();
   _jni_attach_state = _not_attaching_via_jni;
   set_entry_point(entry_point);
@@ -1588,9 +1546,6 @@
 }
 
 JavaThread::~JavaThread() {
-  if (TraceThreadEvents) {
-    tty->print_cr("terminate thread %p", this);
-  }
 
   // JSR166 -- return the parker to the free list
   Parker::Release(_parker);
--- a/hotspot/src/share/vm/runtime/thread.hpp	Wed Nov 12 18:31:05 2014 +0000
+++ b/hotspot/src/share/vm/runtime/thread.hpp	Wed Nov 12 19:05:59 2014 -0500
@@ -212,9 +212,6 @@
   bool is_inside_signal_handler() const { return _num_nested_signal > 0; }
 
  private:
-  // Debug tracing
-  static void trace(const char* msg, const Thread* const thread) PRODUCT_RETURN;
-
   // Active_handles points to a block of handles
   JNIHandleBlock* _active_handles;