8229129: ZGC: Fix incorrect format string for doubles
authorpliden
Tue, 06 Aug 2019 15:50:30 +0200
changeset 57660 c0a7c7161d3a
parent 57659 d349685a98ae
child 57661 5cc8f9225a6d
8229129: ZGC: Fix incorrect format string for doubles Reviewed-by: stefank, eosterlund
src/hotspot/share/gc/z/zDirector.cpp
src/hotspot/share/gc/z/zNMethodTable.cpp
src/hotspot/share/gc/z/zPageAllocator.cpp
src/hotspot/share/gc/z/zStat.cpp
--- a/src/hotspot/share/gc/z/zDirector.cpp	Tue Aug 06 15:50:25 2019 +0200
+++ b/src/hotspot/share/gc/z/zDirector.cpp	Tue Aug 06 15:50:30 2019 +0200
@@ -66,7 +66,7 @@
   const double time_since_last_gc = ZStatCycle::time_since_last();
   const double time_until_gc = ZCollectionInterval - time_since_last_gc;
 
-  log_debug(gc, director)("Rule: Timer, Interval: %us, TimeUntilGC: %.3lfs",
+  log_debug(gc, director)("Rule: Timer, Interval: %us, TimeUntilGC: %.3fs",
                           ZCollectionInterval, time_until_gc);
 
   return time_until_gc <= 0;
@@ -133,7 +133,7 @@
   const double sample_interval = 1.0 / ZStatAllocRate::sample_hz;
   const double time_until_gc = time_until_oom - max_duration_of_gc - sample_interval;
 
-  log_debug(gc, director)("Rule: Allocation Rate, MaxAllocRate: %.3lfMB/s, Free: " SIZE_FORMAT "MB, MaxDurationOfGC: %.3lfs, TimeUntilGC: %.3lfs",
+  log_debug(gc, director)("Rule: Allocation Rate, MaxAllocRate: %.3fMB/s, Free: " SIZE_FORMAT "MB, MaxDurationOfGC: %.3fs, TimeUntilGC: %.3fs",
                           max_alloc_rate / M, free / M, max_duration_of_gc, time_until_gc);
 
   return time_until_gc <= 0;
@@ -162,7 +162,7 @@
   const double time_since_last_gc_threshold = 5 * 60; // 5 minutes
   if (used < used_threshold && time_since_last_gc < time_since_last_gc_threshold) {
     // Don't even consider doing a proactive GC
-    log_debug(gc, director)("Rule: Proactive, UsedUntilEnabled: " SIZE_FORMAT "MB, TimeUntilEnabled: %.3lfs",
+    log_debug(gc, director)("Rule: Proactive, UsedUntilEnabled: " SIZE_FORMAT "MB, TimeUntilEnabled: %.3fs",
                             (used_threshold - used) / M,
                             time_since_last_gc_threshold - time_since_last_gc);
     return false;
@@ -175,7 +175,7 @@
   const double acceptable_gc_interval = max_duration_of_gc * ((assumed_throughput_drop_during_gc / acceptable_throughput_drop) - 1.0);
   const double time_until_gc = acceptable_gc_interval - time_since_last_gc;
 
-  log_debug(gc, director)("Rule: Proactive, AcceptableGCInterval: %.3lfs, TimeSinceLastGC: %.3lfs, TimeUntilGC: %.3lfs",
+  log_debug(gc, director)("Rule: Proactive, AcceptableGCInterval: %.3fs, TimeSinceLastGC: %.3fs, TimeUntilGC: %.3fs",
                           acceptable_gc_interval, time_since_last_gc, time_until_gc);
 
   return time_until_gc <= 0;
@@ -198,7 +198,7 @@
   const size_t free = free_with_reserve - MIN2(free_with_reserve, max_reserve);
   const double free_percent = percent_of(free, max_capacity);
 
-  log_debug(gc, director)("Rule: High Usage, Free: " SIZE_FORMAT "MB(%.1lf%%)",
+  log_debug(gc, director)("Rule: High Usage, Free: " SIZE_FORMAT "MB(%.1f%%)",
                           free / M, free_percent);
 
   return free_percent <= 5.0;
--- a/src/hotspot/share/gc/z/zNMethodTable.cpp	Tue Aug 06 15:50:25 2019 +0200
+++ b/src/hotspot/share/gc/z/zNMethodTable.cpp	Tue Aug 06 15:50:30 2019 +0200
@@ -113,8 +113,8 @@
 
   log_debug(gc, nmethod)("Rebuilding NMethod Table: "
                          SIZE_FORMAT "->" SIZE_FORMAT " entries, "
-                         SIZE_FORMAT "(%.0lf%%->%.0lf%%) registered, "
-                         SIZE_FORMAT "(%.0lf%%->%.0lf%%) unregistered",
+                         SIZE_FORMAT "(%.0f%%->%.0f%%) registered, "
+                         SIZE_FORMAT "(%.0f%%->%.0f%%) unregistered",
                          _size, new_size,
                          _nregistered, percent_of(_nregistered, _size), percent_of(_nregistered, new_size),
                          _nunregistered, percent_of(_nunregistered, _size), 0.0);
--- a/src/hotspot/share/gc/z/zPageAllocator.cpp	Tue Aug 06 15:50:25 2019 +0200
+++ b/src/hotspot/share/gc/z/zPageAllocator.cpp	Tue Aug 06 15:50:30 2019 +0200
@@ -337,7 +337,7 @@
       // Failed, or partly failed, to increase capacity. Adjust current
       // max capacity to avoid further attempts to increase capacity.
       log_error(gc)("Forced to lower max Java heap size from "
-                    SIZE_FORMAT "M(%.0lf%%) to " SIZE_FORMAT "M(%.0lf%%)",
+                    SIZE_FORMAT "M(%.0f%%) to " SIZE_FORMAT "M(%.0f%%)",
                     _current_max_capacity / M, percent_of(_current_max_capacity, _max_capacity),
                     _capacity / M, percent_of(_capacity, _max_capacity));
 
@@ -572,7 +572,7 @@
   const size_t cached_after = _cache.available();
   const size_t cached_before = cached_after + flushed;
 
-  log_info(gc, heap)("Page Cache: " SIZE_FORMAT "M(%.0lf%%)->" SIZE_FORMAT "M(%.0lf%%), "
+  log_info(gc, heap)("Page Cache: " SIZE_FORMAT "M(%.0f%%)->" SIZE_FORMAT "M(%.0f%%), "
                      "Flushed: " SIZE_FORMAT "M",
                      cached_before / M, percent_of(cached_before, max_capacity()),
                      cached_after / M, percent_of(cached_after, max_capacity()),
@@ -660,7 +660,7 @@
   }
 
   if (uncommitted > 0) {
-    log_info(gc, heap)("Capacity: " SIZE_FORMAT "M(%.0lf%%)->" SIZE_FORMAT "M(%.0lf%%), "
+    log_info(gc, heap)("Capacity: " SIZE_FORMAT "M(%.0f%%)->" SIZE_FORMAT "M(%.0f%%), "
                        "Uncommitted: " SIZE_FORMAT "M",
                        capacity_before / M, percent_of(capacity_before, max_capacity()),
                        capacity_after / M, percent_of(capacity_after, max_capacity()),
--- a/src/hotspot/share/gc/z/zStat.cpp	Tue Aug 06 15:50:25 2019 +0200
+++ b/src/hotspot/share/gc/z/zStat.cpp	Tue Aug 06 15:50:30 2019 +0200
@@ -41,11 +41,11 @@
 #include "utilities/debug.hpp"
 #include "utilities/ticks.hpp"
 
-#define ZSIZE_FMT               SIZE_FORMAT "M(%.0lf%%)"
+#define ZSIZE_FMT               SIZE_FORMAT "M(%.0f%%)"
 #define ZSIZE_ARGS(size)        ((size) / M), (percent_of(size, ZStatHeap::max_capacity()))
 
 #define ZTABLE_ARGS_NA          "%9s", "-"
-#define ZTABLE_ARGS(size)       SIZE_FORMAT_W(8) "M (%.0lf%%)", \
+#define ZTABLE_ARGS(size)       SIZE_FORMAT_W(8) "M (%.0f%%)", \
                                 ((size) / M), (percent_of(size, ZStatHeap::max_capacity()))
 
 //