diff options
author | Zeno Albisser <zeno.albisser@theqtcompany.com> | 2014-12-05 15:04:29 +0100 |
---|---|---|
committer | Andras Becsi <andras.becsi@theqtcompany.com> | 2014-12-09 10:49:28 +0100 |
commit | af6588f8d723931a298c995fa97259bb7f7deb55 (patch) | |
tree | 060ca707847ba1735f01af2372e0d5e494dc0366 /chromium/v8/tools/cpu.sh | |
parent | 2fff84d821cc7b1c785f6404e0f8091333283e74 (diff) | |
download | qtwebengine-chromium-af6588f8d723931a298c995fa97259bb7f7deb55.tar.gz |
BASELINE: Update chromium to 40.0.2214.28 and ninja to 1.5.3.
Change-Id: I759465284fd64d59ad120219cbe257f7402c4181
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'chromium/v8/tools/cpu.sh')
-rwxr-xr-x | chromium/v8/tools/cpu.sh | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/chromium/v8/tools/cpu.sh b/chromium/v8/tools/cpu.sh new file mode 100755 index 00000000000..8e8a243c605 --- /dev/null +++ b/chromium/v8/tools/cpu.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# Copyright 2014 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +CPUPATH=/sys/devices/system/cpu + +MAXID=$(cat $CPUPATH/present | awk -F- '{print $NF}') + +set_governor() { + echo "Setting CPU frequency governor to \"$1\"" + for (( i=0; i<=$MAXID; i++ )); do + echo "$1" > $CPUPATH/cpu$i/cpufreq/scaling_governor + done +} + +dual_core() { + echo "Switching to dual-core mode" + for (( i=2; i<=$MAXID; i++ )); do + echo 0 > $CPUPATH/cpu$i/online + done +} + +single_core() { + echo "Switching to single-core mode" + for (( i=1; i<=$MAXID; i++ )); do + echo 0 > $CPUPATH/cpu$i/online + done +} + + +all_cores() { + echo "Reactivating all CPU cores" + for (( i=2; i<=$MAXID; i++ )); do + echo 1 > $CPUPATH/cpu$i/online + done +} + +case "$1" in + fast | performance) + set_governor "performance" + ;; + slow | powersave) + set_governor "powersave" + ;; + default | ondemand) + set_governor "ondemand" + ;; + dualcore | dual) + dual_core + ;; + singlecore | single) + single_core + ;; + allcores | all) + all_cores + ;; + *) + echo "Usage: $0 fast|slow|default|singlecore|dualcore|all" + exit 1 + ;; +esac |