32 int VM_Version_Ext::_no_of_cores = 0; 33 int VM_Version_Ext::_no_of_sockets = 0; 34 bool VM_Version_Ext::_initialized = false; 35 char VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {0}; 36 char VM_Version_Ext::_cpu_desc[CPU_DETAILED_DESC_BUF_SIZE] = {0}; 37 38 void VM_Version_Ext::initialize_cpu_information(void) { 39 // do nothing if cpu info has been initialized 40 if (_initialized) { 41 return; 42 } 43 44 int core_id = -1; 45 int chip_id = -1; 46 int len = 0; 47 char* src_string = NULL; 48 49 _no_of_cores = os::processor_count(); 50 _no_of_threads = _no_of_cores; 51 _no_of_sockets = _no_of_cores; 52 #ifdef AARCH64 53 snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE - 1, "AArch64"); 54 #else 55 snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE - 1, "ARM%d", _arm_arch); 56 #endif 57 snprintf(_cpu_desc, CPU_DETAILED_DESC_BUF_SIZE, "%s", _features_string); 58 _initialized = true; 59 } 60 61 int VM_Version_Ext::number_of_threads(void) { 62 initialize_cpu_information(); 63 return _no_of_threads; 64 } 65 66 int VM_Version_Ext::number_of_cores(void) { 67 initialize_cpu_information(); 68 return _no_of_cores; 69 } 70 71 int VM_Version_Ext::number_of_sockets(void) { 72 initialize_cpu_information(); 73 return _no_of_sockets; 74 } 75 76 const char* VM_Version_Ext::cpu_name(void) { | 32 int VM_Version_Ext::_no_of_cores = 0; 33 int VM_Version_Ext::_no_of_sockets = 0; 34 bool VM_Version_Ext::_initialized = false; 35 char VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {0}; 36 char VM_Version_Ext::_cpu_desc[CPU_DETAILED_DESC_BUF_SIZE] = {0}; 37 38 void VM_Version_Ext::initialize_cpu_information(void) { 39 // do nothing if cpu info has been initialized 40 if (_initialized) { 41 return; 42 } 43 44 int core_id = -1; 45 int chip_id = -1; 46 int len = 0; 47 char* src_string = NULL; 48 49 _no_of_cores = os::processor_count(); 50 _no_of_threads = _no_of_cores; 51 _no_of_sockets = _no_of_cores; 52 snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE - 1, "ARM%d", _arm_arch); 53 snprintf(_cpu_desc, CPU_DETAILED_DESC_BUF_SIZE, "%s", _features_string); 54 _initialized = true; 55 } 56 57 int VM_Version_Ext::number_of_threads(void) { 58 initialize_cpu_information(); 59 return _no_of_threads; 60 } 61 62 int VM_Version_Ext::number_of_cores(void) { 63 initialize_cpu_information(); 64 return _no_of_cores; 65 } 66 67 int VM_Version_Ext::number_of_sockets(void) { 68 initialize_cpu_information(); 69 return _no_of_sockets; 70 } 71 72 const char* VM_Version_Ext::cpu_name(void) { |