comparison src/share/vm/gc_implementation/g1/g1RemSetSummary.cpp @ 12984:c7f403b05168

8026848: -XX:+G1SummarizeRSetStats can result in wrong exit code and crash Summary: Changed the use of %d to SIZE_FORMAT macro in format string when printing size_t values. Reviewed-by: stefank, ehelin
author sjohanss
date Tue, 22 Oct 2013 11:50:12 +0200
parents 7ec10139bf37
children c02ec279b062
comparison
equal deleted inserted replaced
12983:2fab5b7e6140 12984:c7f403b05168
185 185
186 size_t code_root_mem_size() const { return _code_root_mem_size; } 186 size_t code_root_mem_size() const { return _code_root_mem_size; }
187 size_t code_root_elems() const { return _code_root_elems; } 187 size_t code_root_elems() const { return _code_root_elems; }
188 188
189 void print_rs_mem_info_on(outputStream * out, size_t total) { 189 void print_rs_mem_info_on(outputStream * out, size_t total) {
190 out->print_cr(" %8dK (%5.1f%%) by %zd %s regions", round_to_K(rs_mem_size()), rs_mem_size_percent_of(total), amount(), _name); 190 out->print_cr(" "SIZE_FORMAT_W(8)"K (%5.1f%%) by "SIZE_FORMAT" %s regions",
191 round_to_K(rs_mem_size()), rs_mem_size_percent_of(total), amount(), _name);
191 } 192 }
192 193
193 void print_cards_occupied_info_on(outputStream * out, size_t total) { 194 void print_cards_occupied_info_on(outputStream * out, size_t total) {
194 out->print_cr(" %8d (%5.1f%%) entries by %zd %s regions", cards_occupied(), cards_occupied_percent_of(total), amount(), _name); 195 out->print_cr(" "SIZE_FORMAT_W(8)" (%5.1f%%) entries by "SIZE_FORMAT" %s regions",
196 cards_occupied(), cards_occupied_percent_of(total), amount(), _name);
195 } 197 }
196 198
197 void print_code_root_mem_info_on(outputStream * out, size_t total) { 199 void print_code_root_mem_info_on(outputStream * out, size_t total) {
198 out->print_cr(" %8dK (%5.1f%%) by %zd %s regions", round_to_K(code_root_mem_size()), code_root_mem_size_percent_of(total), amount(), _name); 200 out->print_cr(" "SIZE_FORMAT_W(8)"K (%5.1f%%) by "SIZE_FORMAT" %s regions",
201 round_to_K(code_root_mem_size()), code_root_mem_size_percent_of(total), amount(), _name);
199 } 202 }
200 203
201 void print_code_root_elems_info_on(outputStream * out, size_t total) { 204 void print_code_root_elems_info_on(outputStream * out, size_t total) {
202 out->print_cr(" %8d (%5.1f%%) elements by %zd %s regions", code_root_elems(), code_root_elems_percent_of(total), amount(), _name); 205 out->print_cr(" "SIZE_FORMAT_W(8)" (%5.1f%%) elements by "SIZE_FORMAT" %s regions",
206 code_root_elems(), code_root_elems_percent_of(total), amount(), _name);
203 } 207 }
204 }; 208 };
205 209
206 210
207 class HRRSStatsIter: public HeapRegionClosure { 211 class HRRSStatsIter: public HeapRegionClosure {
325 329
326 void G1RemSetSummary::print_on(outputStream* out) { 330 void G1RemSetSummary::print_on(outputStream* out) {
327 out->print_cr("\n Recent concurrent refinement statistics"); 331 out->print_cr("\n Recent concurrent refinement statistics");
328 out->print_cr(" Processed "SIZE_FORMAT" cards", 332 out->print_cr(" Processed "SIZE_FORMAT" cards",
329 num_concurrent_refined_cards()); 333 num_concurrent_refined_cards());
330 out->print_cr(" Of %d completed buffers:", num_processed_buf_total()); 334 out->print_cr(" Of "SIZE_FORMAT" completed buffers:", num_processed_buf_total());
331 out->print_cr(" %8d (%5.1f%%) by concurrent RS threads.", 335 out->print_cr(" "SIZE_FORMAT_W(8)" (%5.1f%%) by concurrent RS threads.",
332 num_processed_buf_total(), 336 num_processed_buf_total(),
333 percent_of(num_processed_buf_rs_threads(), num_processed_buf_total())); 337 percent_of(num_processed_buf_rs_threads(), num_processed_buf_total()));
334 out->print_cr(" %8d (%5.1f%%) by mutator threads.", 338 out->print_cr(" "SIZE_FORMAT_W(8)" (%5.1f%%) by mutator threads.",
335 num_processed_buf_mutator(), 339 num_processed_buf_mutator(),
336 percent_of(num_processed_buf_mutator(), num_processed_buf_total())); 340 percent_of(num_processed_buf_mutator(), num_processed_buf_total()));
337 out->print_cr(" Did %d coarsenings.", num_coarsenings()); 341 out->print_cr(" Did "SIZE_FORMAT" coarsenings.", num_coarsenings());
338 out->print_cr(" Concurrent RS threads times (s)"); 342 out->print_cr(" Concurrent RS threads times (s)");
339 out->print(" "); 343 out->print(" ");
340 for (uint i = 0; i < _num_vtimes; i++) { 344 for (uint i = 0; i < _num_vtimes; i++) {
341 out->print(" %5.2f", rs_thread_vtime(i)); 345 out->print(" %5.2f", rs_thread_vtime(i));
342 } 346 }