summaryrefslogtreecommitdiffstats
path: root/bin/cpumhz
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xbin/cpumhz9
-rwxr-xr-xbin/cpumhzturbo11
2 files changed, 20 insertions, 0 deletions
diff --git a/bin/cpumhz b/bin/cpumhz
new file mode 100755
index 0000000..cf9ba08
--- /dev/null
+++ b/bin/cpumhz
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# cpumhz tool by Tanel Poder [https://0x.tools]
+
+grep MHz /proc/cpuinfo | awk '{ split($4,x,".") ; printf substr(x[1],1,2) "00..99 \n" }' \
+ | sed 's/^0/ /' | sort | uniq -c \
+ | awk '{ printf $0 ; for(x=0;x<$1;x++) printf "#"; printf "\n" }' \
+ | sort -nbrk 2
+
diff --git a/bin/cpumhzturbo b/bin/cpumhzturbo
new file mode 100755
index 0000000..9f4e0cf
--- /dev/null
+++ b/bin/cpumhzturbo
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# cpumhzturbo wrapper by Tanel Poder [https://0x.tools]
+# run this as root or add CAP_SYS_RAWIO capability to turbostat
+
+turbostat -q -s Bzy_MHz -i 1 -n 1 | grep -v Bzy_MHz \
+ | awk '{ printf("%04d\n",$1) }' \
+ | awk '{ split($1,x,".") ; printf substr(x[1],1,2) "00..99 \n" }' | sed 's/^0/ /' | sort | uniq -c \
+ | awk '{ printf $0 ; for(x=0;x<$1;x++) printf "#"; printf "\n" }' \
+ | sort -nbrk 2
+