src/share/vm/runtime/os.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/runtime/os.cpp	Thu Jul 16 15:07:35 2015
--- new/src/share/vm/runtime/os.cpp	Thu Jul 16 15:07:33 2015

*** 841,863 **** --- 841,886 ---- st->print(" %s", VM_Version::cpu_features()); st->cr(); pd_print_cpu_info(st, buf, buflen); } + // Print a one line string summarizing the cpu, number of cores, memory, and operating system version + void os::print_summary_info(outputStream* st, char* buf, size_t buflen) { + st->print("Host: "); + #ifndef PRODUCT + if (get_host_name(buf, buflen)) { + st->print("%s, ", buf); + } + #endif // PRODUCT + get_summary_cpu_info(buf, buflen); + st->print("%s, ", buf); + st->print("%d cores, %dG, ", processor_count(), physical_memory()/G); + get_summary_os_info(buf, buflen); + st->print_raw(buf); + st->cr(); + } + void os::print_date_and_time(outputStream *st, char* buf, size_t buflen) { const int secs_per_day = 86400; const int secs_per_hour = 3600; const int secs_per_min = 60; time_t tloc; (void)time(&tloc); ! st->print("time: %s", ctime(&tloc)); // ctime adds newline. ! char* timestring = ctime(&tloc); // ctime adds newline. + // edit out the newline + char* nl = strchr(timestring, '\n'); + if (nl != NULL) { + *nl = '\0'; + } struct tm tz; if (localtime_pd(&tloc, &tz) != NULL) { ::strftime(buf, buflen, "%Z", &tz); ! st->print_cr("timezone: %s", buf); ! st->print("Time: %s %s", timestring, buf); + } else { + st->print("Time: %s", timestring); } double t = os::elapsedTime(); // NOTE: It tends to crash after a SEGV if we want to printf("%f",...) in // Linux. Must be a bug in glibc ? Workaround is to round "t" to int
*** 870,880 **** --- 893,903 ---- int elhours = (eltime - day_secs) / secs_per_hour; int hour_secs = elhours * secs_per_hour; int elmins = (eltime - day_secs - hour_secs) / secs_per_min; int minute_secs = elmins * secs_per_min; int elsecs = (eltime - day_secs - hour_secs - minute_secs); ! st->print_cr(" elapsed time: %d seconds (%dd %dh %dm %ds)", eltime, eldays, elhours, elmins, elsecs); } // moved from debug.cpp (used to be find()) but still called from there // The verbose parameter is only set by the debug code in one case void os::print_location(outputStream* st, intptr_t x, bool verbose) {

src/share/vm/runtime/os.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File