Commit cbac2d11 authored by Vitaly Lipatov's avatar Vitaly Lipatov

distr_info: add -z for print current CPU MHz

parent f78250b5
...@@ -615,6 +615,11 @@ get_core_count() ...@@ -615,6 +615,11 @@ get_core_count()
echo $detected echo $detected
} }
get_core_mhz()
{
cat /proc/cpuinfo | grep "cpu MHz" | head -n1 | cut -d':' -f2 | cut -d' ' -f2 | cut -d'.' -f1
}
get_virt() get_virt()
{ {
...@@ -668,7 +673,7 @@ Pretty distro name (--pretty): $(print_pretty_name) ...@@ -668,7 +673,7 @@ Pretty distro name (--pretty): $(print_pretty_name)
Package manager/type (-g/-p): $(pkgmanager) / $(pkgtype) Package manager/type (-g/-p): $(pkgmanager) / $(pkgtype)
Running service manager (-y): $(get_service_manager) Running service manager (-y): $(get_service_manager)
Virtualization (-i): $(get_virt) Virtualization (-i): $(get_virt)
CPU Cores (-c): $(get_core_count) CPU Cores/MHz (-c/-z): $(get_core_count) / $(get_core_mhz) MHz
CPU Architecture (-a): $(get_arch) CPU Architecture (-a): $(get_arch)
CPU norm register size (-b): $(get_bit_size) CPU norm register size (-b): $(get_bit_size)
System memory size (MB) (-m): $(get_memory_size) System memory size (MB) (-m): $(get_memory_size)
...@@ -689,6 +694,7 @@ case $1 in ...@@ -689,6 +694,7 @@ case $1 in
echo " -a - print hardware architecture (--distro-arch for distro depended name)" echo " -a - print hardware architecture (--distro-arch for distro depended name)"
echo " -b - print size of arch bit (32/64)" echo " -b - print size of arch bit (32/64)"
echo " -c - print number of CPU cores" echo " -c - print number of CPU cores"
echo " -z - print current CPU MHz"
echo " -d - print distro name" echo " -d - print distro name"
echo " -e - print full name of distro with version" echo " -e - print full name of distro with version"
echo " -i - print virtualization type" echo " -i - print virtualization type"
...@@ -745,6 +751,9 @@ case $1 in ...@@ -745,6 +751,9 @@ case $1 in
-c) -c)
get_core_count get_core_count
;; ;;
-z)
get_core_mhz
;;
-i) -i)
get_virt get_virt
;; ;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment