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

*** 1969,1978 **** --- 1969,1997 ---- st->print("Solaris"); } st->cr(); } + void os::get_summary_os_info(char* buf, size_t buflen) { + strncpy(buf, "Solaris", buflen); // default to plain solaris + FILE* fp = fopen("/etc/release", "r"); + if (fp != NULL) { + char tmp[256]; + if (fgets(tmp, 256, fp)) { + char* ptr = tmp; + // skip past whitespace characters + while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t' || *ptr == '\n')) ptr++; + if (*ptr != '\0') { + char* nl = strchr(ptr, '\n'); + if (nl != NULL) *nl = '\0'; + strncpy(buf, ptr, buflen); + } + } + fclose(fp); + } + } + void os::Solaris::print_libversion_info(outputStream* st) { st->print(" (T2 libthread)"); st->cr(); }
*** 1996,2005 **** --- 2015,2041 ---- ::close(fd); } return status; } + void os::get_summary_cpu_info(char* buf, size_t buflen) { + // Get MHz with system call. We don't seem to already have this. + processor_info_t stats; + processorid_t id = getcpuid(); + int clock = 0; + if (processor_info(id, &stats) != -1) { + clock = stats.pi_clock; // pi_processor_type isn't more informative than below + } + #ifdef AMD64 + snprintf(buf, buflen, "x86 64 bit %d MHz", clock); + #elif (defined __sparc) && (defined _LP64) + snprintf(buf, buflen, "Sparcv9 64 bit %d MHz", clock); + #else + #error "Invalid solaris configuration" + #endif + } + void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) { // Nothing to do for now. } void os::print_memory_info(outputStream* st) {

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