mirror of
https://github.com/smxi/inxi.git
synced 2025-01-19 08:57:57 +00:00
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:
parent
bb8d77aefd
commit
7705e68d40
22
inxi
22
inxi
|
@ -1,8 +1,8 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 1.8.29
|
||||
#### Date: January 21 2013
|
||||
#### version: 1.8.30
|
||||
#### Date: January 22 2013
|
||||
#### Patch Number: 00
|
||||
########################################################################
|
||||
#### SPECIAL THANKS
|
||||
|
@ -3157,13 +3157,16 @@ get_cpu_data()
|
|||
for ( i = 0; i <= nr; i++ ) {
|
||||
# note: assuming bogomips for arm at 1 x clock
|
||||
# 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"] == "" ) {
|
||||
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"]
|
||||
}
|
||||
# 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) {
|
||||
print "not found"
|
||||
print "N/A"
|
||||
exit
|
||||
}
|
||||
else {
|
||||
|
@ -6963,9 +6966,16 @@ print_short_data()
|
|||
local cpu_model="${a_cpu_working[0]}"
|
||||
## assemble data for output
|
||||
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=${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 )
|
||||
|
||||
#set_color_scheme 12
|
||||
|
@ -7172,7 +7182,8 @@ print_cpu_data()
|
|||
# This has been confirmed by #bash on freenode.
|
||||
# The above mentioned only emerges when using the debugging markers below
|
||||
## print_screen_output "a_cpu_working=\"***${a_cpu_working[@]} $hostName+++++++\"----------"
|
||||
|
||||
|
||||
# cpu cache
|
||||
if [[ -z ${a_cpu_working[2]} ]];then
|
||||
a_cpu_working[2]="unknown"
|
||||
fi
|
||||
|
@ -7214,6 +7225,7 @@ print_cpu_data()
|
|||
print_screen_output "$cpu_data"
|
||||
|
||||
# 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
|
||||
for (( i=0; i < ${#A_CPU_DATA[@]}-1; i++ ))
|
||||
do
|
||||
|
|
|
@ -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.
|
||||
-----------------------------------
|
||||
-- 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
|
||||
|
|
Loading…
Reference in a new issue