From 7db81652e3b9398ceeffe91f54e5d49aade28d78 Mon Sep 17 00:00:00 2001
From: Milos Mulac <mulac@kirke3.meta.zcu.cz>
Date: Thu, 10 Nov 2022 17:15:22 +0100
Subject: [PATCH] more complex metering
---
powertest.sh | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/powertest.sh b/powertest.sh
index 1210fa0..73be3b6 100755
--- a/powertest.sh
+++ b/powertest.sh
@@ -10,7 +10,7 @@ MAX_FREQ="3.31GHz"
MIN_FREQ="1.50GHz"
LOG=/tmp/powertest.$$
TEST="stress-ng -c $CORES"
-METER="ipmitool dcmi power reading| grep Instantaneous"
+#METER="ipmitool dcmi power reading| grep Instantaneous"
HIGH_PERFORMANCE="for i in `seq 0 $CORES`; do cpufreq-set -g performance -c \$i --max 2400Mhz; done"
MID_PERFORMANCE="for i in `seq 0 $CORES`; do cpufreq-set -g performance -c \$i --max 2000Mhz; done"
@@ -19,10 +19,21 @@ ON_DEMAND="for i in `seq 0 $CORES`; do cpufreq-set -g ondemand -c \$i -u $MAX_FR
[ -x "$(command -v stress-ng)" ] || { echo "Test command stress-ng not installed, exiting."; exit 1; }
+
+# XXX: needs to be revised on given platform, names of sensors and their presence is vendor specific
run_meter()
{
+ echo " CPU1 CPU2 MB PS1 PS2"
while true; do
- eval $METER
+ ipmitool sensor|\
+ awk '\
+ /CPU1 Temperature/ {T1=$4}; \
+ /CPU2 Temperature/ {T2=$4}; \
+ /TR1 Temperature/ {T3=$4}; \
+ /PMBPower1/ {P1=$3}; \
+ /PMBPower2/ {P2=$3}; \
+ END {print " "T1" "T2" "T3" "P1" "P2} \
+ '
sleep $SAMPLING
done
}
--
GitLab