summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Guittot <vincent.guittot@linaro.org>2016-12-02 14:39:18 +0100
committerVincent Guittot <vincent.guittot@linaro.org>2016-12-02 15:00:01 +0100
commit7bd17b9905faf7a5116b4fea74f896db8d48fcbe (patch)
tree5db350f0d0cf2cdaf200f70d9c374a3fbd17de62
parentca98758853fe6d41c962f19c62935317251d5a82 (diff)
tmp
-rwxr-xr-xcompute_aep.py97
-rwxr-xr-xcompute_aep_calib.py97
l---------dragonboard-reboot.sh1
l---------hikey-reboot.sh1
-rwxr-xr-xmonitor_supply.py173
-rwxr-xr-xmonitor_thread.py41
-rwxr-xr-xmt8173evb-reboot.sh103
-rwxr-xr-xparse_aep.sh8
l---------parse_aep_2.sh1
l---------parse_aep_mt.sh1
l---------parse_aep_mt_lab.sh1
l---------parse_aep_mt_top.sh1
-rwxr-xr-xparse_arm_trace.sh13
-rwxr-xr-xparse_arm_trace_se.sh9
-rwxr-xr-xparse_perf_results.sh18
l---------parse_servo_mt.sh1
-rwxr-xr-xparse_watt.sh7
-rwxr-xr-xtest_power.sh2
18 files changed, 572 insertions, 3 deletions
diff --git a/compute_aep.py b/compute_aep.py
new file mode 100755
index 0000000..104e608
--- /dev/null
+++ b/compute_aep.py
@@ -0,0 +1,97 @@
+#!/usr/bin/env python
+
+import os
+import sys
+import getopt
+import subprocess
+import signal
+import serial
+import time
+import math
+
+def delta_nrj(delta, myline, min=[0,0,0,0,0], max=[0,0,0,0,0]):
+ array = myline.split(" ")
+
+ if (delta[0] < 0):
+ delta[0] = int(array[0])
+
+ time = int(array[0]) - delta[0]
+ if (time <= 0):
+ return delta
+
+# print array
+ for i in range(0, len(array)):
+ try:
+ data = int(array[i])
+ except ValueError:
+ continue
+
+ if (data < min[i]):
+ min[i] = data
+ if (data > max[i]):
+ max[i] = data
+ delta[i] += time * data
+
+ delta[0] = int(array[0])
+
+# print delta
+ return delta
+
+def compute_aep(infile, dry_run=True, verbose=False):
+ skip = 1
+ try:
+ fi = open(infile, "r")
+ except IOError:
+ print "WARN: Unable to open %s" % (infile)
+ sys.exit(2)
+
+ lines = fi.readlines()
+
+ offset = [0, 0, 0, 0, 0]
+ nrj = [-1, -0, -0, -0, -0]
+ max = [0, 0, 0, 0, 0]
+ min = [50000000, 5000000, 5000000, 5000000, 5000000]
+ label = ["time", "A57 cores", "A57 cache", "A53 cores", "A53 cache"]
+
+ for myline in lines:
+ if skip:
+ skip = 0
+ continue
+ delta_nrj(nrj, myline, min, max)
+
+ total = 0
+ for i in range(1, len(nrj)):
+ nrj[i] -= offset[i] * nrj[i]
+ total += nrj[i]
+ print "Total nrj: %8.3f J for %s -- duration %8.3f sec -- min %8.3f W -- max %8.3f W" % (nrj[i]/1000000000000.0, label[i], (max[0]-min[0])/1000000.0, min[i]/1000000.0, max[i]/1000000.0)
+ if (min[i] < offset[i]):
+ print "!!! Min below offset"
+
+ print "Total nrj: %8.3f J for %s -- duration %8.3f sec" % (total/1000000000000.0, "Platform ", (max[0]-min[0])/1000000.0)
+
+
+if __name__ == '__main__':
+
+ def handleSigTERM(signum, frame):
+ record = False
+
+ signal.signal(signal.SIGTERM, handleSigTERM)
+ signal.signal(signal.SIGINT, handleSigTERM)
+
+ infile = "EC-pmu.txt"
+ verbose = False
+
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], "i:v")
+ except getopt.GetoptError as err:
+ print str(err) # will print something like "option -a not recognized"
+ sys.exit(2)
+
+ for o, a in opts:
+ if o == "-i":
+ infile = a
+ if o == "-v":
+ verbose = True
+
+ compute_aep(infile, False, verbose)
+
diff --git a/compute_aep_calib.py b/compute_aep_calib.py
new file mode 100755
index 0000000..15891a1
--- /dev/null
+++ b/compute_aep_calib.py
@@ -0,0 +1,97 @@
+#!/usr/bin/env python
+
+import os
+import sys
+import getopt
+import subprocess
+import signal
+import serial
+import time
+import math
+
+def delta_nrj(delta, myline, min=[0,0,0,0,0], max=[0,0,0,0,0]):
+ array = myline.split(" ")
+
+ if (delta[0] < 0):
+ delta[0] = int(array[0])
+
+ time = int(array[0]) - delta[0]
+ if (time <= 0):
+ return delta
+
+# print array
+ for i in range(0, len(array)):
+ try:
+ data = int(array[i])
+ except ValueError:
+ continue
+
+ if (data < min[i]):
+ min[i] = data
+ if (data > max[i]):
+ max[i] = data
+ delta[i] += time * data
+
+ delta[0] = int(array[0])
+
+# print delta
+ return delta
+
+def compute_aep(infile, dry_run=True, verbose=False):
+ skip = 1
+ try:
+ fi = open(infile, "r")
+ except IOError:
+ print "WARN: Unable to open %s" % (infile)
+ sys.exit(2)
+
+ lines = fi.readlines()
+
+ offset = [0, 0, 0, 0, 0]
+ nrj = [-1, -0, -0, -0, -0]
+ max = [0, 0, 0, 0, 0]
+ min = [50000000, 5000000, 5000000, 5000000, 5000000]
+ label = ["time", "A53 core ", "A53 cache", "A57 core ", "A57 cache"]
+
+ for myline in lines:
+ if skip:
+ skip = 0
+ continue
+ delta_nrj(nrj, myline, min, max)
+
+ total = 0
+ for i in range(1, len(nrj)):
+ nrj[i] -= offset[i] * nrj[i]
+ total += nrj[i]
+ print "Total nrj: %8.3f J for %s -- duration %8.3f sec -- min %8.3f W -- max %8.3f W" % (nrj[i]/1000000000000.0, label[i], (max[0]-min[0])/1000000.0, min[i]/1000000.0, max[i]/1000000.0)
+ if (min[i] < offset[i]):
+ print "!!! Min below offset"
+
+ print "Total nrj: %8.3f J for %s -- duration %8.3f sec" % (total/1000000000000.0, "Platform ", (max[0]-min[0])/1000000.0)
+
+
+if __name__ == '__main__':
+
+ def handleSigTERM(signum, frame):
+ record = False
+
+ signal.signal(signal.SIGTERM, handleSigTERM)
+ signal.signal(signal.SIGINT, handleSigTERM)
+
+ infile = "EC-pmu.txt"
+ verbose = False
+
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], "i:v")
+ except getopt.GetoptError as err:
+ print str(err) # will print something like "option -a not recognized"
+ sys.exit(2)
+
+ for o, a in opts:
+ if o == "-i":
+ infile = a
+ if o == "-v":
+ verbose = True
+
+ compute_aep(infile, False, verbose)
+
diff --git a/dragonboard-reboot.sh b/dragonboard-reboot.sh
new file mode 120000
index 0000000..55d40b5
--- /dev/null
+++ b/dragonboard-reboot.sh
@@ -0,0 +1 @@
+mt8173evb-reboot.sh \ No newline at end of file
diff --git a/hikey-reboot.sh b/hikey-reboot.sh
new file mode 120000
index 0000000..55d40b5
--- /dev/null
+++ b/hikey-reboot.sh
@@ -0,0 +1 @@
+mt8173evb-reboot.sh \ No newline at end of file
diff --git a/monitor_supply.py b/monitor_supply.py
new file mode 100755
index 0000000..c5b085a
--- /dev/null
+++ b/monitor_supply.py
@@ -0,0 +1,173 @@
+#!/usr/bin/env python
+#
+# agilent66332Adriver.py
+#
+# Agilent 66332A power supply driver
+#
+
+import serial, time, sys, os
+
+class agilent66332Adriver():
+ def __init__(self, ttyport):
+ self.port = ttyport
+
+ def open(self):
+ try:
+ self.serialPort = serial.Serial(self.port, 9600, timeout=2, writeTimeout=2, bytesize=8, parity='N', stopbits=1, xonxoff=0, rtscts=1)
+ except ValueError:
+ print "!!! Error: parameter are out of range"
+ raise ValueError
+ except serial.SerialException:
+ print "!!! Error: the device can not be found or can not be configured"
+ raise serial.SerialException
+ except Exception as e:
+ raise e
+
+ def close(self):
+ self.serialPort.flushOutput()
+ self.serialPort.flushInput()
+ self.serialPort.close()
+
+ def sendCmd(self, cmd, read=False):
+ output = ""
+ try:
+ self.serialPort.write(cmd+"\n")
+ while read == True:
+ line = self.serialPort.readline()
+ if not line:
+ break;
+ if cmd == line.rstrip():
+ continue
+ else:
+ output=output+line
+ break;
+ except ValueError:
+ print "!!! Error: closed port"
+ raise ValueError
+ except serial.SerialTimeoutException:
+ print "!!! Error: write timeout"
+ raise serial.SerialTimeoutException
+ except Exception as e:
+ raise e
+
+ return output
+
+
+ def reset(self):
+ try:
+ self.sendCmd("*RST")
+ except Exception as e:
+ raise e
+
+ def getId(self):
+ value = '-1.0'
+ try:
+ value = self.sendCmd("*IDN?", read=True).rstrip()
+ except Exception as e:
+ raise e
+
+ return (value)
+
+ # Configure output voltage
+ def setOutputVolt(self, volt):
+ try:
+ self.sendCmd("VOLT %s"%volt)
+ except Exception as e:
+ raise e
+
+ # Configure output current
+ def setOutputCurrent(self, current):
+ try:
+ self.sendCmd("CURR %s"%current)
+ except Exception as e:
+ raise e
+
+ # Enable output
+ def setOutputState(self, state):
+ if (not state == "ON" and not state == "OFF"):
+ raise ValueError
+ try:
+ self.sendCmd("OUTP %s"%state)
+ except Exception as e:
+ raise e
+
+ def configMeasure(self, period=15.6, size=4096):
+
+ interval = '%2.1f' % period + "E-6"
+ print "setting interval to "+interval+" with "+str(size)+" samples"
+ try:
+ self.sendCmd("SENS:SWE:TINT %s"%interval)
+ self.sendCmd("SENS:SWE:POIN %s"%size)
+ except Exception as e:
+ raise e
+
+ pass
+
+ def readCurrent(self):
+ value = '-1.0'
+ try:
+ value = self.sendCmd("MEAS:CURR?", read=True).rstrip()
+ except Exception as e:
+ raise e
+
+ return (float(value))
+
+ def readVoltage(self):
+ value = '-1.0'
+ try:
+ value = self.sendCmd("MEAS:VOLT?", read=True).rstrip()
+ except Exception as e:
+ raise e
+
+ return (float(value))
+
+ def readCurrentBuffer(self):
+ array = '0'
+ try:
+ array = self.sendCmd("MEAS:ARR:CURR?", read=True).rstrip()
+ except Exception as e:
+ raise e
+ list_current = array.split(",")
+ return list_current
+
+ def writeBuffer(self, outfile, list_current, period=15.6):
+ try:
+ fo = open(outfile, "w+")
+ except IOError:
+ print "WARN: Unable to open %s", outfile
+ sys.exit(2)
+
+ myline="Time I_supply\n"
+ fo.write(myline)
+
+ time = 0
+ for value in list_current:
+ myline = str(int(time))+" "+str(int(float(value)*1000000))+"\n"
+ time += period
+
+ fo.write(myline)
+
+ fo.close()
+
+ return
+
+
+if __name__ == '__main__':
+ period = 400
+ # simple interactive demo/test
+ driver=agilent66332Adriver('/dev/ttyUSB0')
+ driver.open()
+ print driver.getId()
+ driver.reset()
+ driver.configMeasure(period, 4096)
+ driver.setOutputVolt("5")
+ driver.setOutputCurrent("4.0")
+ driver.setOutputState("ON")
+ print driver.readCurrent()
+ print driver.readVoltage()
+
+ raw_input("Press Enter to continue...")
+
+# driver.writeBuffer("tmp.txt", driver.readCurrentBuffer(), period)
+ driver.close()
+
diff --git a/monitor_thread.py b/monitor_thread.py
new file mode 100755
index 0000000..8390854
--- /dev/null
+++ b/monitor_thread.py
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+
+import logging
+
+import inotify.adapters
+
+_DEFAULT_LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
+
+_LOGGER = logging.getLogger(__name__)
+
+def _configure_logging():
+ _LOGGER.setLevel(logging.DEBUG)
+
+ ch = logging.StreamHandler()
+
+ formatter = logging.Formatter(_DEFAULT_LOG_FORMAT)
+ ch.setFormatter(formatter)
+
+ _LOGGER.addHandler(ch)
+
+def _main():
+ i = inotify.adapters.Inotify()
+
+ i.add_watch('/proc')
+
+ try:
+ for event in i.event_gen():
+ if event is not None:
+ (header, type_names, watch_path, filename) = event
+ if (header.mask == 256) or (header.mask == 2):
+ _LOGGER.info("WD=(%d) MASK=(%d) COOKIE=(%d) LEN=(%d) MASK->NAMES=%s "
+ "WATCH-PATH=[%s] FILENAME=[%s]",
+ header.wd, header.mask, header.cookie, header.len, type_names,
+ watch_path, filename)
+ finally:
+ i.remove_watch('/proc')
+
+if __name__ == '__main__':
+ _configure_logging()
+ _main()
+
diff --git a/mt8173evb-reboot.sh b/mt8173evb-reboot.sh
new file mode 100755
index 0000000..f8cf03d
--- /dev/null
+++ b/mt8173evb-reboot.sh
@@ -0,0 +1,103 @@
+#!/bin/bash -
+#===============================================================================
+#
+# FILE: reboot-mediatek.sh
+#
+# USAGE: ./reboot-mediatek.sh
+#
+# DESCRIPTION:
+#
+#
+# AUTHOR: #NAME# (#INITIALS#), #EMAIL#
+# COMPANY: #COMPANY#
+# CREATED: 08/04/2016 09:15:22 CEST
+#===============================================================================
+ARCH=$(basename $0)
+BOOT=${1-True}
+
+IP_RELAY=192.168.0.22
+
+# Init var
+case "$ARCH" in
+ "dragonboard-reboot.sh")
+ BOOT_IMG=/srv/tftp/dragon410/boot-db410c.img
+ RELAY=8
+ DEVICE=91db2320
+ POWERUP=?CloseRelay$RELAY
+ POWERDOWN=?OpenRelay$RELAY
+ ;;
+ "hikey-reboot.sh")
+ OTG=7
+ BOOT_IMG=/srv/tftp/hikey/boot-fat.uefi.img
+ RELAY=2
+ DEVICE=3834805900126730
+ POWERUP=?OpenRelay$RELAY
+ POWERDOWN=?CloseRelay$RELAY
+ curl http://$IP_RELAY/?CloseRelay$OTG
+
+ ;;
+ "mt8173evb-reboot.sh")
+ BOOT_IMG=/srv/tftp/mt8173evb/boot.img
+ RELAY=1
+ DEVICE=0123456789ABCDEF
+ POWERUP=?OpenRelay$RELAY
+ POWERDOWN=?CloseRelay$RELAY
+ ;;
+ *)
+ echo "Undefined board"
+ exit 1
+ ;;
+esac
+
+if [ "$BOOT" == "True" ]; then
+
+# Pre Reset
+case "$ARCH" in
+ "dragonboard-reboot.sh")
+ fastboot -s $DEVICE boot $BOOT_IMG &
+ ;;
+ "hikey-reboot.sh")
+ # Power up OTG
+ curl http://$IP_RELAY/?CloseRelay$OTG
+ ;;
+ "mt8173evb-reboot.sh")
+ fastboot -s $DEVICE boot $BOOT_IMG &
+ ;;
+ *)
+ echo "Undefined board"
+ exit 1
+ ;;
+esac
+fi
+
+curl http://$IP_RELAY/$POWERDOWN && sleep 1 && curl http://$IP_RELAY/$POWERUP
+
+if [ "$BOOT" == "True" ]; then
+case "$ARCH" in
+ "dragonboard-reboot.sh")
+ ;;
+ "hikey-reboot.sh")
+ fastboot -s $DEVICE getvar all
+ echo "Synced with hikey"
+
+ sleep 1
+
+ fastboot -s $DEVICE flash boot $BOOT_IMG
+ echo "New Image Flashed"
+
+ sleep 1
+
+ fastboot -s $DEVICE reboot
+ echo "Hikey rebooted"
+
+ # Power Down OTG
+ curl http://$IP_RELAY/?OpenRelay$OTG
+ ;;
+ "mt8173evb-reboot.sh")
+ ;;
+ *)
+ echo "Undefined board"
+ exit 1
+ ;;
+esac
+fi
diff --git a/parse_aep.sh b/parse_aep.sh
index 8305d98..3484965 100755
--- a/parse_aep.sh
+++ b/parse_aep.sh
@@ -8,14 +8,18 @@ case "$ARCH" in
sed '/^#/ d' $FIN | head -n 1 | awk '{ print $1 " " $4 " " $10 " " $13 " " $19 }' | sed s/\(W\)/\(uW\)/g > $FOUT
sed '/^#/ d' $FIN | tail -n +2 | sed s/\\.//g | awk '{ $1 = $1 * 1; $4 = ($4 + $7) * 10; $10 = $10 * 10; $13 = ($13 + $16) * 10; $19 = $19 * 10; print $1 " " $4 " " $10 " " $13 " " $19 }' >> $FOUT
;;
- "parse_servo_mt.sh")
+ "parse_aep_mt_lab.sh")
sed '/^#/ d' $FIN | head -n 1 | awk '{ print $1 " " $4 " " $10 " " $13 " " $19 }' | sed s/\(W\)/\(uW\)/g > $FOUT
- sed '/^#/ d' $FIN | tail -n +2 | sed s/\\.//g >> $FOUT
+ sed '/^#/ d' $FIN | tail -n +2 | sed s/\\.//g | awk '{ $1 = $1 * 1; $4 = $4 * 10; $10 = ($10 + $7) * 10; $13 = $13 * 10; $19 = ($19 + $16) * 10; print $1 " " $4 " " $10 " " $13 " " $19 }' >> $FOUT
;;
"parse_aep_mt_top.sh")
sed '/^#/ d' $FIN | head -n 1 | awk '{ print $1 " " $22 " " $28 " " $31 " " $37 }' | sed s/\(W\)/\(uW\)/g > $FOUT
sed '/^#/ d' $FIN | tail -n +2 | sed s/\\.//g | awk '{ $1 = $1 * 1; $22 = ($22 + $25) * 10; $28 = $28 * 10; $31 = ($31 + $34) * 10; $37 = $37 * 10; print $1 " " $22 " " $28 " " $31 " " $37 }' >> $FOUT
;;
+ "parse_aep_2.sh")
+ sed '/^#/ d' $FIN | head -n 1 | awk '{ print $1 " " $13 " " $16 " " $19 }' | sed s/\(W\)/\(uW\)/g > $FOUT
+ sed '/^#/ d' $FIN | tail -n +2 | sed s/\\.//g | awk '{ $1 = $1 * 1; $13 = $14 * 10; $16 = $16 * 10; $19 = $19 * 10; print $1 " " $13 " " $16 " " $19 }' >> $FOUT
+ ;;
*)
sed '/^#/ d' $FIN | head -n 1 | awk '{ print $1 " " $4 " " $7 " " $10 }' | sed s/\(W\)/\(uW\)/g > $FOUT
sed '/^#/ d' $FIN | tail -n +2 | sed s/\\.//g | awk '{ $1 = $1 * 1; $4 = $4 * 10; $7 = $7 * 10; $10 = $10 * 10; print $1 " " $4 " " $7 " " $10 }' >> $FOUT
diff --git a/parse_aep_2.sh b/parse_aep_2.sh
new file mode 120000
index 0000000..24f9223
--- /dev/null
+++ b/parse_aep_2.sh
@@ -0,0 +1 @@
+parse_aep.sh \ No newline at end of file
diff --git a/parse_aep_mt.sh b/parse_aep_mt.sh
new file mode 120000
index 0000000..24f9223
--- /dev/null
+++ b/parse_aep_mt.sh
@@ -0,0 +1 @@
+parse_aep.sh \ No newline at end of file
diff --git a/parse_aep_mt_lab.sh b/parse_aep_mt_lab.sh
new file mode 120000
index 0000000..24f9223
--- /dev/null
+++ b/parse_aep_mt_lab.sh
@@ -0,0 +1 @@
+parse_aep.sh \ No newline at end of file
diff --git a/parse_aep_mt_top.sh b/parse_aep_mt_top.sh
new file mode 120000
index 0000000..24f9223
--- /dev/null
+++ b/parse_aep_mt_top.sh
@@ -0,0 +1 @@
+parse_aep.sh \ No newline at end of file
diff --git a/parse_arm_trace.sh b/parse_arm_trace.sh
new file mode 100755
index 0000000..50bb2ac
--- /dev/null
+++ b/parse_arm_trace.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+CSS=${1-1}
+FIN=${2-'data'}
+FOUT=${3-'data.dat'}
+CPU=`trace-cmd report -i $FIN | grep ^cpus= | sed s/cpus=//`
+
+for ((i=0; i < $CPU; i++));
+do
+ echo "time util-cpu$i load-cpu$i " > "load-cpu"$i"-"$FOUT
+ trace-cmd report -i $FIN | grep -e sched_pelt_cfs_rq | grep "cpu=$i" | grep "tg_css_id=$CSS" |sed s/util_avg=// | sed s/load_avg=// | sed s/runnable=// | awk '{ $3 = $3 *1000000; printf "%.0f", $3; print " " $7 " " $8}' >> "load-cpu"$i"-"$FOUT
+
+done
+
diff --git a/parse_arm_trace_se.sh b/parse_arm_trace_se.sh
new file mode 100755
index 0000000..b9c312a
--- /dev/null
+++ b/parse_arm_trace_se.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+PID=${1-1}
+FIN=${2-'data'}
+FOUT=${3-'data.dat'}
+CPU=`trace-cmd report -i $FIN | grep ^cpus= | sed s/cpus=//`
+
+echo "time util-$PID load-$PID" > "load-se"$PID"-"$FOUT
+trace-cmd report -i $FIN | grep -e load_se | grep "pid $PID" | sed s/util=// | sed s/load=// | awk '{ $3 = $3 *1000000; printf "%.0f", $3; print " " $8 " " $9 }' >> "load-se"$PID"-"$FOUT
+
diff --git a/parse_perf_results.sh b/parse_perf_results.sh
new file mode 100755
index 0000000..e28438d
--- /dev/null
+++ b/parse_perf_results.sh
@@ -0,0 +1,18 @@
+#!/bin/bash -
+#===============================================================================
+#
+# FILE: parse_results.sh
+#
+# USAGE: ./parse_results.sh
+#
+# DESCRIPTION:
+#
+# AUTHOR: Vincent Guittot (VGU), vincent.guittot@st-ericsson.com
+# COMPANY: ST-Ericsson
+# CREATED: 02/18/2015 03:11:42 PM CET
+#===============================================================================
+cat $1/*hack* | grep Time | awk '{ print $2 }'
+cat $1/*ebizzy* | grep records | awk '{print $1 }'
+cat $1/*sys* | grep events: | awk '{ print $5 }'
+cat $1/*thd* | grep events: | awk '{ print $5 }'
+
diff --git a/parse_servo_mt.sh b/parse_servo_mt.sh
new file mode 120000
index 0000000..24f9223
--- /dev/null
+++ b/parse_servo_mt.sh
@@ -0,0 +1 @@
+parse_aep.sh \ No newline at end of file
diff --git a/parse_watt.sh b/parse_watt.sh
new file mode 100755
index 0000000..b276d84
--- /dev/null
+++ b/parse_watt.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+ARCH=$(basename $0)
+FIN=${1-'data'}
+FOUT=${2-'data.dat'}
+
+cat $FIN | awk 'NR==1 { print }; NR != 1 { $1 = $1 * 1000000; printf "%.0f",$1; print " " int($2) " " $3 " " $4 " " int($5) " " $6 }' > $FOUT
+
diff --git a/test_power.sh b/test_power.sh
index d87a0f0..f1f05e1 100755
--- a/test_power.sh
+++ b/test_power.sh
@@ -6,7 +6,7 @@
# USAGE: ./test_power.sh
#===============================================================================
CPUS=$(cat /proc/stat|sed -ne 's/^cpu\([[:digit:]]\+\).*/\1/p')
-DURATION=20
+DURATION=5
for cpu in $CPUS; do
echo "======> TESTING CPU$cpu"