diff --git a/inxi b/inxi index d03af4e..00e8fd3 100755 --- a/inxi +++ b/inxi @@ -1,8 +1,8 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.7.29 -#### Date: February 9 2012 +#### version: 1.7.30 +#### Date: February 21 2012 #### Patch Number: 00 ######################################################################## #### SPECIAL THANKS @@ -3029,6 +3029,7 @@ get_cpu_ht_multicore_smp_data() num_of_cores = 0 num_of_processors = 0 num_of_cpus = 0 + cpu_core_count = 0 core_id[0] processor_id[0] cpu_id[0] @@ -3048,6 +3049,12 @@ get_cpu_ht_multicore_smp_data() core_id[iter] = $NF iter++ } + # this will be used to fix an intel glitch if needed, cause, intel + # sometimes reports core id as the same number for each core, 0 + # so if cpu cores shows greater value than number of cores, use this + /^cpu cores/ { + cpu_core_count = $NF + } END { ## Look thru the array and filter same numbers. ## only unique numbers required @@ -3056,10 +3063,11 @@ get_cpu_ht_multicore_smp_data() i = 0 ## count unique processors ## + # note, this fails for intel cpus at times for ( i in processor_id ) { procHolder[processor_id[i]] = 1 } - for ( i in procHolder ) { + for ( i in procHolder ) { num_of_processors++ } @@ -3080,6 +3088,9 @@ get_cpu_ht_multicore_smp_data() for ( i in coreHolder ) { num_of_cores++ } + if ( ( num_of_cores == 1 ) && ( cpu_core_count * num_of_cpus > 1 ) ) { + num_of_cores = cpu_core_count * num_of_cpus + } #################################################################### # algorithm