hotspot/src/os/linux/vm/os_linux.cpp
changeset 32742 c47e215ba55b
parent 32353 90d7e2214fe5
child 33105 294e48b4f704
equal deleted inserted replaced
32737:f02118695c2f 32742:c47e215ba55b
  2209       st->print_cr("  <Not Available>");
  2209       st->print_cr("  <Not Available>");
  2210     }
  2210     }
  2211   }
  2211   }
  2212 }
  2212 }
  2213 
  2213 
  2214 const char* search_string = IA32_ONLY("model name") AMD64_ONLY("model name")
  2214 #if defined(AMD64) || defined(IA32) || defined(X32)
  2215                             IA64_ONLY("") SPARC_ONLY("cpu")
  2215 const char* search_string = "model name";
  2216                             ARM32_ONLY("Processor") PPC_ONLY("Processor") AARCH64_ONLY("Processor");
  2216 #elif defined(SPARC)
       
  2217 const char* search_string = "cpu";
       
  2218 #else
       
  2219 const char* search_string = "Processor";
       
  2220 #endif
  2217 
  2221 
  2218 // Parses the cpuinfo file for string representing the model name.
  2222 // Parses the cpuinfo file for string representing the model name.
  2219 void os::get_summary_cpu_info(char* cpuinfo, size_t length) {
  2223 void os::get_summary_cpu_info(char* cpuinfo, size_t length) {
  2220   FILE* fp = fopen("/proc/cpuinfo", "r");
  2224   FILE* fp = fopen("/proc/cpuinfo", "r");
  2221   if (fp != NULL) {
  2225   if (fp != NULL) {
  2246     }
  2250     }
  2247     fclose(fp);
  2251     fclose(fp);
  2248   }
  2252   }
  2249   // cpuinfo not found or parsing failed, just print generic string.  The entire
  2253   // cpuinfo not found or parsing failed, just print generic string.  The entire
  2250   // /proc/cpuinfo file will be printed later in the file (or enough of it for x86)
  2254   // /proc/cpuinfo file will be printed later in the file (or enough of it for x86)
  2251   strncpy(cpuinfo, IA32_ONLY("x86_32") AMD64_ONLY("x86_32")
  2255 #if defined(AMD64)
  2252                    IA64_ONLY("IA64") SPARC_ONLY("sparcv9")
  2256   strncpy(cpuinfo, "x86_64", length);
  2253                    ARM32_ONLY("ARM") PPC_ONLY("PPC64") AARCH64_ONLY("AArch64"), length);
  2257 #elif defined(IA32)
       
  2258   strncpy(cpuinfo, "x86_32", length);
       
  2259 #elif defined(IA64)
       
  2260   strncpy(cpuinfo, "IA64", length);
       
  2261 #elif defined(SPARC)
       
  2262   strncpy(cpuinfo, "sparcv9", length);
       
  2263 #elif defined(AARCH64)
       
  2264   strncpy(cpuinfo, "AArch64", length);
       
  2265 #elif defined(ARM)
       
  2266   strncpy(cpuinfo, "ARM", length);
       
  2267 #elif defined(PPC)
       
  2268   strncpy(cpuinfo, "PPC64", length);
       
  2269 #elif defined(ZERO_LIBARCH)
       
  2270   strncpy(cpuinfo, ZERO_LIBARCH, length);
       
  2271 #else
       
  2272   strncpy(cpuinfo, "unknown", length);
       
  2273 #endif
  2254 }
  2274 }
  2255 
  2275 
  2256 void os::print_siginfo(outputStream* st, void* siginfo) {
  2276 void os::print_siginfo(outputStream* st, void* siginfo) {
  2257   const siginfo_t* si = (const siginfo_t*)siginfo;
  2277   const siginfo_t* si = (const siginfo_t*)siginfo;
  2258 
  2278