PrintGCTaskTimeStamps uses tty for output instead of gclog_or_tty
Dmytro Sheyko
dmytro_sheyko at hotmail.com
Thu May 16 14:53:45 UTC 2013
Hi,
I noticed that output produced by -XX:+PrintGCTaskTimeStamps goes to standard output instead of gclog file.
Or more precisely,
GCTaskThread::print_task_time_stamps() uses tty
PSScavenge::invoke_no_policy() uses tty to write VM-Thread information
but
PSParallelCompact::invoke_no_policy() uses gclog_or_tty to write VM-Thread information
I believe that this output should be entirely directed to one stream, and I think this should be gclog_or_tty.
Here is a patch:
diff -r 1ae0472ff3a0 src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp
--- a/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp Fri May 10 11:14:09 2013 -0700
+++ b/src/share/vm/gc_implementation/parallelScavenge/gcTaskThread.cpp Thu May 16 17:49:53 2013 +0300
@@ -74,10 +74,10 @@
assert(PrintGCTaskTimeStamps, "Sanity");
assert(_time_stamps != NULL, "Sanity (Probably set PrintGCTaskTimeStamps late)");
- tty->print_cr("GC-Thread %u entries: %d", id(), _time_stamp_index);
+ gclog_or_tty->print_cr("GC-Thread %u entries: %d", id(), _time_stamp_index);
for(uint i=0; i<_time_stamp_index; i++) {
GCTaskTimeStamp* time_stamp = time_stamp_at(i);
- tty->print_cr("\t[ %s " INT64_FORMAT " " INT64_FORMAT " ]",
+ gclog_or_tty->print_cr("\t[ %s " INT64_FORMAT " " INT64_FORMAT " ]",
time_stamp->name(),
time_stamp->entry_time(),
time_stamp->exit_time());
diff -r 1ae0472ff3a0 src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
--- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Fri May 10 11:14:09 2013 -0700
+++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Thu May 16 17:49:53 2013 +0300
@@ -651,7 +651,7 @@
scavenge_exit.update();
if (PrintGCTaskTimeStamps) {
- tty->print_cr("VM-Thread " INT64_FORMAT " " INT64_FORMAT " " INT64_FORMAT,
+ gclog_or_tty->print_cr("VM-Thread " INT64_FORMAT " " INT64_FORMAT " " INT64_FORMAT,
scavenge_entry.ticks(), scavenge_midpoint.ticks(),
scavenge_exit.ticks());
gc_task_manager()->print_task_time_stamps();
Regards,
Dmytro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20130516/82774991/attachment.htm>
More information about the hotspot-gc-dev
mailing list