changeset 7447:7d70accd6b5a

Fix format strings.
author Roman Kennke <rkennke@redhat.com>
date Fri, 16 Jan 2015 12:59:18 +0100
parents 675763177043
children 5d8c71ac66b0
files src/share/vm/gc_implementation/shenandoah/shenandoahCollectorPolicy.cpp src/share/vm/gc_implementation/shenandoah/shenandoahConcurrentMark.cpp src/share/vm/gc_implementation/shenandoah/shenandoahHeap.cpp src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.cpp src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegionSet.cpp
diffstat 5 files changed, 22 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/shenandoah/shenandoahCollectorPolicy.cpp	Thu Jan 15 20:22:42 2015 +0100
+++ b/src/share/vm/gc_implementation/shenandoah/shenandoahCollectorPolicy.cpp	Fri Jan 16 12:59:18 2015 +0100
@@ -405,7 +405,7 @@
   heuristics->set_allocation_threshold(ShenandoahAllocationThreshold);
   heuristics->set_used_threshold(ShenandoahUsedThreshold);
   if (ShenandoahLogConfig) {
-    tty->print_cr("Shenandoah dynamic heuristics thresholds: allocation %d, used %d, garbage %d",
+    tty->print_cr("Shenandoah dynamic heuristics thresholds: allocation "UINTX_FORMAT", used "UINTX_FORMAT", garbage "UINTX_FORMAT,
                   heuristics->get_allocation_threshold(),
                   heuristics->get_used_threshold(),
                   heuristics->get_garbage_threshold());
@@ -553,8 +553,8 @@
 void print_summary_sd(const char* str,
 		      const NumberSeq* seq) {
   print_summary(str, seq);
-  gclog_or_tty->print_cr("%+45s = %5d, std dev = %8.2lf ms, max = %8.2lf ms)",
-                "(num", seq->num(), seq->sd(), seq->maximum());
+  gclog_or_tty->print_cr("(num = %5d, std dev = %8.2lf ms, max = %8.2lf ms)",
+                seq->num(), seq->sd(), seq->maximum());
 }
 
 void ShenandoahHeuristics::print_tracing_info() {
--- a/src/share/vm/gc_implementation/shenandoah/shenandoahConcurrentMark.cpp	Thu Jan 15 20:22:42 2015 +0100
+++ b/src/share/vm/gc_implementation/shenandoah/shenandoahConcurrentMark.cpp	Fri Jan 16 12:59:18 2015 +0100
@@ -679,7 +679,7 @@
       if (Verbose && ShenandoahTraceWeakReferences) {
 	gclog_or_tty->print_cr("\t[%u] we're looking at location "
 			       "*"PTR_FORMAT" = "PTR_FORMAT,
-			       _worker_id, p, (void*) obj);
+			       _worker_id, p2i(p), p2i((void*) obj));
 	obj->print();
       }
 
@@ -786,7 +786,7 @@
                                      ShenandoahHeap::heap()->tracer()->gc_id());
    
    if (ShenandoahTraceWeakReferences) {
-     gclog_or_tty->print_cr("finished processing references, processed %d refs", keep_alive.ref_count());
+     gclog_or_tty->print_cr("finished processing references, processed "SIZE_FORMAT" refs", keep_alive.ref_count());
      gclog_or_tty->print_cr("start enqueuing references");
    }
 
--- a/src/share/vm/gc_implementation/shenandoah/shenandoahHeap.cpp	Thu Jan 15 20:22:42 2015 +0100
+++ b/src/share/vm/gc_implementation/shenandoah/shenandoahHeap.cpp	Fri Jan 16 12:59:18 2015 +0100
@@ -33,7 +33,7 @@
 void ShenandoahHeap::print_heap_locations(HeapWord* start, HeapWord* end) {
   HeapWord* cur = NULL;
   for (cur = start; cur < end; cur++) {
-    tty->print("%p : %p \n", cur, *cur);
+    tty->print("%p : %p \n", cur, *(HeapWord**) cur);
   }
 }
 
@@ -61,8 +61,8 @@
 class PrintHeapObjectsClosure : public ShenandoahHeapRegionClosure {
 public:
   bool doHeapRegion(ShenandoahHeapRegion* r) {
-    tty->print("Region %d top = "PTR_FORMAT" used = %x free = %x\n", 
-	       r->region_number(), r->top(), r->used(), r->free());
+    tty->print_cr("Region %d top = "PTR_FORMAT" used = "SIZE_FORMAT_HEX" free = "SIZE_FORMAT_HEX, 
+	       r->region_number(), p2i(r->top()), r->used(), r->free());
     
     ShenandoahHeap::heap()->print_heap_objects(r->bottom(), r->top());
     return false;
@@ -75,7 +75,7 @@
   size_t init_byte_size = collector_policy()->initial_heap_byte_size();
   size_t max_byte_size = collector_policy()->max_heap_byte_size();
   if (ShenandoahGCVerbose) 
-    tty->print("init_byte_size = %d,%x  max_byte_size = %d,%x\n", 
+    tty->print_cr("init_byte_size = "SIZE_FORMAT","SIZE_FORMAT_HEX"  max_byte_size = "SIZE_FORMAT","SIZE_FORMAT_HEX, 
 	     init_byte_size, init_byte_size, max_byte_size, max_byte_size);
 
   Universe::check_alignment(max_byte_size,  
@@ -364,7 +364,7 @@
   assert(! heap_region_containing(result)->is_in_collection_set(), "Never allocate in dirty region");
   if (result != NULL) {
     if (ShenandoahTraceTLabs) {
-      tty->print("allocating new gclab of size %d at addr %p\n", word_size, result);
+      tty->print("allocating new gclab of size "SIZE_FORMAT" at addr %p\n", word_size, result);
     }
 
   }
@@ -533,7 +533,7 @@
 
 HeapWord* ShenandoahHeap::allocate_large_memory(size_t words) {
   if (ShenandoahTraceHumonguous) {
-    gclog_or_tty->print_cr("allocating humonguous object of size: %d words", words);
+    gclog_or_tty->print_cr("allocating humonguous object of size: "SIZE_FORMAT" words", words);
   }
 
   uint required_regions = (words * HeapWordSize) / ShenandoahHeapRegion::RegionSizeBytes  + 1;
@@ -666,11 +666,11 @@
 
     return result;
   } else {
-    tty->print_cr("Out of memory. Requested number of words: %d used heap: %ld, bytes allocated since last CM: %ld", size, used(), _bytesAllocSinceCM);
+    tty->print_cr("Out of memory. Requested number of words: "SIZE_FORMAT" used heap: "SIZE_FORMAT", bytes allocated since last CM: "SIZE_FORMAT, size, used(), _bytesAllocSinceCM);
     {
       MutexLocker ml(Heap_lock);
       print_heap_regions();
-      tty->print("Printing %d free regions:\n", _free_regions->length());
+      tty->print_cr("Printing "SIZE_FORMAT" free regions:", _free_regions->length());
       _free_regions->print();
     }
     assert(false, "Out of memory");
@@ -682,7 +682,7 @@
 public:
   void do_oop(oop* o) {
     oop obj = *o;
-    tty->print("References oop "PTR_FORMAT"\n", (HeapWord*) obj);
+    tty->print("References oop "PTR_FORMAT"\n", p2i((HeapWord*) obj));
     obj->print();
   }
 
@@ -1371,7 +1371,7 @@
   }
 
   if (ShenandoahPrintCollectionSet) {
-    tty->print("Printing collection set which contains %d regions:\n", _collection_set->available_regions());
+    tty->print("Printing collection set which contains "SIZE_FORMAT" regions:\n", _collection_set->available_regions());
     _collection_set->print();
   }
 
@@ -1385,10 +1385,10 @@
 
   if (ShenandoahGCVerbose) {
 
-    tty->print("Printing postgc collection set which contains %d regions:\n", _collection_set->available_regions());
+    tty->print_cr("Printing postgc collection set which contains "SIZE_FORMAT" regions:", _collection_set->available_regions());
     _collection_set->print();
 
-    tty->print("Printing postgc free regions which contain %d free regions:\n", _free_regions->available_regions());
+    tty->print_cr("Printing postgc free regions which contain "SIZE_FORMAT" free regions:", _free_regions->available_regions());
     _free_regions->print();
 
     tty->print_cr("finished parallel_evacuate");
@@ -1631,7 +1631,7 @@
       if (!obj->is_oop()) {
         { // Just for debugging.
 	  gclog_or_tty->print_cr("Root location "PTR_FORMAT" "
-				 "verified "PTR_FORMAT, p, (void*) obj);
+				 "verified "PTR_FORMAT, p2i(p), p2i((void*) obj));
 	  //	  obj->print_on(gclog_or_tty);
         }
       }
@@ -2368,7 +2368,7 @@
 
   size_t expand_size = new_regions * ShenandoahHeapRegion::RegionSizeBytes;
   if (ShenandoahGCVerbose) {
-    tty->print_cr("expanding storage by %x bytes, for %d new regions", expand_size, new_regions);
+    tty->print_cr("expanding storage by "SIZE_FORMAT_HEX" bytes, for "INT32_FORMAT" new regions", expand_size, new_regions);
   }
   bool success = _storage.expand_by(expand_size);
   assert(success, "should always be able to expand by requested size");
--- a/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.cpp	Thu Jan 15 20:22:42 2015 +0100
+++ b/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegion.cpp	Fri Jan 16 12:59:18 2015 +0100
@@ -140,8 +140,8 @@
   //else
     st->print(" ");
 
-  st->print("live = %u garbage = %u bottom = %p end = %p top = %p\n", 
-            getLiveData(), garbage(), bottom(), end(), top());
+  st->print_cr("live = "SIZE_FORMAT" garbage = "SIZE_FORMAT" bottom = "PTR_FORMAT" end = "PTR_FORMAT" top = "PTR_FORMAT, 
+	       getLiveData(), garbage(), p2i(bottom()), p2i(end()), p2i(top()));
 }
 
 
--- a/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegionSet.cpp	Thu Jan 15 20:22:42 2015 +0100
+++ b/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegionSet.cpp	Fri Jan 16 12:59:18 2015 +0100
@@ -261,7 +261,7 @@
   uint required_regions = (size * HeapWordSize) / ShenandoahHeapRegion::RegionSizeBytes  + 1;
 
   if (ShenandoahTraceHumonguous) {
-    tty->print_cr("reclaiming %d humonguous regions for object of size: %d words", required_regions, size);
+    tty->print_cr("reclaiming "UINT32_FORMAT" humonguous regions for object of size: "SIZE_FORMAT" words", required_regions, size);
   }
 
   assert((*r)->getLiveData() == 0, "liveness must be zero");