RFR (XS) 8245814: Shenandoah: reconsider format specifiers for stats

Aleksey Shipilev shade at redhat.com
Tue May 26 14:44:30 UTC 2020


RFE:
  https://bugs.openjdk.java.net/browse/JDK-8245814

Current log is misplaced because "CWR: Resolved Table Roots" is larger than the format specifier for
it. Let's bump the specifier lengths. Also, make sure the US_WORKER_TIME_FORMAT matches the "empty"
slot. I did it while changing its length from 3 to 4, but ultimately decided to keep at 3.

Fix:

diff -r bdeba1590341 src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp        Tue May 26 16:36:08 2020 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp        Tue May 26 16:42:43 2020 +0200
@@ -34,8 +34,9 @@
 #include "utilities/ostream.hpp"

-#define SHENANDOAH_PHASE_NAME_FORMAT "%-28s"
+#define SHENANDOAH_PHASE_NAME_FORMAT "%-30s"
 #define SHENANDOAH_S_TIME_FORMAT "%8.3lf"
 #define SHENANDOAH_US_TIME_FORMAT "%8.0lf"
 #define SHENANDOAH_US_WORKER_TIME_FORMAT "%3.0lf"
+#define SHENANDOAH_US_WORKER_NOTIME_FORMAT "%3s"
 #define SHENANDOAH_PARALLELISM_FORMAT "%4.2lf"

@@ -244,5 +245,5 @@
             out->print(SHENANDOAH_US_WORKER_TIME_FORMAT ", ", tv * 1000000.0);
           } else {
-            out->print("%3s, ", "---");
+            out->print(SHENANDOAH_US_WORKER_NOTIME_FORMAT ", ", "---");
           }
         }

Testing: hotspot_gc_shenandoah, eyeballing GC logs.

-- 
Thanks,
-Aleksey




More information about the hotspot-gc-dev mailing list