Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
tools.skpbench._hardware_pixel2.HardwarePixel2 Class Reference
Inheritance diagram for tools.skpbench._hardware_pixel2.HardwarePixel2:
tools.skpbench._hardware_android.HardwareAndroid tools.skpbench._hardware.Hardware

Public Member Functions

def __init__ (self, adb)
 
def __enter__ (self)
 
def sanity_check (self)
 
- Public Member Functions inherited from tools.skpbench._hardware_android.HardwareAndroid
def __init__ (self, adb)
 
def __enter__ (self)
 
def __exit__ (self, exception_type, exception_value, traceback)
 
def sanity_check (self)
 
def print_debug_diagnostics (self)
 
def setDesiredClock (self, c)
 
def lock_top_three_cores (self)
 
def lock_adreno_gpu (self)
 
- Public Member Functions inherited from tools.skpbench._hardware.Hardware
def __init__ (self)
 
def __enter__ (self)
 
def __exit__ (self, exception_type, exception_value, traceback)
 
def filter_line (self, line)
 
def sanity_check (self)
 
def print_debug_diagnostics (self)
 

Additional Inherited Members

- Public Attributes inherited from tools.skpbench._hardware_android.HardwareAndroid
 warmup_time
 
 desiredClock
 
- Public Attributes inherited from tools.skpbench._hardware.Hardware
 warmup_time
 

Detailed Description

Definition at line 14 of file _hardware_pixel2.py.

Constructor & Destructor Documentation

◆ __init__()

def tools.skpbench._hardware_pixel2.HardwarePixel2.__init__ (   self,
  adb 
)

Reimplemented from tools.skpbench._hardware_android.HardwareAndroid.

Definition at line 15 of file _hardware_pixel2.py.

15 def __init__(self, adb):
16 HardwareAndroid.__init__(self, adb)
17

Member Function Documentation

◆ __enter__()

def tools.skpbench._hardware_pixel2.HardwarePixel2.__enter__ (   self)

Reimplemented from tools.skpbench._hardware_android.HardwareAndroid.

Definition at line 18 of file _hardware_pixel2.py.

18 def __enter__(self):
19 HardwareAndroid.__enter__(self)
20 if not self._adb.is_root():
21 return self
22
23 self._adb.shell('\n'.join([
24 '''
25 stop thermal-engine
26 stop perfd''',
27
28 # turn off the slow cores and one fast core
29 '''
30 for N in 0 1 2 3 7; do
31 echo 0 > /sys/devices/system/cpu/cpu$N/online
32 done''',
33
34 # lock 3 fast cores: two for Skia and one for the OS
35 '''
36 for N in 4 5 6; do
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)),
43
44 # Set GPU bus and idle timer
45 '''
46 echo 0 > /sys/class/kgsl/kgsl-3d0/bus_split''',
47 # csmartdalton, 4-26-2018: this line hangs my device
48 # echo 1 > /sys/class/kgsl/kgsl-3d0/force_clk_on
49 '''
50 echo 10000 > /sys/class/kgsl/kgsl-3d0/idle_timer''',
51
52 # Set mem frequency to max
53 '''
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)),
63
64 # Set GPU to performance mode
65 '''
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)),
70
71 # Set GPU power level
72 '''
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))]))
76
77 assert('msm_therm' == self._adb.check(\
78 'cat /sys/class/thermal/thermal_zone10/type').strip())
79 assert('pm8998_tz' == self._adb.check(\
80 'cat /sys/class/thermal/thermal_zone7/type').strip())
81
82 return self
83
#define check(reporter, ref, unref, make, kill)
Definition: RefCntTest.cpp:85
static SkString join(const CommandLineFlags::StringArray &)
Definition: skpbench.cpp:741

◆ sanity_check()

def tools.skpbench._hardware_pixel2.HardwarePixel2.sanity_check (   self)
Raises a HardwareException if any hardware state is not as expected.

Reimplemented from tools.skpbench._hardware_android.HardwareAndroid.

Definition at line 84 of file _hardware_pixel2.py.

84 def sanity_check(self):
85 HardwareAndroid.sanity_check(self)
86
87 if not self._adb.is_root():
88 return
89
90 result = self._adb.check(' '.join(
91 ['cat',
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)] + \
96 # Unfortunately we can't monitor the gpu clock:
97 #
98 # /sys/class/kgsl/kgsl-3d0/devfreq/cur_freq
99 #
100 # It doesn't respect the min_freq/max_freq values when not under load.
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']))
106
107 expectations = \
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')]
118
119 Expectation.check_all(expectations, result.splitlines())

The documentation for this class was generated from the following file: