< prev index next >

src/hotspot/os/linux/os_linux.cpp

Print this page
rev 51830 : 8210964: add more ld preloading info to hs_error file on Linux


1958   os::Linux::print_distro_info(st);
1959 
1960   os::Posix::print_uname_info(st);
1961 
1962   // Print warning if unsafe chroot environment detected
1963   if (unsafe_chroot_detected) {
1964     st->print("WARNING!! ");
1965     st->print_cr("%s", unstable_chroot_error);
1966   }
1967 
1968   os::Linux::print_libversion_info(st);
1969 
1970   os::Posix::print_rlimit_info(st);
1971 
1972   os::Posix::print_load_average(st);
1973 
1974   os::Linux::print_full_memory_info(st);
1975 
1976   os::Linux::print_proc_sys_info(st);
1977 


1978   os::Linux::print_container_info(st);
1979 }
1980 
1981 // Try to identify popular distros.
1982 // Most Linux distributions have a /etc/XXX-release file, which contains
1983 // the OS version string. Newer Linux distributions have a /etc/lsb-release
1984 // file that also contains the OS version string. Some have more than one
1985 // /etc/XXX-release file (e.g. Mandrake has both /etc/mandrake-release and
1986 // /etc/redhat-release.), so the order is important.
1987 // Any Linux that is based on Redhat (i.e. Oracle, Mandrake, Sun JDS...) have
1988 // their own specific XXX-release file as well as a redhat-release file.
1989 // Because of this the XXX-release file needs to be searched for before the
1990 // redhat-release file.
1991 // Since Red Hat and SuSE have an lsb-release file that is not very descriptive the
1992 // search for redhat-release / SuSE-release needs to be before lsb-release.
1993 // Since the lsb-release file is the new standard it needs to be searched
1994 // before the older style release files.
1995 // Searching system-release (Red Hat) and os-release (other Linuxes) are a
1996 // next to last resort.  The os-release file is a new standard that contains
1997 // distribution information and the system-release file seems to be an old


2113   st->cr();
2114   st->print_cr("/proc/sys/kernel/threads-max (system-wide limit on the number of threads):");
2115   _print_ascii_file("/proc/sys/kernel/threads-max", st);
2116   st->cr();
2117   st->cr();
2118 
2119   st->print_cr("/proc/sys/vm/max_map_count (maximum number of memory map areas a process may have):");
2120   _print_ascii_file("/proc/sys/vm/max_map_count", st);
2121   st->cr();
2122   st->cr();
2123 
2124   st->print_cr("/proc/sys/kernel/pid_max (system-wide limit on number of process identifiers):");
2125   _print_ascii_file("/proc/sys/kernel/pid_max", st);
2126   st->cr();
2127   st->cr();
2128 }
2129 
2130 void os::Linux::print_full_memory_info(outputStream* st) {
2131   st->print("\n/proc/meminfo:\n");
2132   _print_ascii_file("/proc/meminfo", st);









2133   st->cr();
2134 }
2135 
2136 void os::Linux::print_container_info(outputStream* st) {
2137   if (!OSContainer::is_containerized()) {
2138     return;
2139   }
2140 
2141   st->print("container (cgroup) information:\n");
2142 
2143   const char *p_ct = OSContainer::container_type();
2144   st->print("container_type: %s\n", p_ct != NULL ? p_ct : "failed");
2145 
2146   char *p = OSContainer::cpu_cpuset_cpus();
2147   st->print("cpu_cpuset_cpus: %s\n", p != NULL ? p : "failed");
2148   free(p);
2149 
2150   p = OSContainer::cpu_cpuset_memory_nodes();
2151   st->print("cpu_memory_nodes: %s\n", p != NULL ? p : "failed");
2152   free(p);




1958   os::Linux::print_distro_info(st);
1959 
1960   os::Posix::print_uname_info(st);
1961 
1962   // Print warning if unsafe chroot environment detected
1963   if (unsafe_chroot_detected) {
1964     st->print("WARNING!! ");
1965     st->print_cr("%s", unstable_chroot_error);
1966   }
1967 
1968   os::Linux::print_libversion_info(st);
1969 
1970   os::Posix::print_rlimit_info(st);
1971 
1972   os::Posix::print_load_average(st);
1973 
1974   os::Linux::print_full_memory_info(st);
1975 
1976   os::Linux::print_proc_sys_info(st);
1977 
1978   os::Linux::print_system_config_info(st);
1979 
1980   os::Linux::print_container_info(st);
1981 }
1982 
1983 // Try to identify popular distros.
1984 // Most Linux distributions have a /etc/XXX-release file, which contains
1985 // the OS version string. Newer Linux distributions have a /etc/lsb-release
1986 // file that also contains the OS version string. Some have more than one
1987 // /etc/XXX-release file (e.g. Mandrake has both /etc/mandrake-release and
1988 // /etc/redhat-release.), so the order is important.
1989 // Any Linux that is based on Redhat (i.e. Oracle, Mandrake, Sun JDS...) have
1990 // their own specific XXX-release file as well as a redhat-release file.
1991 // Because of this the XXX-release file needs to be searched for before the
1992 // redhat-release file.
1993 // Since Red Hat and SuSE have an lsb-release file that is not very descriptive the
1994 // search for redhat-release / SuSE-release needs to be before lsb-release.
1995 // Since the lsb-release file is the new standard it needs to be searched
1996 // before the older style release files.
1997 // Searching system-release (Red Hat) and os-release (other Linuxes) are a
1998 // next to last resort.  The os-release file is a new standard that contains
1999 // distribution information and the system-release file seems to be an old


2115   st->cr();
2116   st->print_cr("/proc/sys/kernel/threads-max (system-wide limit on the number of threads):");
2117   _print_ascii_file("/proc/sys/kernel/threads-max", st);
2118   st->cr();
2119   st->cr();
2120 
2121   st->print_cr("/proc/sys/vm/max_map_count (maximum number of memory map areas a process may have):");
2122   _print_ascii_file("/proc/sys/vm/max_map_count", st);
2123   st->cr();
2124   st->cr();
2125 
2126   st->print_cr("/proc/sys/kernel/pid_max (system-wide limit on number of process identifiers):");
2127   _print_ascii_file("/proc/sys/kernel/pid_max", st);
2128   st->cr();
2129   st->cr();
2130 }
2131 
2132 void os::Linux::print_full_memory_info(outputStream* st) {
2133   st->print("\n/proc/meminfo:\n");
2134   _print_ascii_file("/proc/meminfo", st);
2135   st->cr();
2136 }
2137 
2138 void os::Linux::print_system_config_info(outputStream* st) {
2139   st->cr();
2140   st->print_cr("/etc/ld.so.preload (system-wide LD_PRELOAD config file):");
2141   bool file_present = _print_ascii_file("/etc/ld.so.preload", st);
2142   if (!file_present) { st->print("file not present"); }
2143   st->cr();
2144   st->cr();
2145 }
2146 
2147 void os::Linux::print_container_info(outputStream* st) {
2148   if (!OSContainer::is_containerized()) {
2149     return;
2150   }
2151 
2152   st->print("container (cgroup) information:\n");
2153 
2154   const char *p_ct = OSContainer::container_type();
2155   st->print("container_type: %s\n", p_ct != NULL ? p_ct : "failed");
2156 
2157   char *p = OSContainer::cpu_cpuset_cpus();
2158   st->print("cpu_cpuset_cpus: %s\n", p != NULL ? p : "failed");
2159   free(p);
2160 
2161   p = OSContainer::cpu_cpuset_memory_nodes();
2162   st->print("cpu_memory_nodes: %s\n", p != NULL ? p : "failed");
2163   free(p);


< prev index next >