Commit 196a8377 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ebe13779
...@@ -403,33 +403,83 @@ header() { ...@@ -403,33 +403,83 @@ header() {
echo -n "# "; uname -a echo -n "# "; uname -a
# cpu # cpu
# XXX review and read about CPU idle states more XXX
# XXX +power consumption
# XXX show C states usage diff after each benchmark XXX + same for P-states # XXX show C states usage diff after each benchmark XXX + same for P-states
# XXX +cpufreq transition statistics (CPU_FREQ_STAT) # XXX +cpufreq transition statistics (CPU_FREQ_STAT)
echo -n "# cpu: "; grep "^model name" /proc/cpuinfo |head -1 |sed -e 's/model name\s*: //' echo -n "# cpu: "; grep "^model name" /proc/cpuinfo |head -1 |sed -e 's/model name\s*: //'
syscpu=/sys/devices/system/cpu syscpu=/sys/devices/system/cpu
sysidle=$syscpu/cpuidle sysidle=$syscpu/cpuidle
ls -vd $syscpu/cpu[0-9]* | \
freqcpuv=() # [] of cpu
freqstr="" # text about cpufreq for cpus in ^^^
freqdump() {
test "${#freqcpuv[@]}" = 0 && return
echo "# ${freqcpuv[*]}: $freqstr"
freqcpuv=()
freqstr=""
}
# ----//---- for cpuidle
idlecpuv=()
idlestr=""
idledump() {
test "${#idlecpuv[@]}" = 0 && return
echo "# ${idlecpuv[*]}: $idlestr"
idlecpuv=()
idlestr=""
}
while read cpu; do while read cpu; do
# XXX deduplicate cpu info - if it is the same as prev - print "----//----"
cpuname=`basename $cpu` cpuname=`basename $cpu`
f="$cpu/cpufreq" f="$cpu/cpufreq"
echo "# $cpuname:" fs="freq: `cat $f/scaling_driver`/`cat $f/scaling_governor` [`fkghz $f/scaling_min_freq` - `fkghz $f/scaling_max_freq`]"
echo -e "#\tfreq: `cat $f/scaling_driver`/`cat $f/scaling_governor` [`fkghz $f/scaling_min_freq` - `fkghz $f/scaling_max_freq`]" if [ "$fs" != "$freqstr" ]; then
#echo -e "#\tenergy: `cat $f/energy_performance_preference`" freqdump
echo -en "#\tidle: `cat $sysidle/current_driver`/`cat $sysidle/current_governor_ro`:" freqstr="$fs"
ls -vd $cpu/cpuidle/state[0-9]* | \ fi
freqcpuv+=($cpuname)
is="idle: `cat $sysidle/current_driver`/`cat $sysidle/current_governor_ro`:"
while read state; do while read state; do
# XXX add target residency? (clarify about its meaning) # XXX add target residency?
echo -n " " is+=" "
test "`cat $state/disable`" = "1" && echo -n "!" test "`cat $state/disable`" = "1" && is+="!"
echo -n "`cat $state/name`(`cat $state/latency`μs)" is+="`cat $state/name`(`cat $state/latency`μs)"
done done \
echo < <(ls -vd $cpu/cpuidle/state[0-9]*)
# XXX warn if freq != stable
# XXX warn if idle latency is too much if [ "$is" != "$idlestr" ]; then
done idledump
idlestr="$is"
fi
idlecpuv+=($cpuname)
done \
< <(ls -vd $syscpu/cpu[0-9]*)
freqdump
idledump
#echo
#ls -vd $syscpu/cpu[0-9]* | \
#while read cpu; do
# # XXX deduplicate cpu info - if it is the same as prev - print "----//----"
# cpuname=`basename $cpu`
# f="$cpu/cpufreq"
# echo -n "# $cpuname: "
# echo -e "freq: `cat $f/scaling_driver`/`cat $f/scaling_governor` [`fkghz $f/scaling_min_freq` - `fkghz $f/scaling_max_freq`]"
# #echo -e "#\tenergy: `cat $f/energy_performance_preference`"
# echo -n "# $cpuname: "
# echo -en "idle: `cat $sysidle/current_driver`/`cat $sysidle/current_governor_ro`:"
# ls -vd $cpu/cpuidle/state[0-9]* | \
# while read state; do
# # XXX add target residency?
# echo -n " "
# test "`cat $state/disable`" = "1" && echo -n "!"
# echo -n "`cat $state/name`(`cat $state/latency`μs)"
# done
# echo
# # XXX warn if freq != stable
# # XXX warn if idle latency is too much
#done
# disk under . # disk under .
mntpt=`stat -c '%m' .` # mountpoint of current filesystem mntpt=`stat -c '%m' .` # mountpoint of current filesystem
......
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