2199 2200 st->print("Memory:"); 2201 st->print(" %dk page", os::vm_page_size()>>10); 2202 2203 // values in struct sysinfo are "unsigned long" 2204 struct sysinfo si; 2205 sysinfo(&si); 2206 2207 st->print(", physical " UINT64_FORMAT "k", 2208 os::physical_memory() >> 10); 2209 st->print("(" UINT64_FORMAT "k free)", 2210 os::available_memory() >> 10); 2211 st->print(", swap " UINT64_FORMAT "k", 2212 ((jlong)si.totalswap * si.mem_unit) >> 10); 2213 st->print("(" UINT64_FORMAT "k free)", 2214 ((jlong)si.freeswap * si.mem_unit) >> 10); 2215 st->cr(); 2216 } 2217 2218 void os::pd_print_cpu_info(outputStream* st) { 2219 st->print("\n/proc/cpuinfo:\n"); 2220 if (!_print_ascii_file("/proc/cpuinfo", st)) { 2221 st->print(" <Not Available>"); 2222 } 2223 st->cr(); 2224 } 2225 2226 void os::print_siginfo(outputStream* st, void* siginfo) { 2227 const siginfo_t* si = (const siginfo_t*)siginfo; 2228 2229 os::Posix::print_siginfo_brief(st, si); 2230 #if INCLUDE_CDS 2231 if (si && (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) && 2232 UseSharedSpaces) { 2233 FileMapInfo* mapinfo = FileMapInfo::current_info(); 2234 if (mapinfo->is_in_shared_space(si->si_addr)) { 2235 st->print("\n\nError accessing class data sharing archive." \ 2236 " Mapped file inaccessible during execution, " \ 2237 " possible disk/network problem."); 2238 } 2239 } 2240 #endif 2241 st->cr(); 2242 } 2243 | 2199 2200 st->print("Memory:"); 2201 st->print(" %dk page", os::vm_page_size()>>10); 2202 2203 // values in struct sysinfo are "unsigned long" 2204 struct sysinfo si; 2205 sysinfo(&si); 2206 2207 st->print(", physical " UINT64_FORMAT "k", 2208 os::physical_memory() >> 10); 2209 st->print("(" UINT64_FORMAT "k free)", 2210 os::available_memory() >> 10); 2211 st->print(", swap " UINT64_FORMAT "k", 2212 ((jlong)si.totalswap * si.mem_unit) >> 10); 2213 st->print("(" UINT64_FORMAT "k free)", 2214 ((jlong)si.freeswap * si.mem_unit) >> 10); 2215 st->cr(); 2216 } 2217 2218 void os::pd_print_cpu_info(outputStream* st) { 2219 #if defined(IA32) || defined(AMD64) 2220 // Only print the model name if the platform provides this as a summary 2221 st->print("\n/proc/cpuinfo:\n"); 2222 FILE *fp = fopen("/proc/cpuinfo", "r"); 2223 if (fp) { 2224 while (!feof(fp)) { 2225 char buf[256]; 2226 if (fgets(buf, sizeof(buf), fp)) { 2227 if (strstr(buf, "model name") != NULL) { 2228 st->print_raw(buf); 2229 break; 2230 } 2231 } 2232 } 2233 } else { 2234 st->print_cr(" <Not Available>"); 2235 } 2236 #else 2237 // Other platforms have reasonable cpuinfo files 2238 if (!_print_ascii_file("/proc/cpuinfo", st)) { 2239 st->print_cr(" <Not Available>"); 2240 } 2241 #endif 2242 } 2243 2244 void os::print_siginfo(outputStream* st, void* siginfo) { 2245 const siginfo_t* si = (const siginfo_t*)siginfo; 2246 2247 os::Posix::print_siginfo_brief(st, si); 2248 #if INCLUDE_CDS 2249 if (si && (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) && 2250 UseSharedSpaces) { 2251 FileMapInfo* mapinfo = FileMapInfo::current_info(); 2252 if (mapinfo->is_in_shared_space(si->si_addr)) { 2253 st->print("\n\nError accessing class data sharing archive." \ 2254 " Mapped file inaccessible during execution, " \ 2255 " possible disk/network problem."); 2256 } 2257 } 2258 #endif 2259 st->cr(); 2260 } 2261 |