mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 08:57:57 +00:00
Try to fix L2 misreporting issue for intel core duo
This commit is contained in:
parent
99509242d1
commit
a88d133b72
27
inxi
27
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 0.3.20
|
#### version: 0.3.21
|
||||||
#### Date: November 4 2008
|
#### Date: November 4 2008
|
||||||
########################################################################
|
########################################################################
|
||||||
#### inxi is a fork of infobash, the original bash sys info script by locsmif
|
#### inxi is a fork of infobash, the original bash sys info script by locsmif
|
||||||
|
@ -835,10 +835,15 @@ get_cpu_data()
|
||||||
|
|
||||||
/^bogomips/ { cpu[nr, "bogomips"] = $NF }
|
/^bogomips/ { cpu[nr, "bogomips"] = $NF }
|
||||||
|
|
||||||
|
/vendor_id/ {
|
||||||
|
gsub(/genuine|authentic/,"",$NF)
|
||||||
|
cpu[nr, "vendor"] = $NF
|
||||||
|
}
|
||||||
|
|
||||||
END {
|
END {
|
||||||
#if (!nr) { print ",,,"; exit } # <- should this be necessary or should bash handle that
|
#if (!nr) { print ",,,"; exit } # <- should this be necessary or should bash handle that
|
||||||
for (i = 0; i <= nr; i++) {
|
for (i = 0; i <= nr; i++) {
|
||||||
print cpu[i, "model"] "," cpu[i, "speed"] "," cpu[i, "cache"] "," cpu[i, "flags"] "," cpu[i, "bogomips"]
|
print cpu[i, "model"] "," cpu[i, "speed"] "," cpu[i, "cache"] "," cpu[i, "flags"] "," cpu[i, "bogomips"] "," cpu[nr, "vendor"]
|
||||||
}
|
}
|
||||||
if (!min) {
|
if (!min) {
|
||||||
print "not found"
|
print "not found"
|
||||||
|
@ -967,7 +972,9 @@ get_distro_data()
|
||||||
else
|
else
|
||||||
# Debian pure should fall through here
|
# Debian pure should fall through here
|
||||||
distro_file="issue"
|
distro_file="issue"
|
||||||
distro=$( gawk 'BEGIN { RS="" } { gsub(/\\[a-z]/,"");
|
distro=$( gawk '
|
||||||
|
BEGIN { RS="" } {
|
||||||
|
gsub(/\\[a-z]/,"");
|
||||||
gsub(/ [ ]+/," ");
|
gsub(/ [ ]+/," ");
|
||||||
gsub(/^ +| +$/,"");
|
gsub(/^ +| +$/,"");
|
||||||
print }' "/etc/${distro_file}" )
|
print }' "/etc/${distro_file}" )
|
||||||
|
@ -1375,12 +1382,13 @@ print_audio_data()
|
||||||
print_cpu_data()
|
print_cpu_data()
|
||||||
{
|
{
|
||||||
local cpu_data='' i='' a_cpu_working='' cpu_clock_speed='' cpu_multi_clock_data=''
|
local cpu_data='' i='' a_cpu_working='' cpu_clock_speed='' cpu_multi_clock_data=''
|
||||||
local bmip_data='' cpu_cache=''
|
local bmip_data='' cpu_cache='' cpu_vendor=''
|
||||||
|
|
||||||
##print_screen_output "A_CPU_DATA[0]=\"${A_CPU_DATA[0]}\""
|
##print_screen_output "A_CPU_DATA[0]=\"${A_CPU_DATA[0]}\""
|
||||||
IFS=","
|
IFS=","
|
||||||
a_cpu_working=(${A_CPU_DATA[0]})
|
a_cpu_working=(${A_CPU_DATA[0]})
|
||||||
IFS="$ORIGINAL_IFS"
|
IFS="$ORIGINAL_IFS"
|
||||||
|
cpu_vendor=$( tr '[A-Z]' '[a-z]' <<< ${a_cpu_working[5]} )
|
||||||
# Strange (and also some expected) behavior encountered.
|
# Strange (and also some expected) behavior encountered.
|
||||||
# If print_screen_output() uses $1 as the parameter to output to the screen,
|
# If print_screen_output() uses $1 as the parameter to output to the screen,
|
||||||
# then passing "<text1> ${ARR[@]} <text2>"
|
# then passing "<text1> ${ARR[@]} <text2>"
|
||||||
|
@ -1401,14 +1409,25 @@ print_cpu_data()
|
||||||
# # Array CPU always has one element: max clockfreq found. Therefore -gt and not -ge
|
# # Array CPU always has one element: max clockfreq found. Therefore -gt and not -ge
|
||||||
# unset cpu_core_count
|
# unset cpu_core_count
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
cpu_data=$( create_print_line "CPU:" "${C1}${cpu_core_count_string}${C2} ${a_cpu_working[0]}" )
|
cpu_data=$( create_print_line "CPU:" "${C1}${cpu_core_count_string}${C2} ${a_cpu_working[0]}" )
|
||||||
if [ "$VERBOSITY_LEVEL" -ge 3 ];then
|
if [ "$VERBOSITY_LEVEL" -ge 3 ];then
|
||||||
# update for multicore, bogomips x core count.
|
# update for multicore, bogomips x core count.
|
||||||
if [ "$B_EXTRA_DATA" == 'true' ];then
|
if [ "$B_EXTRA_DATA" == 'true' ];then
|
||||||
|
|
||||||
|
# if [ "$cpu_vendor" != 'intel' ];then
|
||||||
bmip_data=$( calculate_multicore_data "${a_cpu_working[4]}" "$cpu_core_count" )
|
bmip_data=$( calculate_multicore_data "${a_cpu_working[4]}" "$cpu_core_count" )
|
||||||
|
# else
|
||||||
|
# bmip_data="${a_cpu_working[4]}"
|
||||||
|
# fi
|
||||||
bmip_data=" ${C1}bmips${C2} $bmip_data"
|
bmip_data=" ${C1}bmips${C2} $bmip_data"
|
||||||
fi
|
fi
|
||||||
|
## note: this handles how intel reports L2, total instead of per core like AMD does
|
||||||
|
if [ "$cpu_vendor" != 'intel' ];then
|
||||||
cpu_cache=$( calculate_multicore_data "${a_cpu_working[2]}" "$cpu_core_count" )
|
cpu_cache=$( calculate_multicore_data "${a_cpu_working[2]}" "$cpu_core_count" )
|
||||||
|
else
|
||||||
|
cpu_cache="${a_cpu_working[2]}"
|
||||||
|
fi
|
||||||
cpu_data="$cpu_data${C2} ${C1}cache${C2} $cpu_cache ${C1}flags${C2} ($CPU_FLAGS)$bmip_data${CN}"
|
cpu_data="$cpu_data${C2} ${C1}cache${C2} $cpu_cache ${C1}flags${C2} ($CPU_FLAGS)$bmip_data${CN}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue