Mercurial > hg > truffle
comparison src/os/solaris/vm/os_solaris.cpp @ 6080:7432b9db36ff
7165755: OS Information much longer on linux than other platforms
Reviewed-by: sla, dholmes
author | nloodin |
---|---|
date | Thu, 10 May 2012 15:44:19 +0200 |
parents | da4be62fb889 |
children | d2a62e0f25eb |
comparison
equal
deleted
inserted
replaced
6079:9793f47cdebc | 6080:7432b9db36ff |
---|---|
2240 ::close(fd); | 2240 ::close(fd); |
2241 | 2241 |
2242 return true; | 2242 return true; |
2243 } | 2243 } |
2244 | 2244 |
2245 void os::print_os_info_brief(outputStream* st) { | |
2246 os::Solaris::print_distro_info(st); | |
2247 | |
2248 os::Posix::print_uname_info(st); | |
2249 | |
2250 os::Solaris::print_libversion_info(st); | |
2251 } | |
2252 | |
2245 void os::print_os_info(outputStream* st) { | 2253 void os::print_os_info(outputStream* st) { |
2246 st->print("OS:"); | 2254 st->print("OS:"); |
2247 | 2255 |
2256 os::Solaris::print_distro_info(st); | |
2257 | |
2258 os::Posix::print_uname_info(st); | |
2259 | |
2260 os::Solaris::print_libversion_info(st); | |
2261 | |
2262 os::Posix::print_rlimit_info(st); | |
2263 | |
2264 os::Posix::print_load_average(st); | |
2265 } | |
2266 | |
2267 void os::Solaris::print_distro_info(outputStream* st) { | |
2248 if (!_print_ascii_file("/etc/release", st)) { | 2268 if (!_print_ascii_file("/etc/release", st)) { |
2249 st->print("Solaris"); | 2269 st->print("Solaris"); |
2270 } | |
2271 st->cr(); | |
2272 } | |
2273 | |
2274 void os::Solaris::print_libversion_info(outputStream* st) { | |
2275 if (os::Solaris::T2_libthread()) { | |
2276 st->print(" (T2 libthread)"); | |
2277 } | |
2278 else { | |
2279 st->print(" (T1 libthread)"); | |
2250 } | 2280 } |
2251 st->cr(); | 2281 st->cr(); |
2252 | 2282 } |
2253 // kernel | |
2254 st->print("uname:"); | |
2255 struct utsname name; | |
2256 uname(&name); | |
2257 st->print(name.sysname); st->print(" "); | |
2258 st->print(name.release); st->print(" "); | |
2259 st->print(name.version); st->print(" "); | |
2260 st->print(name.machine); | |
2261 | |
2262 // libthread | |
2263 if (os::Solaris::T2_libthread()) st->print(" (T2 libthread)"); | |
2264 else st->print(" (T1 libthread)"); | |
2265 st->cr(); | |
2266 | |
2267 // rlimit | |
2268 st->print("rlimit:"); | |
2269 struct rlimit rlim; | |
2270 | |
2271 st->print(" STACK "); | |
2272 getrlimit(RLIMIT_STACK, &rlim); | |
2273 if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity"); | |
2274 else st->print("%uk", rlim.rlim_cur >> 10); | |
2275 | |
2276 st->print(", CORE "); | |
2277 getrlimit(RLIMIT_CORE, &rlim); | |
2278 if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity"); | |
2279 else st->print("%uk", rlim.rlim_cur >> 10); | |
2280 | |
2281 st->print(", NOFILE "); | |
2282 getrlimit(RLIMIT_NOFILE, &rlim); | |
2283 if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity"); | |
2284 else st->print("%d", rlim.rlim_cur); | |
2285 | |
2286 st->print(", AS "); | |
2287 getrlimit(RLIMIT_AS, &rlim); | |
2288 if (rlim.rlim_cur == RLIM_INFINITY) st->print("infinity"); | |
2289 else st->print("%uk", rlim.rlim_cur >> 10); | |
2290 st->cr(); | |
2291 | |
2292 // load average | |
2293 st->print("load average:"); | |
2294 double loadavg[3]; | |
2295 os::loadavg(loadavg, 3); | |
2296 st->print("%0.02f %0.02f %0.02f", loadavg[0], loadavg[1], loadavg[2]); | |
2297 st->cr(); | |
2298 } | |
2299 | |
2300 | 2283 |
2301 static bool check_addr0(outputStream* st) { | 2284 static bool check_addr0(outputStream* st) { |
2302 jboolean status = false; | 2285 jboolean status = false; |
2303 int fd = ::open("/proc/self/map",O_RDONLY); | 2286 int fd = ::open("/proc/self/map",O_RDONLY); |
2304 if (fd >= 0) { | 2287 if (fd >= 0) { |