mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
small issue fix for intel ht dual core, it has bad core ids, so I had to replace smart count with a manual dumb count, that works
This commit is contained in:
parent
083ef48993
commit
dc8706cfa7
32
inxi
32
inxi
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.4.6
|
#### version: 1.4.7
|
||||||
#### Date: February 17 2010
|
#### Date: March 4 2010
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -2017,6 +2017,7 @@ get_cpu_ht_multicore_smp_data()
|
||||||
FS=": "
|
FS=": "
|
||||||
IGNORECASE = 1
|
IGNORECASE = 1
|
||||||
core_count = 0
|
core_count = 0
|
||||||
|
holder = 0
|
||||||
i = 0
|
i = 0
|
||||||
index_temp = ""
|
index_temp = ""
|
||||||
num_of_cores = 0
|
num_of_cores = 0
|
||||||
|
@ -2043,13 +2044,25 @@ get_cpu_ht_multicore_smp_data()
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
END {
|
END {
|
||||||
# look for the largest id number, and assign it
|
# look for the largest id number, and assign it (dumped this method due intel)
|
||||||
for ( j = 0; j < processor_logical_count; j++ ) {
|
# note that there are some cases, intel i5 core 2 HT where core_id shows
|
||||||
if ( a_core_id[j] > core_count ) {
|
# as 0/2, not 0/1. this triggers a 3 core output, erroneously.
|
||||||
core_count = a_core_id[j]
|
# Sorting the data solves this, since the counter now is mechanical, not
|
||||||
|
# trusting the data from the proc/cpuinfo at all re what the core id is
|
||||||
|
asort(a_core_id)
|
||||||
|
# awk increments j++ counter BEFORE the loop?
|
||||||
|
for ( j = 0; j <= processor_logical_count; j++ ) {
|
||||||
|
# if ( j in a_core_id && a_core_id[j] > core_count ) {
|
||||||
|
if ( j in a_core_id ) {
|
||||||
|
#core_count = a_core_id[j]
|
||||||
|
if ( a_core_id[j] != holder ){
|
||||||
|
core_count++
|
||||||
|
holder = a_core_id[j]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
core_count = core_count + 1
|
core_count = core_count + 1
|
||||||
|
|
||||||
# trick, set the index equal to value, if the same, it will overwrite
|
# trick, set the index equal to value, if the same, it will overwrite
|
||||||
# this lets us create the actual array of true cpu physical ids
|
# this lets us create the actual array of true cpu physical ids
|
||||||
for ( j in a_physical_id ) {
|
for ( j in a_physical_id ) {
|
||||||
|
@ -2081,7 +2094,8 @@ get_cpu_ht_multicore_smp_data()
|
||||||
}
|
}
|
||||||
print type " " physical_cpu_count " " core_count
|
print type " " physical_cpu_count " " core_count
|
||||||
}
|
}
|
||||||
' $FILE_CPUINFO ) )
|
' $FILE_CPUINFO
|
||||||
|
) )
|
||||||
fi
|
fi
|
||||||
log_function_data "A_CPU_TYPE_PCNT_CCNT: ${A_CPU_TYPE_PCNT_CCNT[@]}"
|
log_function_data "A_CPU_TYPE_PCNT_CCNT: ${A_CPU_TYPE_PCNT_CCNT[@]}"
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
|
@ -3271,7 +3285,7 @@ get_ps_data()
|
||||||
array_length=${#A_PS_DATA[@]};
|
array_length=${#A_PS_DATA[@]};
|
||||||
while (( $i < $array_length/2 ))
|
while (( $i < $array_length/2 ))
|
||||||
do
|
do
|
||||||
reorder_temp=${A_PS_DATA[i]}
|
reorder_temp=${A_PS_DATA[i]}f
|
||||||
A_PS_DATA[i]=${A_PS_DATA[$array_length-$i-1]}
|
A_PS_DATA[i]=${A_PS_DATA[$array_length-$i-1]}
|
||||||
A_PS_DATA[$array_length-$i-1]=$reorder_temp
|
A_PS_DATA[$array_length-$i-1]=$reorder_temp
|
||||||
(( i++ ))
|
(( i++ ))
|
||||||
|
|
Loading…
Reference in a new issue