scripts: Add reset option to prep_benchmarks.sh

This undoes what it reasonably can.

Change-Id: I83ff6d652fbf8b717432bef874003987fe87bfc6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/393685
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Ben Walker 2018-01-04 10:54:11 -07:00 committed by Jim Harris
parent d567945064
commit 58d46f298f

View File

@ -48,4 +48,26 @@ function configure_performance() {
echo "Done"
}
configure_performance
function reset_performance() {
echo -n "Placing all CPUs in powersave mode..."
for governor in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do
echo -n powersave > $governor
done
echo "Done"
if [ -f "/sys/devices/system/cpu/intel_pstate/no_turbo" ]; then
echo -n "Enabling Turbo Boost..."
echo -n 0 > /sys/devices/system/cpu/intel_pstate/no_turbo
echo "Done"
fi
echo -n "Enabling irqbalance service..."
service irqbalance start 2> /dev/null
echo "Done"
}
if [ "$1" = "reset" ]; then
reset_performance
else
configure_performance
fi