8039743: Use correct format specifier to print size_t values and pointers in the GC code
Reviewed-by: jmasa, sjohanss
Contributed-by: stefan.karlsson@oracle.com, mikael.vidstedt@oracle.com
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -564,11 +564,11 @@
"--------------------------------\n");
size_t total_size = totalSizeInIndexedFreeLists();
size_t free_blocks = numFreeBlocksInIndexedFreeLists();
- gclog_or_tty->print("Total Free Space: %d\n", total_size);
- gclog_or_tty->print("Max Chunk Size: %d\n", maxChunkSizeInIndexedFreeLists());
- gclog_or_tty->print("Number of Blocks: %d\n", free_blocks);
+ gclog_or_tty->print("Total Free Space: " SIZE_FORMAT "\n", total_size);
+ gclog_or_tty->print("Max Chunk Size: " SIZE_FORMAT "\n", maxChunkSizeInIndexedFreeLists());
+ gclog_or_tty->print("Number of Blocks: " SIZE_FORMAT "\n", free_blocks);
if (free_blocks != 0) {
- gclog_or_tty->print("Av. Block Size: %d\n", total_size/free_blocks);
+ gclog_or_tty->print("Av. Block Size: " SIZE_FORMAT "\n", total_size/free_blocks);
}
}
@@ -2152,7 +2152,7 @@
for (i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) {
AdaptiveFreeList<FreeChunk>* fl = &_indexedFreeList[i];
if (PrintFLSStatistics > 1) {
- gclog_or_tty->print("size[%d] : ", i);
+ gclog_or_tty->print("size[" SIZE_FORMAT "] : ", i);
}
fl->compute_desired(inter_sweep_current, inter_sweep_estimate, intra_sweep_estimate);
fl->set_coal_desired((ssize_t)((double)fl->desired() * CMSSmallCoalSurplusPercent));
@@ -2683,7 +2683,8 @@
_global_num_workers[i] = 0;
_global_num_blocks[i] = 0;
if (PrintOldPLAB) {
- gclog_or_tty->print_cr("[%d]: %d", i, (size_t)_blocks_to_claim[i].average());
+ gclog_or_tty->print_cr("[" SIZE_FORMAT "]: " SIZE_FORMAT,
+ i, (size_t)_blocks_to_claim[i].average());
}
}
}
@@ -2722,7 +2723,7 @@
}
}
if (PrintOldPLAB) {
- gclog_or_tty->print_cr("%d[%d]: %d/%d/%d",
+ gclog_or_tty->print_cr("%d[" SIZE_FORMAT "]: " SIZE_FORMAT "/" SIZE_FORMAT "/" SIZE_FORMAT,
tid, i, num_retire, _num_blocks[i], (size_t)_blocks_to_claim[i].average());
}
// Reset stats for next round
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -2894,13 +2894,13 @@
// Clear the marking bit map array before starting, but, just
// for kicks, first report if the given address is already marked
- gclog_or_tty->print_cr("Start: Address 0x%x is%s marked", addr,
+ gclog_or_tty->print_cr("Start: Address " PTR_FORMAT " is%s marked", addr,
_markBitMap.isMarked(addr) ? "" : " not");
if (verify_after_remark()) {
MutexLockerEx x(verification_mark_bm()->lock(), Mutex::_no_safepoint_check_flag);
bool result = verification_mark_bm()->isMarked(addr);
- gclog_or_tty->print_cr("TransitiveMark: Address 0x%x %s marked", addr,
+ gclog_or_tty->print_cr("TransitiveMark: Address " PTR_FORMAT " %s marked", addr,
result ? "IS" : "is NOT");
return result;
} else {
@@ -4569,7 +4569,7 @@
}
}
if (PrintCMSStatistics > 0) {
- gclog_or_tty->print(" [%d iterations, %d waits, %d cards)] ",
+ gclog_or_tty->print(" [" SIZE_FORMAT " iterations, " SIZE_FORMAT " waits, " SIZE_FORMAT " cards)] ",
loops, waited, cumworkdone);
}
}
@@ -4721,7 +4721,7 @@
numIter++, lastNumCards = curNumCards, cumNumCards += curNumCards) {
curNumCards = preclean_mod_union_table(_cmsGen, &smoac_cl);
if (Verbose && PrintGCDetails) {
- gclog_or_tty->print(" (modUnionTable: %d cards)", curNumCards);
+ gclog_or_tty->print(" (modUnionTable: " SIZE_FORMAT " cards)", curNumCards);
}
// Either there are very few dirty cards, so re-mark
// pause will be small anyway, or our pre-cleaning isn't
@@ -4743,7 +4743,7 @@
curNumCards = preclean_card_table(_cmsGen, &smoac_cl);
cumNumCards += curNumCards;
if (PrintGCDetails && PrintCMSStatistics != 0) {
- gclog_or_tty->print_cr(" (cardTable: %d cards, re-scanned %d cards, %d iterations)",
+ gclog_or_tty->print_cr(" (cardTable: " SIZE_FORMAT " cards, re-scanned " SIZE_FORMAT " cards, " SIZE_FORMAT " iterations)",
curNumCards, cumNumCards, numIter);
}
return cumNumCards; // as a measure of useful work done
@@ -8205,7 +8205,7 @@
void SweepClosure::initialize_free_range(HeapWord* freeFinger,
bool freeRangeInFreeLists) {
if (CMSTraceSweeper) {
- gclog_or_tty->print("---- Start free range at 0x%x with free block (%d)\n",
+ gclog_or_tty->print("---- Start free range at " PTR_FORMAT " with free block (%d)\n",
freeFinger, freeRangeInFreeLists);
}
assert(!inFreeRange(), "Trampling existing free range");
@@ -8275,10 +8275,10 @@
pointer_delta(addr, freeFinger()));
if (CMSTraceSweeper) {
gclog_or_tty->print("Sweep: last chunk: ");
- gclog_or_tty->print("put_free_blk 0x%x ("SIZE_FORMAT") "
- "[coalesced:"SIZE_FORMAT"]\n",
+ gclog_or_tty->print("put_free_blk " PTR_FORMAT " ("SIZE_FORMAT") "
+ "[coalesced:%d]\n",
freeFinger(), pointer_delta(addr, freeFinger()),
- lastFreeRangeCoalesced());
+ lastFreeRangeCoalesced() ? 1 : 0);
}
}
@@ -8421,7 +8421,7 @@
// the midst of a free range, we are coalescing
print_free_block_coalesced(fc);
if (CMSTraceSweeper) {
- gclog_or_tty->print(" -- pick up free block 0x%x (%d)\n", fc, size);
+ gclog_or_tty->print(" -- pick up free block " PTR_FORMAT " (" SIZE_FORMAT ")\n", fc, size);
}
// remove it from the free lists
_sp->removeFreeChunkFromFreeLists(fc);
@@ -8483,7 +8483,7 @@
// this will be swept up when we hit the end of the
// free range
if (CMSTraceSweeper) {
- gclog_or_tty->print(" -- pick up garbage 0x%x (%d) \n", fc, size);
+ gclog_or_tty->print(" -- pick up garbage " PTR_FORMAT " (" SIZE_FORMAT ")\n", fc, size);
}
// If the chunk is being coalesced and the current free range is
// in the free lists, remove the current free range so that it
@@ -8576,7 +8576,7 @@
}
if (CMSTraceSweeper) {
- gclog_or_tty->print_cr(" -- pick up another chunk at 0x%x (%d)", fc, chunkSize);
+ gclog_or_tty->print_cr(" -- pick up another chunk at " PTR_FORMAT " (" SIZE_FORMAT ")", fc, chunkSize);
}
HeapWord* const fc_addr = (HeapWord*) fc;
@@ -8705,7 +8705,7 @@
"chunk should not be in free lists yet");
}
if (CMSTraceSweeper) {
- gclog_or_tty->print_cr(" -- add free block 0x%x (%d) to free lists",
+ gclog_or_tty->print_cr(" -- add free block " PTR_FORMAT " (" SIZE_FORMAT ") to free lists",
chunk, size);
}
// A new free range is going to be starting. The current
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -265,7 +265,7 @@
slots += _spoolHead->bufferSize - 1;
blocks++;
}
- gclog_or_tty->print_cr(" [worker %d] promo_blocks = %d, promo_slots = %d ",
+ gclog_or_tty->print_cr(" [worker %d] promo_blocks = " SIZE_FORMAT ", promo_slots = " SIZE_FORMAT,
worker_id, blocks, slots);
}
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -3754,7 +3754,7 @@
if (_task_queue->size() > target_size) {
if (_cm->verbose_high()) {
- gclog_or_tty->print_cr("[%u] draining local queue, target size = %d",
+ gclog_or_tty->print_cr("[%u] draining local queue, target size = " SIZE_FORMAT,
_worker_id, target_size);
}
@@ -3782,7 +3782,7 @@
}
if (_cm->verbose_high()) {
- gclog_or_tty->print_cr("[%u] drained local queue, size = %d",
+ gclog_or_tty->print_cr("[%u] drained local queue, size = %u",
_worker_id, _task_queue->size());
}
}
@@ -3810,7 +3810,7 @@
if (_cm->mark_stack_size() > target_size) {
if (_cm->verbose_low()) {
- gclog_or_tty->print_cr("[%u] draining global_stack, target size %d",
+ gclog_or_tty->print_cr("[%u] draining global_stack, target size " SIZE_FORMAT,
_worker_id, target_size);
}
@@ -3820,7 +3820,7 @@
}
if (_cm->verbose_low()) {
- gclog_or_tty->print_cr("[%u] drained global stack, size = %d",
+ gclog_or_tty->print_cr("[%u] drained global stack, size = " SIZE_FORMAT,
_worker_id, _cm->mark_stack_size());
}
}
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -3296,7 +3296,7 @@
int *val;
for (cur = start; cur < end; cur++) {
val = (int *) cur;
- gclog_or_tty->print("\t "PTR_FORMAT":"PTR_FORMAT"\n", val, *val);
+ gclog_or_tty->print("\t "PTR_FORMAT":%d\n", val, *val);
}
}
}
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionRemSet.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -491,7 +491,7 @@
} else {
if (G1TraceHeapRegionRememberedSet) {
gclog_or_tty->print_cr(" [tid %d] sparse table entry "
- "overflow(f: %d, t: %d)",
+ "overflow(f: %d, t: %u)",
tid, from_hrs_ind, cur_hrs_ind);
}
}
@@ -610,7 +610,7 @@
_n_coarse_entries++;
if (G1TraceHeapRegionRememberedSet) {
gclog_or_tty->print("Coarsened entry in region [" PTR_FORMAT "...] "
- "for region [" PTR_FORMAT "...] (%d coarse entries).\n",
+ "for region [" PTR_FORMAT "...] (" SIZE_FORMAT " coarse entries).\n",
hr()->bottom(),
max->hr()->bottom(),
_n_coarse_entries);
@@ -903,10 +903,12 @@
}
if (iter.n_yielded() != occupied()) {
gclog_or_tty->print_cr("Yielded disagrees with occupied:");
- gclog_or_tty->print_cr(" %6d yielded (%6d coarse, %6d fine).",
+ gclog_or_tty->print_cr(" " SIZE_FORMAT_W(6) " yielded (" SIZE_FORMAT_W(6)
+ " coarse, " SIZE_FORMAT_W(6) " fine).",
iter.n_yielded(),
iter.n_yielded_coarse(), iter.n_yielded_fine());
- gclog_or_tty->print_cr(" %6d occ (%6d coarse, %6d fine).",
+ gclog_or_tty->print_cr(" " SIZE_FORMAT_W(6) " occ (" SIZE_FORMAT_W(6)
+ " coarse, " SIZE_FORMAT_W(6) " fine).",
occupied(), occ_coarse(), occ_fine());
}
guarantee(iter.n_yielded() == occupied(),
--- a/hotspot/src/share/vm/gc_implementation/g1/survRateGroup.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/g1/survRateGroup.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -187,10 +187,10 @@
#ifndef PRODUCT
void
SurvRateGroup::print() {
- gclog_or_tty->print_cr("Surv Rate Group: %s (%d entries)",
+ gclog_or_tty->print_cr("Surv Rate Group: %s (" SIZE_FORMAT " entries)",
_name, _region_num);
for (size_t i = 0; i < _region_num; ++i) {
- gclog_or_tty->print_cr(" age %4d surv rate %6.2lf %% pred %6.2lf %%",
+ gclog_or_tty->print_cr(" age " SIZE_FORMAT_W(4) " surv rate %6.2lf %% pred %6.2lf %%",
i, _surv_rate[i] * 100.0,
_g1p->get_new_prediction(_surv_rate_pred[i]) * 100.0);
}
@@ -203,14 +203,15 @@
return;
gclog_or_tty->print_cr("");
- gclog_or_tty->print_cr("%s Rate Summary (for up to age %d)", _name, length-1);
+ gclog_or_tty->print_cr("%s Rate Summary (for up to age " SIZE_FORMAT ")", _name, length-1);
gclog_or_tty->print_cr(" age range survival rate (avg) samples (avg)");
gclog_or_tty->print_cr(" ---------------------------------------------------------");
size_t index = 0;
size_t limit = MIN2((int) length, 10);
while (index < limit) {
- gclog_or_tty->print_cr(" %4d %6.2lf%% %6.2lf",
+ gclog_or_tty->print_cr(" " SIZE_FORMAT_W(4)
+ " %6.2lf%% %6.2lf",
index, _summary_surv_rates[index]->avg() * 100.0,
(double) _summary_surv_rates[index]->num());
++index;
@@ -228,7 +229,8 @@
++index;
if (index == length || num % 10 == 0) {
- gclog_or_tty->print_cr(" %4d .. %4d %6.2lf%% %6.2lf",
+ gclog_or_tty->print_cr(" " SIZE_FORMAT_W(4) " .. " SIZE_FORMAT_W(4)
+ " %6.2lf%% %6.2lf",
(index-1) / 10 * 10, index-1, sum / (double) num,
(double) samples / (double) num);
sum = 0.0;
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -143,7 +143,8 @@
if (TraceAdaptiveGCBoundary) {
gclog_or_tty->print_cr("Before expansion of old gen with boundary move");
- gclog_or_tty->print_cr(" Requested change: 0x%x Attempted change: 0x%x",
+ gclog_or_tty->print_cr(" Requested change: " SIZE_FORMAT_HEX
+ " Attempted change: " SIZE_FORMAT_HEX,
expand_in_bytes, change_in_bytes);
if (!PrintHeapAtGC) {
Universe::print_on(gclog_or_tty);
@@ -201,7 +202,7 @@
if (TraceAdaptiveGCBoundary) {
gclog_or_tty->print_cr("Before expansion of young gen with boundary move");
- gclog_or_tty->print_cr(" Requested change: 0x%x Attempted change: 0x%x",
+ gclog_or_tty->print_cr(" Requested change: " SIZE_FORMAT_HEX " Attempted change: " SIZE_FORMAT_HEX,
expand_in_bytes, change_in_bytes);
if (!PrintHeapAtGC) {
Universe::print_on(gclog_or_tty);
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSOldGen.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -127,22 +127,22 @@
size_t result_aligned = align_size_down(result, gen_alignment);
if (PrintAdaptiveSizePolicy && Verbose) {
gclog_or_tty->print_cr("\nASPSOldGen::available_for_contraction:"
- " %d K / 0x%x", result_aligned/K, result_aligned);
- gclog_or_tty->print_cr(" reserved().byte_size() %d K / 0x%x ",
+ " " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, result_aligned/K, result_aligned);
+ gclog_or_tty->print_cr(" reserved().byte_size() " SIZE_FORMAT " K / " SIZE_FORMAT_HEX,
reserved().byte_size()/K, reserved().byte_size());
size_t working_promoted = (size_t) policy->avg_promoted()->padded_average();
- gclog_or_tty->print_cr(" padded promoted %d K / 0x%x",
+ gclog_or_tty->print_cr(" padded promoted " SIZE_FORMAT " K / " SIZE_FORMAT_HEX,
working_promoted/K, working_promoted);
- gclog_or_tty->print_cr(" used %d K / 0x%x",
+ gclog_or_tty->print_cr(" used " SIZE_FORMAT " K / " SIZE_FORMAT_HEX,
used_in_bytes()/K, used_in_bytes());
- gclog_or_tty->print_cr(" min_gen_size() %d K / 0x%x",
+ gclog_or_tty->print_cr(" min_gen_size() " SIZE_FORMAT " K / " SIZE_FORMAT_HEX,
min_gen_size()/K, min_gen_size());
- gclog_or_tty->print_cr(" max_contraction %d K / 0x%x",
+ gclog_or_tty->print_cr(" max_contraction " SIZE_FORMAT " K / " SIZE_FORMAT_HEX,
max_contraction/K, max_contraction);
- gclog_or_tty->print_cr(" without alignment %d K / 0x%x",
+ gclog_or_tty->print_cr(" without alignment " SIZE_FORMAT " K / " SIZE_FORMAT_HEX,
policy->promo_increment(max_contraction)/K,
policy->promo_increment(max_contraction));
- gclog_or_tty->print_cr(" alignment 0x%x", gen_alignment);
+ gclog_or_tty->print_cr(" alignment " SIZE_FORMAT_HEX, gen_alignment);
}
assert(result_aligned <= max_contraction, "arithmetic is wrong");
return result_aligned;
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -112,11 +112,11 @@
size_t result = policy->eden_increment_aligned_down(max_contraction);
size_t result_aligned = align_size_down(result, gen_alignment);
if (PrintAdaptiveSizePolicy && Verbose) {
- gclog_or_tty->print_cr("ASPSYoungGen::available_for_contraction: %d K",
+ gclog_or_tty->print_cr("ASPSYoungGen::available_for_contraction: " SIZE_FORMAT " K",
result_aligned/K);
- gclog_or_tty->print_cr(" max_contraction %d K", max_contraction/K);
- gclog_or_tty->print_cr(" eden_avail %d K", eden_avail/K);
- gclog_or_tty->print_cr(" gen_avail %d K", gen_avail/K);
+ gclog_or_tty->print_cr(" max_contraction " SIZE_FORMAT " K", max_contraction/K);
+ gclog_or_tty->print_cr(" eden_avail " SIZE_FORMAT " K", eden_avail/K);
+ gclog_or_tty->print_cr(" gen_avail " SIZE_FORMAT " K", gen_avail/K);
}
return result_aligned;
}
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/gcTaskManager.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -487,7 +487,7 @@
if (TraceDynamicGCThreads) {
gclog_or_tty->print_cr("GCTaskManager::set_active_gang(): "
"all_workers_active() %d workers %d "
- "active %d ParallelGCThreads %d ",
+ "active %d ParallelGCThreads " UINTX_FORMAT,
all_workers_active(), workers(), active_workers(),
ParallelGCThreads);
}
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -264,7 +264,7 @@
cm->set_region_stack(ParCompactionManager::region_list(which_stack_index));
if (TraceDynamicGCThreads) {
gclog_or_tty->print_cr("StealRegionCompactionTask::do_it "
- "region_stack_index %d region_stack = 0x%x "
+ "region_stack_index %d region_stack = " PTR_FORMAT " "
" empty (%d) use all workers %d",
which_stack_index, ParCompactionManager::region_list(which_stack_index),
cm->region_stack()->is_empty(),
@@ -366,7 +366,7 @@
if (TraceDynamicGCThreads) {
void* old_region_stack = (void*) cm->region_stack();
int old_region_stack_index = cm->region_stack_index();
- gclog_or_tty->print_cr("Pushing region stack 0x%x/%d",
+ gclog_or_tty->print_cr("Pushing region stack " PTR_FORMAT "/%d",
old_region_stack, old_region_stack_index);
}
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psAdaptiveSizePolicy.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -379,7 +379,7 @@
gclog_or_tty->print_cr(
"PSAdaptiveSizePolicy::compute_eden_space_size: gc time limit"
" gc_cost: %f "
- " GCTimeLimit: %d",
+ " GCTimeLimit: " UINTX_FORMAT,
gc_cost(), GCTimeLimit);
}
}
@@ -586,7 +586,7 @@
gclog_or_tty->print_cr(
"PSAdaptiveSizePolicy::compute_old_gen_free_space: gc time limit"
" gc_cost: %f "
- " GCTimeLimit: %d",
+ " GCTimeLimit: " UINTX_FORMAT,
gc_cost(), GCTimeLimit);
}
}
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -270,7 +270,8 @@
gclog_or_tty->print_cr(" collection: %d ",
heap->total_collections());
if (Verbose) {
- gclog_or_tty->print("old_gen_capacity: %d young_gen_capacity: %d",
+ gclog_or_tty->print("old_gen_capacity: " SIZE_FORMAT
+ " young_gen_capacity: " SIZE_FORMAT,
old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes());
}
}
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -1428,7 +1428,7 @@
"space_cap=" SIZE_FORMAT,
space_live, space_used,
space_capacity);
- tty->print_cr("dead_wood_limiter(%6.4f, %d)=%6.4f "
+ tty->print_cr("dead_wood_limiter(%6.4f, " SIZE_FORMAT ")=%6.4f "
"dead_wood_max=" SIZE_FORMAT " dead_wood_limit=" SIZE_FORMAT,
density, min_percent_free, limiter,
dead_wood_max, dead_wood_limit);
@@ -2106,7 +2106,8 @@
gclog_or_tty->print_cr(" collection: %d ",
heap->total_collections());
if (Verbose) {
- gclog_or_tty->print("old_gen_capacity: %d young_gen_capacity: %d",
+ gclog_or_tty->print("old_gen_capacity: " SIZE_FORMAT
+ " young_gen_capacity: " SIZE_FORMAT,
old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes());
}
}
@@ -2559,7 +2560,7 @@
if (TraceParallelOldGCCompactionPhase) {
if (Verbose && (fillable_regions & 7) != 0) gclog_or_tty->cr();
- gclog_or_tty->print_cr("%u initially fillable regions", fillable_regions);
+ gclog_or_tty->print_cr(SIZE_FORMAT " initially fillable regions", fillable_regions);
}
}
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -330,7 +330,7 @@
#ifndef PRODUCT
if (TraceScavenge) {
- gclog_or_tty->print_cr("{%s %s 0x%x (%d)}",
+ gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " (%d)}",
"promotion-failure",
obj->klass()->internal_name(),
(void *)obj, obj->size());
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -510,7 +510,8 @@
heap->total_collections());
if (Verbose) {
- gclog_or_tty->print("old_gen_capacity: %d young_gen_capacity: %d",
+ gclog_or_tty->print("old_gen_capacity: " SIZE_FORMAT
+ " young_gen_capacity: " SIZE_FORMAT,
old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes());
}
}
@@ -728,7 +729,7 @@
young_gen->object_iterate(&unforward_closure);
if (PrintGC && Verbose) {
- gclog_or_tty->print_cr("Restoring %d marks", _preserved_oop_stack.size());
+ gclog_or_tty->print_cr("Restoring " SIZE_FORMAT " marks", _preserved_oop_stack.size());
}
// Restore any saved marks.
--- a/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -168,9 +168,9 @@
if (TraceDynamicGCThreads) {
gclog_or_tty->print_cr("GCTaskManager::calc_default_active_workers() : "
- "active_workers(): %d new_active_workers: %d "
- "prev_active_workers: %d\n"
- " active_workers_by_JT: %d active_workers_by_heap_size: %d",
+ "active_workers(): " UINTX_FORMAT " new_active_workers: " UINTX_FORMAT " "
+ "prev_active_workers: " UINTX_FORMAT "\n"
+ " active_workers_by_JT: " UINTX_FORMAT " active_workers_by_heap_size: " UINTX_FORMAT,
active_workers, new_active_workers, prev_active_workers,
active_workers_by_JT, active_workers_by_heap_size);
}
@@ -545,12 +545,12 @@
if (UseGCOverheadLimit && PrintGCDetails && Verbose) {
if (gc_overhead_limit_exceeded()) {
gclog_or_tty->print_cr(" GC is exceeding overhead limit "
- "of %d%%", GCTimeLimit);
+ "of " UINTX_FORMAT "%%", GCTimeLimit);
reset_gc_overhead_limit_count();
} else if (print_gc_overhead_limit_would_be_exceeded) {
assert(gc_overhead_limit_count() > 0, "Should not be printing");
gclog_or_tty->print_cr(" GC would exceed overhead limit "
- "of %d%% %d consecutive time(s)",
+ "of " UINTX_FORMAT "%% %d consecutive time(s)",
GCTimeLimit, gc_overhead_limit_count());
}
}
--- a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp Wed Apr 09 13:54:32 2014 +0200
@@ -120,8 +120,9 @@
float delta_ise = (CMSExtrapolateSweep ? intra_sweep_estimate : 0.0);
_desired = (ssize_t)(new_rate * (inter_sweep_estimate + delta_ise));
if (PrintFLSStatistics > 1) {
- gclog_or_tty->print_cr("demand: %d, old_rate: %f, current_rate: %f, new_rate: %f, old_desired: %d, new_desired: %d",
- demand, old_rate, rate, new_rate, old_desired, _desired);
+ gclog_or_tty->print_cr("demand: " SSIZE_FORMAT ", old_rate: %f, current_rate: %f, "
+ "new_rate: %f, old_desired: " SSIZE_FORMAT ", new_desired: " SSIZE_FORMAT,
+ demand, old_rate, rate, new_rate, old_desired, _desired);
}
}
}
--- a/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/markSweep.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -131,7 +131,7 @@
assert(_preserved_oop_stack.size() == _preserved_mark_stack.size(),
"inconsistent preserved oop stacks");
if (PrintGC && Verbose) {
- gclog_or_tty->print_cr("Restoring %d marks",
+ gclog_or_tty->print_cr("Restoring " SIZE_FORMAT " marks",
_preserved_count + _preserved_oop_stack.size());
}
--- a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -888,7 +888,9 @@
for (int i = 0; i < lgrp_spaces()->length(); i++) {
lgrp_spaces()->at(i)->accumulate_statistics(page_size());
}
- st->print(" local/remote/unbiased/uncommitted: %dK/%dK/%dK/%dK, large/small pages: %d/%d\n",
+ st->print(" local/remote/unbiased/uncommitted: " SIZE_FORMAT "K/"
+ SIZE_FORMAT "K/" SIZE_FORMAT "K/" SIZE_FORMAT
+ "K, large/small pages: " SIZE_FORMAT "/" SIZE_FORMAT "\n",
ls->space_stats()->_local_space / K,
ls->space_stats()->_remote_space / K,
ls->space_stats()->_unbiased_space / K,
--- a/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/parGCAllocBuffer.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -112,7 +112,7 @@
}
_used = _allocated - _wasted - _unused;
size_t plab_sz = _used/(target_refills*no_of_gc_workers);
- if (PrintPLAB) gclog_or_tty->print(" (plab_sz = %d ", plab_sz);
+ if (PrintPLAB) gclog_or_tty->print(" (plab_sz = " SIZE_FORMAT " ", plab_sz);
// Take historical weighted average
_filter.sample(plab_sz);
// Clip from above and below, and align to object boundary
@@ -120,7 +120,7 @@
plab_sz = MIN2(max_size(), plab_sz);
plab_sz = align_object_size(plab_sz);
// Latch the result
- if (PrintPLAB) gclog_or_tty->print(" desired_plab_sz = %d) ", plab_sz);
+ if (PrintPLAB) gclog_or_tty->print(" desired_plab_sz = " SIZE_FORMAT ") ", plab_sz);
_desired_plab_sz = plab_sz;
// Now clear the accumulators for next round:
// note this needs to be fixed in the case where we
--- a/hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/gc_implementation/shared/spaceDecorator.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -84,7 +84,7 @@
assert(ZapUnusedHeapArea, "Mangling should not be in use");
#ifdef ASSERT
if(TraceZapUnusedHeapArea) {
- gclog_or_tty->print("Mangling [0x%x to 0x%x)", mr.start(), mr.end());
+ gclog_or_tty->print("Mangling [" PTR_FORMAT " to " PTR_FORMAT ")", mr.start(), mr.end());
}
Copy::fill_to_words(mr.start(), mr.word_size(), badHeapWord);
if(TraceZapUnusedHeapArea) {
--- a/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -1205,13 +1205,13 @@
"------------------------------------\n");
size_t total_size = total_chunk_size(debug_only(NULL));
size_t free_blocks = num_free_blocks();
- gclog_or_tty->print("Total Free Space: %d\n", total_size);
- gclog_or_tty->print("Max Chunk Size: %d\n", max_chunk_size());
- gclog_or_tty->print("Number of Blocks: %d\n", free_blocks);
+ gclog_or_tty->print("Total Free Space: " SIZE_FORMAT "\n", total_size);
+ gclog_or_tty->print("Max Chunk Size: " SIZE_FORMAT "\n", max_chunk_size());
+ gclog_or_tty->print("Number of Blocks: " SIZE_FORMAT "\n", free_blocks);
if (free_blocks > 0) {
- gclog_or_tty->print("Av. Block Size: %d\n", total_size/free_blocks);
+ gclog_or_tty->print("Av. Block Size: " SIZE_FORMAT "\n", total_size/free_blocks);
}
- gclog_or_tty->print("Tree Height: %d\n", tree_height());
+ gclog_or_tty->print("Tree Height: " SIZE_FORMAT "\n", tree_height());
}
// Print census information - counts, births, deaths, etc.
--- a/hotspot/src/share/vm/memory/defNewGeneration.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -511,7 +511,7 @@
HeapWord* DefNewGeneration::allocate_from_space(size_t size) {
HeapWord* result = NULL;
if (Verbose && PrintGCDetails) {
- gclog_or_tty->print("DefNewGeneration::allocate_from_space(%u):"
+ gclog_or_tty->print("DefNewGeneration::allocate_from_space(" SIZE_FORMAT "):"
" will_fail: %s"
" heap_lock: %s"
" free: " SIZE_FORMAT,
@@ -756,7 +756,7 @@
void DefNewGeneration::handle_promotion_failure(oop old) {
if (PrintPromotionFailure && !_promotion_failed) {
- gclog_or_tty->print(" (promotion failure size = " SIZE_FORMAT ") ",
+ gclog_or_tty->print(" (promotion failure size = %d) ",
old->size());
}
_promotion_failed = true;
--- a/hotspot/src/share/vm/memory/generation.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/memory/generation.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -573,8 +573,8 @@
maximum_desired_capacity / (double) K);
gclog_or_tty->print_cr(" "
" shrink_bytes: %.1fK"
- " current_shrink_factor: %d"
- " new shrink factor: %d"
+ " current_shrink_factor: " SIZE_FORMAT
+ " new shrink factor: " SIZE_FORMAT
" _min_heap_delta_bytes: %.1fK",
shrink_bytes / (double) K,
current_shrink_factor,
--- a/hotspot/src/share/vm/memory/sharedHeap.cpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/memory/sharedHeap.cpp Wed Apr 09 13:54:32 2014 +0200
@@ -257,7 +257,7 @@
size_t bytes_before,
size_t bytes_after,
size_t capacity) {
- out->print(" %d%s->%d%s(%d%s)",
+ out->print(" " SIZE_FORMAT "%s->" SIZE_FORMAT "%s(" SIZE_FORMAT "%s)",
byte_size_in_proper_unit(bytes_before),
proper_unit_for_byte_size(bytes_before),
byte_size_in_proper_unit(bytes_after),
--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp Tue Apr 08 13:50:58 2014 +0200
+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp Wed Apr 09 13:54:32 2014 +0200
@@ -1324,10 +1324,12 @@
#define PTR_FORMAT "0x%08" PRIxPTR
#endif // _LP64
-#define SSIZE_FORMAT "%" PRIdPTR
-#define SIZE_FORMAT "%" PRIuPTR
-#define SSIZE_FORMAT_W(width) "%" #width PRIdPTR
-#define SIZE_FORMAT_W(width) "%" #width PRIuPTR
+#define SSIZE_FORMAT "%" PRIdPTR
+#define SIZE_FORMAT "%" PRIuPTR
+#define SIZE_FORMAT_HEX "0x%" PRIxPTR
+#define SSIZE_FORMAT_W(width) "%" #width PRIdPTR
+#define SIZE_FORMAT_W(width) "%" #width PRIuPTR
+#define SIZE_FORMAT_HEX_W(width) "0x%" #width PRIxPTR
#define INTX_FORMAT "%" PRIdPTR
#define UINTX_FORMAT "%" PRIuPTR