--- old/src/os/solaris/vm/os_solaris.cpp 2015-07-16 15:07:35.682154835 -0400 +++ new/src/os/solaris/vm/os_solaris.cpp 2015-07-16 15:07:34.303587813 -0400 @@ -1971,6 +1971,25 @@ 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(); @@ -1998,6 +2017,23 @@ 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. }