1533 filename, ::getenv("LIBPATH"), ::getenv("LD_LIBRARY_PATH"), error_report); 1534 } 1535 } 1536 return NULL; 1537 } 1538 1539 void* os::dll_lookup(void* handle, const char* name) { 1540 void* res = dlsym(handle, name); 1541 return res; 1542 } 1543 1544 void* os::get_default_process_handle() { 1545 return (void*)::dlopen(NULL, RTLD_LAZY); 1546 } 1547 1548 void os::print_dll_info(outputStream *st) { 1549 st->print_cr("Dynamic libraries:"); 1550 LoadedLibraries::print(st); 1551 } 1552 1553 void os::print_os_info(outputStream* st) { 1554 st->print("OS:"); 1555 1556 st->print("uname:"); 1557 struct utsname name; 1558 uname(&name); 1559 st->print(name.sysname); st->print(" "); 1560 st->print(name.nodename); st->print(" "); 1561 st->print(name.release); st->print(" "); 1562 st->print(name.version); st->print(" "); 1563 st->print(name.machine); 1564 st->cr(); 1565 1566 // rlimit 1567 st->print("rlimit:"); 1568 struct rlimit rlim; 1569 1570 st->print(" STACK "); 1571 getrlimit(RLIMIT_STACK, &rlim); 1572 if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity"); 1634 // Call os::Aix::get_meminfo() to retrieve memory statistics. 1635 os::Aix::meminfo_t mi; 1636 if (os::Aix::get_meminfo(&mi)) { 1637 char buffer[256]; 1638 if (os::Aix::on_aix()) { 1639 jio_snprintf(buffer, sizeof(buffer), 1640 " physical total : %llu\n" 1641 " physical free : %llu\n" 1642 " swap total : %llu\n" 1643 " swap free : %llu\n", 1644 mi.real_total, 1645 mi.real_free, 1646 mi.pgsp_total, 1647 mi.pgsp_free); 1648 } else { 1649 Unimplemented(); 1650 } 1651 st->print_raw(buffer); 1652 } else { 1653 st->print_cr(" (no more information available)"); 1654 } 1655 } 1656 1657 void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) { 1658 } 1659 1660 void os::print_siginfo(outputStream* st, void* siginfo) { 1661 // Use common posix version. 1662 os::Posix::print_siginfo_brief(st, (const siginfo_t*) siginfo); 1663 st->cr(); 1664 } 1665 1666 static void print_signal_handler(outputStream* st, int sig, 1667 char* buf, size_t buflen); 1668 1669 void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) { 1670 st->print_cr("Signal Handlers:"); 1671 print_signal_handler(st, SIGSEGV, buf, buflen); 1672 print_signal_handler(st, SIGBUS , buf, buflen); 1673 print_signal_handler(st, SIGFPE , buf, buflen); | 1533 filename, ::getenv("LIBPATH"), ::getenv("LD_LIBRARY_PATH"), error_report); 1534 } 1535 } 1536 return NULL; 1537 } 1538 1539 void* os::dll_lookup(void* handle, const char* name) { 1540 void* res = dlsym(handle, name); 1541 return res; 1542 } 1543 1544 void* os::get_default_process_handle() { 1545 return (void*)::dlopen(NULL, RTLD_LAZY); 1546 } 1547 1548 void os::print_dll_info(outputStream *st) { 1549 st->print_cr("Dynamic libraries:"); 1550 LoadedLibraries::print(st); 1551 } 1552 1553 void os::get_summary_os_info(char* buf, size_t buflen) { 1554 // There might be something more readable than uname results for AIX. 1555 struct utsname name; 1556 uname(&name); 1557 snprintf(buf, buflen, "%s %s", name.release, name.version); 1558 } 1559 1560 void os::print_os_info(outputStream* st) { 1561 st->print("OS:"); 1562 1563 st->print("uname:"); 1564 struct utsname name; 1565 uname(&name); 1566 st->print(name.sysname); st->print(" "); 1567 st->print(name.nodename); st->print(" "); 1568 st->print(name.release); st->print(" "); 1569 st->print(name.version); st->print(" "); 1570 st->print(name.machine); 1571 st->cr(); 1572 1573 // rlimit 1574 st->print("rlimit:"); 1575 struct rlimit rlim; 1576 1577 st->print(" STACK "); 1578 getrlimit(RLIMIT_STACK, &rlim); 1579 if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity"); 1641 // Call os::Aix::get_meminfo() to retrieve memory statistics. 1642 os::Aix::meminfo_t mi; 1643 if (os::Aix::get_meminfo(&mi)) { 1644 char buffer[256]; 1645 if (os::Aix::on_aix()) { 1646 jio_snprintf(buffer, sizeof(buffer), 1647 " physical total : %llu\n" 1648 " physical free : %llu\n" 1649 " swap total : %llu\n" 1650 " swap free : %llu\n", 1651 mi.real_total, 1652 mi.real_free, 1653 mi.pgsp_total, 1654 mi.pgsp_free); 1655 } else { 1656 Unimplemented(); 1657 } 1658 st->print_raw(buffer); 1659 } else { 1660 st->print_cr(" (no more information available)"); 1661 } 1662 } 1663 1664 // Get a string for the cpuinfo that is a summary of the cpu type 1665 void os::get_summary_cpu_info(char* buf, size_t buflen) { 1666 // This looks good 1667 os::Aix::cpuinfo_t ci; 1668 if (os::Aix::get_cpuinfo(&ci)) { 1669 strncpy(buf, ci.version, buflen); 1670 } else { 1671 strncpy(buf, "AIX", buflen); 1672 } 1673 } 1674 1675 void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) { 1676 } 1677 1678 void os::print_siginfo(outputStream* st, void* siginfo) { 1679 // Use common posix version. 1680 os::Posix::print_siginfo_brief(st, (const siginfo_t*) siginfo); 1681 st->cr(); 1682 } 1683 1684 static void print_signal_handler(outputStream* st, int sig, 1685 char* buf, size_t buflen); 1686 1687 void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) { 1688 st->print_cr("Signal Handlers:"); 1689 print_signal_handler(st, SIGSEGV, buf, buflen); 1690 print_signal_handler(st, SIGBUS , buf, buflen); 1691 print_signal_handler(st, SIGFPE , buf, buflen); |