8295993: use K instead of 1024 in a couple of hotspot outputs

Reviewed-by: lucy, dholmes
This commit is contained in:
Matthias Baesken 2022-10-31 09:09:43 +00:00
parent 9b9be88bca
commit 274ea1db5b
4 changed files with 12 additions and 13 deletions

View file

@ -141,7 +141,7 @@ void OSContainer::print_container_helper(outputStream* st, jlong j, const char*
st->print("%s: ", metrics); st->print("%s: ", metrics);
if (j > 0) { if (j > 0) {
if (j >= 1024) { if (j >= 1024) {
st->print_cr(UINT64_FORMAT " k", uint64_t(j) / 1024); st->print_cr(UINT64_FORMAT " k", uint64_t(j) / K);
} else { } else {
st->print_cr(UINT64_FORMAT, uint64_t(j)); st->print_cr(UINT64_FORMAT, uint64_t(j));
} }

View file

@ -138,7 +138,7 @@ void os::check_dump_limit(char* buffer, size_t bufferSize) {
success = false; success = false;
break; break;
default: default:
jio_snprintf(buffer, bufferSize, "%s (max size " UINT64_FORMAT " kB). To ensure a full core dump, try \"ulimit -c unlimited\" before starting Java again", core_path, uint64_t(rlim.rlim_cur) / 1024); jio_snprintf(buffer, bufferSize, "%s (max size " UINT64_FORMAT " k). To ensure a full core dump, try \"ulimit -c unlimited\" before starting Java again", core_path, uint64_t(rlim.rlim_cur) / K);
success = true; success = true;
break; break;
} }
@ -479,14 +479,14 @@ static void print_rlimit(outputStream* st, const char* msg,
// soft limit // soft limit
if (rlim.rlim_cur == RLIM_INFINITY) { st->print("infinity"); } if (rlim.rlim_cur == RLIM_INFINITY) { st->print("infinity"); }
else { else {
if (output_k) { st->print(UINT64_FORMAT "k", uint64_t(rlim.rlim_cur) / 1024); } if (output_k) { st->print(UINT64_FORMAT "k", uint64_t(rlim.rlim_cur) / K); }
else { st->print(UINT64_FORMAT, uint64_t(rlim.rlim_cur)); } else { st->print(UINT64_FORMAT, uint64_t(rlim.rlim_cur)); }
} }
// hard limit // hard limit
st->print("/"); st->print("/");
if (rlim.rlim_max == RLIM_INFINITY) { st->print("infinity"); } if (rlim.rlim_max == RLIM_INFINITY) { st->print("infinity"); }
else { else {
if (output_k) { st->print(UINT64_FORMAT "k", uint64_t(rlim.rlim_max) / 1024); } if (output_k) { st->print(UINT64_FORMAT "k", uint64_t(rlim.rlim_max) / K); }
else { st->print(UINT64_FORMAT, uint64_t(rlim.rlim_max)); } else { st->print(UINT64_FORMAT, uint64_t(rlim.rlim_max)); }
} }
} }
@ -897,7 +897,7 @@ char* os::Posix::describe_pthread_attr(char* buf, size_t buflen, const pthread_a
LINUX_ONLY(stack_size -= guard_size); LINUX_ONLY(stack_size -= guard_size);
pthread_attr_getdetachstate(attr, &detachstate); pthread_attr_getdetachstate(attr, &detachstate);
jio_snprintf(buf, buflen, "stacksize: " SIZE_FORMAT "k, guardsize: " SIZE_FORMAT "k, %s", jio_snprintf(buf, buflen, "stacksize: " SIZE_FORMAT "k, guardsize: " SIZE_FORMAT "k, %s",
stack_size / 1024, guard_size / 1024, stack_size / K, guard_size / K,
(detachstate == PTHREAD_CREATE_DETACHED ? "detached" : "joinable")); (detachstate == PTHREAD_CREATE_DETACHED ? "detached" : "joinable"));
return buf; return buf;
} }

View file

@ -532,7 +532,7 @@ static unsigned __stdcall thread_native_entry(Thread* thread) {
res = 20115; // java thread res = 20115; // java thread
} }
log_info(os, thread)("Thread is alive (tid: " UINTX_FORMAT ", stacksize: " SIZE_FORMAT "k).", os::current_thread_id(), thread->stack_size() / 1024); log_info(os, thread)("Thread is alive (tid: " UINTX_FORMAT ", stacksize: " SIZE_FORMAT "k).", os::current_thread_id(), thread->stack_size() / K);
#ifdef USE_VECTORED_EXCEPTION_HANDLING #ifdef USE_VECTORED_EXCEPTION_HANDLING
// Any exception is caught by the Vectored Exception Handler, so VM can // Any exception is caught by the Vectored Exception Handler, so VM can
@ -650,7 +650,7 @@ static char* describe_beginthreadex_attributes(char* buf, size_t buflen,
if (stacksize == 0) { if (stacksize == 0) {
ss.print("stacksize: default, "); ss.print("stacksize: default, ");
} else { } else {
ss.print("stacksize: " SIZE_FORMAT "k, ", stacksize / 1024); ss.print("stacksize: " SIZE_FORMAT "k, ", stacksize / K);
} }
ss.print("flags: "); ss.print("flags: ");
#define PRINT_FLAG(f) if (initflag & f) ss.print( #f " "); #define PRINT_FLAG(f) if (initflag & f) ss.print( #f " ");

View file

@ -876,8 +876,7 @@ void SymbolTable::print_histogram() {
_local_table->do_scan(Thread::current(), hi); _local_table->do_scan(Thread::current(), hi);
tty->print_cr("Symbol Table Histogram:"); tty->print_cr("Symbol Table Histogram:");
tty->print_cr(" Total number of symbols " SIZE_FORMAT_W(7), hi.total_count); tty->print_cr(" Total number of symbols " SIZE_FORMAT_W(7), hi.total_count);
tty->print_cr(" Total size in memory " SIZE_FORMAT_W(7) "K", tty->print_cr(" Total size in memory " SIZE_FORMAT_W(7) "K", (hi.total_size * wordSize) / K);
(hi.total_size * wordSize) / 1024);
tty->print_cr(" Total counted " SIZE_FORMAT_W(7), _symbols_counted); tty->print_cr(" Total counted " SIZE_FORMAT_W(7), _symbols_counted);
tty->print_cr(" Total removed " SIZE_FORMAT_W(7), _symbols_removed); tty->print_cr(" Total removed " SIZE_FORMAT_W(7), _symbols_removed);
if (_symbols_counted > 0) { if (_symbols_counted > 0) {
@ -885,8 +884,8 @@ void SymbolTable::print_histogram() {
((float)_symbols_removed / _symbols_counted) * 100); ((float)_symbols_removed / _symbols_counted) * 100);
} }
tty->print_cr(" Reference counts " SIZE_FORMAT_W(7), Symbol::_total_count); tty->print_cr(" Reference counts " SIZE_FORMAT_W(7), Symbol::_total_count);
tty->print_cr(" Symbol arena used " SIZE_FORMAT_W(7) "K", arena()->used() / 1024); tty->print_cr(" Symbol arena used " SIZE_FORMAT_W(7) "K", arena()->used() / K);
tty->print_cr(" Symbol arena size " SIZE_FORMAT_W(7) "K", arena()->size_in_bytes() / 1024); tty->print_cr(" Symbol arena size " SIZE_FORMAT_W(7) "K", arena()->size_in_bytes() / K);
tty->print_cr(" Total symbol length " SIZE_FORMAT_W(7), hi.total_length); tty->print_cr(" Total symbol length " SIZE_FORMAT_W(7), hi.total_length);
tty->print_cr(" Maximum symbol length " SIZE_FORMAT_W(7), hi.max_length); tty->print_cr(" Maximum symbol length " SIZE_FORMAT_W(7), hi.max_length);
tty->print_cr(" Average symbol length %7.2f", ((float)hi.total_length / hi.total_count)); tty->print_cr(" Average symbol length %7.2f", ((float)hi.total_length / hi.total_count));
@ -895,11 +894,11 @@ void SymbolTable::print_histogram() {
for (size_t i = 0; i < hi.results_length; i++) { for (size_t i = 0; i < hi.results_length; i++) {
if (hi.counts[i] > 0) { if (hi.counts[i] > 0) {
tty->print_cr(" " SIZE_FORMAT_W(6) " " SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) "K", tty->print_cr(" " SIZE_FORMAT_W(6) " " SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) "K",
i, hi.counts[i], (hi.sizes[i] * wordSize) / 1024); i, hi.counts[i], (hi.sizes[i] * wordSize) / K);
} }
} }
tty->print_cr(" >=" SIZE_FORMAT_W(6) " " SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) "K\n", tty->print_cr(" >=" SIZE_FORMAT_W(6) " " SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) "K\n",
hi.results_length, hi.out_of_range_count, (hi.out_of_range_size*wordSize) / 1024); hi.results_length, hi.out_of_range_count, (hi.out_of_range_size*wordSize) / K);
} }
#endif // PRODUCT #endif // PRODUCT