6from _hardware
import Expectation
7from _hardware_android
import HardwareAndroid
9CPU_CLOCK_RATE = 2035200
11GPU_CLOCK_RATE = 670000000
16 HardwareAndroid.__init__(self, adb)
19 HardwareAndroid.__enter__(self)
20 if not self.
_adb.is_root():
30 for N
in 0 1 2 3 7; do
31 echo 0 > /sys/devices/system/cpu/cpu$N/online
37 echo 1 > /sys/devices/system/cpu/cpu$N/online
38 echo userspace > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_governor
39 echo %i > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_max_freq
40 echo %i > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_min_freq
41 echo %i > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_setspeed
42 done
''' % tuple(CPU_CLOCK_RATE for _ in range(3)),
46 echo 0 > /sys/class/kgsl/kgsl-3d0/bus_split
''',
50 echo 10000 > /sys/class/kgsl/kgsl-3d0/idle_timer
''',
54 echo %i > /sys/class/devfreq/soc\:qcom,gpubw/min_freq
55 echo %i > /sys/
class/devfreq/soc\:qcom,gpubw/max_freq
56 echo %i > /sys/
class/devfreq/soc\:qcom,cpubw/min_freq
57 echo %i > /sys/
class/devfreq/soc\:qcom,cpubw/max_freq
58 echo %i > /sys/
class/devfreq/soc\:qcom,mincpubw/min_freq
59 echo %i > /sys/
class/devfreq/soc\:qcom,mincpubw/max_freq
60 echo %i > /sys/
class/devfreq/soc\:qcom,memlat-cpu0/min_freq
61 echo %i > /sys/
class/devfreq/soc\:qcom,memlat-cpu0/max_freq
''' %
62 tuple(MEM_CLOCK_RATE for _
in range(8)),
66 echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor
67 echo %i > /sys/
class/kgsl/kgsl-3d0/devfreq/max_freq
68 echo %i > /sys/
class/kgsl/kgsl-3d0/devfreq/min_freq
''' %
69 tuple(GPU_CLOCK_RATE for _
in range(2)),
73 echo %i > /sys/class/kgsl/kgsl-3d0/max_pwrlevel
74 echo %i > /sys/
class/kgsl/kgsl-3d0/min_pwrlevel
''' %
75 tuple(GPU_POWER_LEVEL for _
in range(2))]))
78 'cat /sys/class/thermal/thermal_zone10/type').strip())
80 'cat /sys/class/thermal/thermal_zone7/type').strip())
85 HardwareAndroid.sanity_check(self)
87 if not self.
_adb.is_root():
92 '/sys/class/power_supply/battery/capacity',
93 '/sys/devices/system/cpu/online'] + \
94 [
'/sys/devices/system/cpu/cpu%i/cpufreq/scaling_cur_freq' % i
95 for i
in range(4, 7)] + \
101 [
'/sys/kernel/debug/clk/bimc_clk/measure',
102 '/sys/class/kgsl/kgsl-3d0/temp',
103 '/sys/class/kgsl/kgsl-3d0/throttling',
104 '/sys/class/thermal/thermal_zone10/temp',
105 '/sys/class/thermal/thermal_zone7/temp']))
108 [
Expectation(int, min_value=30, name=
'battery', sleeptime=30*60),
109 Expectation(str, exact_value=
'4-6', name=
'online cpus')] + \
110 [
Expectation(int, exact_value=CPU_CLOCK_RATE, name=
'cpu_%i clock rate' %i)
111 for i
in range(4, 7)] + \
112 [
Expectation(long, min_value=902390000, max_value=902409999,
113 name=
'measured ddr clock', sleeptime=10),
114 Expectation(int, max_value=750, name=
'gpu temperature'),
115 Expectation(int, exact_value=1, name=
'gpu throttling'),
116 Expectation(int, max_value=75, name=
'msm_therm temperature'),
117 Expectation(int, max_value=75000, name=
'pm8998_tz temperature')]
119 Expectation.check_all(expectations, result.splitlines())
#define check(reporter, ref, unref, make, kill)
static SkString join(const CommandLineFlags::StringArray &)