<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi,<br><br>I noticed that output produced by -XX:+PrintGCTaskTimeStamps goes to standard output instead of gclog file.<br><br>Or more precisely,<br>GCTaskThread::print_task_time_stamps()  uses tty<br>PSScavenge::invoke_no_policy()          uses tty to write VM-Thread information<br>but<br>PSParallelCompact::invoke_no_policy()   uses gclog_or_tty to write VM-Thread information<br><br>I believe that this output should be entirely directed to one stream, and I think this should be gclog_or_tty.<br><br>Here is a patch:<br><br>diff -r 1ae0472ff3a0 src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp<br>--- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp    Fri May 10 11:14:09 2013 -0700<br>+++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp    Thu May 16 17:49:53 2013 +0300<br>@@ -74,10 +74,10 @@<br>   assert(PrintGCTaskTimeStamps, "Sanity");<br>   assert(_time_stamps != NULL, "Sanity (Probably set PrintGCTaskTimeStamps late)");<br> <br>-  tty->print_cr("GC-Thread %u entries: %d", id(), _time_stamp_index);<br>+  gclog_or_tty->print_cr("GC-Thread %u entries: %d", id(), _time_stamp_index);<br>   for(uint i=0; i<_time_stamp_index; i++) {<br>     GCTaskTimeStamp* time_stamp = time_stamp_at(i);<br>-    tty->print_cr("\t[ %s " INT64_FORMAT " " INT64_FORMAT " ]",<br>+    gclog_or_tty->print_cr("\t[ %s " INT64_FORMAT " " INT64_FORMAT " ]",<br>                   time_stamp->name(),<br>                   time_stamp->entry_time(),<br>                   time_stamp->exit_time());<br>diff -r 1ae0472ff3a0 src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp<br>--- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp    Fri May 10 11:14:09 2013 -0700<br>+++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp    Thu May 16 17:49:53 2013 +0300<br>@@ -651,7 +651,7 @@<br>   scavenge_exit.update();<br> <br>   if (PrintGCTaskTimeStamps) {<br>-    tty->print_cr("VM-Thread " INT64_FORMAT " " INT64_FORMAT " " INT64_FORMAT,<br>+    gclog_or_tty->print_cr("VM-Thread " INT64_FORMAT " " INT64_FORMAT " " INT64_FORMAT,<br>                   scavenge_entry.ticks(), scavenge_midpoint.ticks(),<br>                   scavenge_exit.ticks());<br>     gc_task_manager()->print_task_time_stamps();<br><br>Regards,<br>Dmytro<br><br>                                         </div></body>
</html>