8153186: Convert TraceGCTaskThread to use unified logging
authorbrutisso
Fri, 01 Apr 2016 07:08:30 +0200
changeset 37224 fd3320bf6413
parent 37223 85fec26392d7
child 37225 ac6c704f9a8c
8153186: Convert TraceGCTaskThread to use unified logging Reviewed-by: mgerdin, tschatzl
hotspot/src/share/vm/gc/parallel/gcTaskManager.cpp
hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp
hotspot/src/share/vm/runtime/globals.hpp
--- a/hotspot/src/share/vm/gc/parallel/gcTaskManager.cpp	Fri Apr 01 03:33:39 2016 +0000
+++ b/hotspot/src/share/vm/gc/parallel/gcTaskManager.cpp	Fri Apr 01 07:08:30 2016 +0200
@@ -30,6 +30,7 @@
 #include "logging/log.hpp"
 #include "memory/allocation.hpp"
 #include "memory/allocation.inline.hpp"
+#include "memory/resourceArea.hpp"
 #include "runtime/mutex.hpp"
 #include "runtime/mutexLocker.hpp"
 #include "runtime/orderAccess.inline.hpp"
@@ -404,12 +405,15 @@
     for (uint t = 0; t < workers(); t += 1) {
       set_thread(t, GCTaskThread::create(this, t, processor_assignment[t]));
     }
-    if (TraceGCTaskThread) {
-      tty->print("GCTaskManager::initialize: distribution:");
+    LogHandle(gc, task, thread) log;
+    if (log.is_trace()) {
+      ResourceMark rm;
+      outputStream* out = log.trace_stream();
+      out->print("GCTaskManager::initialize: distribution:");
       for (uint t = 0; t < workers(); t += 1) {
-        tty->print("  %u", processor_assignment[t]);
+        out->print("  %u", processor_assignment[t]);
       }
-      tty->cr();
+      out->cr();
     }
     FREE_C_HEAP_ARRAY(uint, processor_assignment);
   }
--- a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp	Fri Apr 01 03:33:39 2016 +0000
+++ b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp	Fri Apr 01 07:08:30 2016 +0200
@@ -107,10 +107,7 @@
   this->initialize_named_thread();
   // Bind yourself to your processor.
   if (processor_id() != GCTaskManager::sentinel_worker()) {
-    if (TraceGCTaskThread) {
-      tty->print_cr("GCTaskThread::run: "
-                    "  binding to processor %u", processor_id());
-    }
+    log_trace(gc, task, thread)("GCTaskThread::run: binding to processor %u", processor_id());
     if (!os::bind_to_processor(processor_id())) {
       DEBUG_ONLY(
         log_warning(gc)("Couldn't bind GCTaskThread %u to processor %u",
--- a/hotspot/src/share/vm/runtime/globals.hpp	Fri Apr 01 03:33:39 2016 +0000
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Fri Apr 01 07:08:30 2016 +0200
@@ -2411,9 +2411,6 @@
   develop(bool, TraceGCTaskQueue, false,                                    \
           "Trace actions of the GC task queues")                            \
                                                                             \
-  diagnostic(bool, TraceGCTaskThread, false,                                \
-          "Trace actions of the GC task threads")                           \
-                                                                            \
   develop(bool, TraceParallelOldGCMarkingPhase, false,                      \
           "Trace marking phase in ParallelOldGC")                           \
                                                                             \