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

src/os/solaris/vm/os_solaris.cpp

Print this page




1954   st->print("OS:");
1955 
1956   os::Solaris::print_distro_info(st);
1957 
1958   os::Posix::print_uname_info(st);
1959 
1960   os::Solaris::print_libversion_info(st);
1961 
1962   os::Posix::print_rlimit_info(st);
1963 
1964   os::Posix::print_load_average(st);
1965 }
1966 
1967 void os::Solaris::print_distro_info(outputStream* st) {
1968   if (!_print_ascii_file("/etc/release", st)) {
1969     st->print("Solaris");
1970   }
1971   st->cr();
1972 }
1973 



















1974 void os::Solaris::print_libversion_info(outputStream* st) {
1975   st->print("  (T2 libthread)");
1976   st->cr();
1977 }
1978 
1979 static bool check_addr0(outputStream* st) {
1980   jboolean status = false;
1981   int fd = ::open("/proc/self/map",O_RDONLY);
1982   if (fd >= 0) {
1983     prmap_t p;
1984     while (::read(fd, &p, sizeof(p)) > 0) {
1985       if (p.pr_vaddr == 0x0) {
1986         st->print("Warning: Address: 0x%x, Size: %dK, ",p.pr_vaddr, p.pr_size/1024, p.pr_mapname);
1987         st->print("Mapped file: %s, ", p.pr_mapname[0] == '\0' ? "None" : p.pr_mapname);
1988         st->print("Access:");
1989         st->print("%s",(p.pr_mflags & MA_READ)  ? "r" : "-");
1990         st->print("%s",(p.pr_mflags & MA_WRITE) ? "w" : "-");
1991         st->print("%s",(p.pr_mflags & MA_EXEC)  ? "x" : "-");
1992         st->cr();
1993         status = true;
1994       }
1995     }
1996     ::close(fd);
1997   }
1998   return status;

















1999 }
2000 
2001 void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) {
2002   // Nothing to do for now.
2003 }
2004 
2005 void os::print_memory_info(outputStream* st) {
2006   st->print("Memory:");
2007   st->print(" %dk page", os::vm_page_size()>>10);
2008   st->print(", physical " UINT64_FORMAT "k", os::physical_memory()>>10);
2009   st->print("(" UINT64_FORMAT "k free)", os::available_memory() >> 10);
2010   st->cr();
2011   (void) check_addr0(st);
2012 }
2013 
2014 void os::print_siginfo(outputStream* st, void* siginfo) {
2015   const siginfo_t* si = (const siginfo_t*)siginfo;
2016 
2017   os::Posix::print_siginfo_brief(st, si);
2018 




1954   st->print("OS:");
1955 
1956   os::Solaris::print_distro_info(st);
1957 
1958   os::Posix::print_uname_info(st);
1959 
1960   os::Solaris::print_libversion_info(st);
1961 
1962   os::Posix::print_rlimit_info(st);
1963 
1964   os::Posix::print_load_average(st);
1965 }
1966 
1967 void os::Solaris::print_distro_info(outputStream* st) {
1968   if (!_print_ascii_file("/etc/release", st)) {
1969     st->print("Solaris");
1970   }
1971   st->cr();
1972 }
1973 
1974 void os::get_summary_os_info(char* buf, size_t buflen) {
1975   strncpy(buf, "Solaris", buflen);  // default to plain solaris
1976   FILE* fp = fopen("/etc/release", "r");
1977   if (fp != NULL) {
1978     char tmp[256];
1979     if (fgets(tmp, 256, fp)) {
1980       char* ptr = tmp;
1981       // skip past whitespace characters
1982       while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t' || *ptr == '\n')) ptr++;
1983       if (*ptr != '\0') {
1984         char* nl = strchr(ptr, '\n');
1985         if (nl != NULL) *nl = '\0';
1986         strncpy(buf, ptr, buflen);
1987       }
1988     }
1989     fclose(fp);
1990   }
1991 }
1992 
1993 void os::Solaris::print_libversion_info(outputStream* st) {
1994   st->print("  (T2 libthread)");
1995   st->cr();
1996 }
1997 
1998 static bool check_addr0(outputStream* st) {
1999   jboolean status = false;
2000   int fd = ::open("/proc/self/map",O_RDONLY);
2001   if (fd >= 0) {
2002     prmap_t p;
2003     while (::read(fd, &p, sizeof(p)) > 0) {
2004       if (p.pr_vaddr == 0x0) {
2005         st->print("Warning: Address: 0x%x, Size: %dK, ",p.pr_vaddr, p.pr_size/1024, p.pr_mapname);
2006         st->print("Mapped file: %s, ", p.pr_mapname[0] == '\0' ? "None" : p.pr_mapname);
2007         st->print("Access:");
2008         st->print("%s",(p.pr_mflags & MA_READ)  ? "r" : "-");
2009         st->print("%s",(p.pr_mflags & MA_WRITE) ? "w" : "-");
2010         st->print("%s",(p.pr_mflags & MA_EXEC)  ? "x" : "-");
2011         st->cr();
2012         status = true;
2013       }
2014     }
2015     ::close(fd);
2016   }
2017   return status;
2018 }
2019 
2020 void os::get_summary_cpu_info(char* buf, size_t buflen) {
2021   // Get MHz with system call. We don't seem to already have this.
2022   processor_info_t stats;
2023   processorid_t id = getcpuid();
2024   int clock = 0;
2025   if (processor_info(id, &stats) != -1) {
2026     clock = stats.pi_clock;  // pi_processor_type isn't more informative than below
2027   }
2028 #ifdef AMD64
2029   snprintf(buf, buflen, "x86 64 bit %d MHz", clock);
2030 #elif  (defined __sparc) && (defined _LP64)
2031   snprintf(buf, buflen, "Sparcv9 64 bit %d MHz", clock);
2032 #else
2033 #error "Invalid solaris configuration"
2034 #endif
2035 }
2036 
2037 void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) {
2038   // Nothing to do for now.
2039 }
2040 
2041 void os::print_memory_info(outputStream* st) {
2042   st->print("Memory:");
2043   st->print(" %dk page", os::vm_page_size()>>10);
2044   st->print(", physical " UINT64_FORMAT "k", os::physical_memory()>>10);
2045   st->print("(" UINT64_FORMAT "k free)", os::available_memory() >> 10);
2046   st->cr();
2047   (void) check_addr0(st);
2048 }
2049 
2050 void os::print_siginfo(outputStream* st, void* siginfo) {
2051   const siginfo_t* si = (const siginfo_t*)siginfo;
2052 
2053   os::Posix::print_siginfo_brief(st, si);
2054 


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