New Version, new tarball. Added inxi.changelog to tarball as well.

Continuing fixes for ARM cpus, it was noted that short form inxi failed to show cpu speed
derived from bogomips. That's because of the old min/max output that short form used.
Updated that section to now use N/A as flag, and if N/A for min/max speed, use the speed
given from first cpu array index, the one derived from bogomips for ARM/razberry pi.

Note that there is still no other ARM /proc/cpuinfo available to see if the razberry pi
fixes work for all ARM cpus, but the fixes will stop hangs and endless loops at worst,
and may also show some type of cpu speeds for ARM cpus that are not in razpi devices.
This commit is contained in:
inxi-svn 2013-01-22 20:47:00 +00:00
parent bb8d77aefd
commit 7705e68d40
2 changed files with 39 additions and 5 deletions

20
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.8.29 #### version: 1.8.30
#### Date: January 21 2013 #### Date: January 22 2013
#### Patch Number: 00 #### Patch Number: 00
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
@ -3157,13 +3157,16 @@ get_cpu_data()
for ( i = 0; i <= nr; i++ ) { for ( i = 0; i <= nr; i++ ) {
# note: assuming bogomips for arm at 1 x clock # note: assuming bogomips for arm at 1 x clock
# http://en.wikipedia.org/wiki/BogoMips ARM could change so watch this # http://en.wikipedia.org/wiki/BogoMips ARM could change so watch this
# maybe add: && bArm == "true" but I think most of the bogomips roughly equal cpu speed if not amd/intel
if ( cpu[i, "bogomips"] != "" && cpu[i, "speed"] == "" ) { if ( cpu[i, "bogomips"] != "" && cpu[i, "speed"] == "" ) {
cpu[i, "speed"] = cpu[i, "bogomips"] cpu[i, "speed"] = cpu[i, "bogomips"]
} }
print cpu[i, "model"] "," cpu[i, "speed"] "," cpu[i, "cache"] "," cpu[i, "flags"] "," cpu[i, "bogomips"] "," cpu[nr, "vendor"] print cpu[i, "model"] "," cpu[i, "speed"] "," cpu[i, "cache"] "," cpu[i, "flags"] "," cpu[i, "bogomips"] "," cpu[nr, "vendor"]
} }
# this is / was used in inxi short output only, but when it is N/A, need to use the previous array
# value, from above, the actual speed that is, for short output, key 0.
if (!min) { if (!min) {
print "not found" print "N/A"
exit exit
} }
else { else {
@ -6963,9 +6966,16 @@ print_short_data()
local cpu_model="${a_cpu_working[0]}" local cpu_model="${a_cpu_working[0]}"
## assemble data for output ## assemble data for output
local cpu_clock="${a_cpu_working[1]}" # old CPU3 local cpu_clock="${a_cpu_working[1]}" # old CPU3
# this gets that weird min/max final array item # this gets that weird min/max final array item, which almost never contains any data of use
local min_max_clock_nu=$(( ${#A_CPU_DATA[@]} - 1 )) local min_max_clock_nu=$(( ${#A_CPU_DATA[@]} - 1 ))
local min_max_clock=${A_CPU_DATA[$min_max_clock_nu]} local min_max_clock=${A_CPU_DATA[$min_max_clock_nu]}
# this handles the case of for example ARM cpus, which will not have data for
# min/max, since they don't have speed. Since that sets a flag, not found, just
# look for that and use the speed from the first array array, same where we got
# model from
if [[ "$min_max_clock" == 'N/A' && ${a_cpu_working[1]} != '' ]];then
min_max_clock="${a_cpu_working[1]}"
fi
local script_patch_number=$( get_patch_version_string ) local script_patch_number=$( get_patch_version_string )
#set_color_scheme 12 #set_color_scheme 12
@ -7173,6 +7183,7 @@ print_cpu_data()
# The above mentioned only emerges when using the debugging markers below # The above mentioned only emerges when using the debugging markers below
## print_screen_output "a_cpu_working=\"***${a_cpu_working[@]} $hostName+++++++\"----------" ## print_screen_output "a_cpu_working=\"***${a_cpu_working[@]} $hostName+++++++\"----------"
# cpu cache
if [[ -z ${a_cpu_working[2]} ]];then if [[ -z ${a_cpu_working[2]} ]];then
a_cpu_working[2]="unknown" a_cpu_working[2]="unknown"
fi fi
@ -7214,6 +7225,7 @@ print_cpu_data()
print_screen_output "$cpu_data" print_screen_output "$cpu_data"
# we don't this printing out extra line unless > 1 cpu core # we don't this printing out extra line unless > 1 cpu core
# note the numbering, the last array item is the min/max/not found for cpu speeds
if [[ ${#A_CPU_DATA[@]} -gt 2 && $B_SHOW_CPU == 'true' ]];then if [[ ${#A_CPU_DATA[@]} -gt 2 && $B_SHOW_CPU == 'true' ]];then
for (( i=0; i < ${#A_CPU_DATA[@]}-1; i++ )) for (( i=0; i < ${#A_CPU_DATA[@]}-1; i++ ))
do do

View file

@ -19,3 +19,25 @@ For cpu speed, following wikipedia, used bogomips being equal to 1x cpu speed, t
Better than nothing I guess, but will be wrong in other cases, particularly with dual core arm. Better than nothing I guess, but will be wrong in other cases, particularly with dual core arm.
----------------------------------- -----------------------------------
-- Harald Hope - Mon, 21 Jan 2013 16:24:40 -0800 -- Harald Hope - Mon, 21 Jan 2013 16:24:40 -0800
=====================================================================================
Version: 1.8.30
Patch Version: January 22 2013
Script Date: 00
-----------------------------------
Changes:
-----------------------------------
New Version, new tarball. Added inxi.changelog to tarball as well.
Continuing fixes for ARM cpus, it was noted that short form inxi failed to show cpu speed
derived from bogomips. That's because of the old min/max output that short form used.
Updated that section to now use N/A as flag, and if N/A for min/max speed, use the speed
given from first cpu array index, the one derived from bogomips for ARM/razberry pi.
Note that there is still no other ARM /proc/cpuinfo available to see if the razberry pi
fixes work for all ARM cpus, but the fixes will stop hangs and endless loops at worst,
and may also show some type of cpu speeds for ARM cpus that are not in razpi devices.
-----------------------------------
-- Harald Hope - Tue, 22 Jan 2013 12:38:47 -0800