mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
Trying -x option for extra data output with bogomips, but note: bmips is I believe per core, so needs to actually be
calculated correctly, currently showing for only one core
This commit is contained in:
parent
d4ffef12c8
commit
84beb29dcb
18
inxi
18
inxi
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 0.3.7
|
||||
#### version: 0.3.8
|
||||
#### Date: November 2 2008
|
||||
########################################################################
|
||||
#### inxi is a fork of infobash, the original bash sys info script by locsmif
|
||||
|
@ -65,6 +65,8 @@ A_X_DATA=''
|
|||
### Boolean true/false globals
|
||||
# check to make sure initial steps run without error for debugging
|
||||
B_ALL_UP='false'
|
||||
# show extra output data
|
||||
B_EXTRA_DATA='false'
|
||||
# override certain errors due to currupted data
|
||||
B_HANDLE_CORRUPT_DATA='false'
|
||||
# Running in a shell? Defaults to false, and is determined later.
|
||||
|
@ -429,7 +431,7 @@ get_parameters()
|
|||
return 1
|
||||
fi
|
||||
|
||||
while getopts c:CdDhTUv:V opt
|
||||
while getopts c:CdDhTUv:Vx opt
|
||||
do
|
||||
case $opt in
|
||||
c) if [ -n "$( egrep '^[0-9][0-9]?$' <<< $OPTARG )" ];then
|
||||
|
@ -463,6 +465,8 @@ get_parameters()
|
|||
V) print_version_info
|
||||
exit 0
|
||||
;;
|
||||
x) B_EXTRA_DATA='true'
|
||||
;;
|
||||
h) show_options
|
||||
exit 0
|
||||
;;
|
||||
|
@ -496,7 +500,8 @@ show_options()
|
|||
print_screen_output " 4 - Also show partition size/filled data for (if present):/, /home, /var/, /boot"
|
||||
print_screen_output " 5 - For multicore systems, also show per core clock speeds."
|
||||
print_screen_output "-V $SCRIPT_NAME version information. Prints information then exits."
|
||||
print_screen_output ""
|
||||
print_screen_output "-x Show extra data, for example bogomips on cpu output."
|
||||
rint_screen_output ""
|
||||
}
|
||||
|
||||
## print out version information for -V/--version
|
||||
|
@ -1267,6 +1272,7 @@ get_uptime()
|
|||
print_cpu_data()
|
||||
{
|
||||
local cpu_data='' i='' a_cpu_working='' cpu_clock_speed='' cpu_multi_clock_data=''
|
||||
local bmip_data=''
|
||||
|
||||
##print_screen_output "A_CPU_DATA[0]=\"${A_CPU_DATA[0]}\""
|
||||
IFS=","
|
||||
|
@ -1294,7 +1300,11 @@ print_cpu_data()
|
|||
# fi
|
||||
cpu_data=$( create_print_line "CPU:" "${C1}${cpu_core_count}${C2} ${a_cpu_working[0]}" )
|
||||
if [ "$VERBOSITY_LEVEL" -ge 3 ];then
|
||||
cpu_data="$cpu_data${C2} ${a_cpu_working[2]} cache${C2} ${C1}flags${C2} ($CPU_FLAGS)${CN}"
|
||||
## this needs to be updated for multicore I believe, bogomips x core count, or something
|
||||
if [ "$B_EXTRA_DATA" == 'true' ];then
|
||||
bmip_data=" ${C1}bmips${C2} ${a_cpu_working[4]}"
|
||||
fi
|
||||
cpu_data="$cpu_data${C2} ${C1}cache${C2} ${a_cpu_working[2]} ${C1}flags${C2} ($CPU_FLAGS)$bmip_data${CN}"
|
||||
fi
|
||||
|
||||
if [ "$VERBOSITY_LEVEL" -ge 5 -a "${#A_CPU_DATA[@]}" -gt 2 ]
|
||||
|
|
Loading…
Reference in a new issue