mirror of
https://github.com/teddysun/across.git
synced 2025-01-19 06:19:35 +08:00
Fixed processor name contains processor string issue (#114)
When model name contain processor, such as 'Common KVM processor', it will cause a false calculate in processor. To prevent this, add ^ to make sure it only count the line start with processor.
This commit is contained in:
parent
0a5d50b537
commit
28e7865afb
2
bench.sh
2
bench.sh
@ -235,7 +235,7 @@ print_intro() {
|
|||||||
# Get System information
|
# Get System information
|
||||||
get_system_info() {
|
get_system_info() {
|
||||||
cname=$(awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
|
cname=$(awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
|
||||||
cores=$(awk -F: '/processor/ {core++} END {print core}' /proc/cpuinfo)
|
cores=$(awk -F: '/^processor/ {core++} END {print core}' /proc/cpuinfo)
|
||||||
freq=$(awk -F'[ :]' '/cpu MHz/ {print $4;exit}' /proc/cpuinfo)
|
freq=$(awk -F'[ :]' '/cpu MHz/ {print $4;exit}' /proc/cpuinfo)
|
||||||
ccache=$(awk -F: '/cache size/ {cache=$2} END {print cache}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
|
ccache=$(awk -F: '/cache size/ {cache=$2} END {print cache}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')
|
||||||
cpu_aes=$(grep -i 'aes' /proc/cpuinfo)
|
cpu_aes=$(grep -i 'aes' /proc/cpuinfo)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user