Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
tools.skpbench._hardware_pixel.HardwarePixel Class Reference
Inheritance diagram for tools.skpbench._hardware_pixel.HardwarePixel:
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 12 of file _hardware_pixel.py.

Constructor & Destructor Documentation

◆ __init__()

def tools.skpbench._hardware_pixel.HardwarePixel.__init__ (   self,
  adb 
)

Reimplemented from tools.skpbench._hardware_android.HardwareAndroid.

Definition at line 13 of file _hardware_pixel.py.

13 def __init__(self, adb):
14 HardwareAndroid.__init__(self, adb)
15

Member Function Documentation

◆ __enter__()

def tools.skpbench._hardware_pixel.HardwarePixel.__enter__ (   self)

Reimplemented from tools.skpbench._hardware_android.HardwareAndroid.

Definition at line 16 of file _hardware_pixel.py.

16 def __enter__(self):
17 HardwareAndroid.__enter__(self)
18 if not self._adb.is_root():
19 return self
20
21 self._adb.shell('\n'.join([
22 # enable and lock the two fast cores.
23 '''
24 stop thermal-engine
25 stop perfd
26
27 for N in 3 2; do
28 echo 1 > /sys/devices/system/cpu/cpu$N/online
29 echo userspace > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_governor
30 echo %i > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_max_freq
31 echo %i > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_min_freq
32 echo %i > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_setspeed
33 done''' % tuple(CPU_CLOCK_RATE for _ in range(3)),
34
35 # turn off the two slow cores
36 '''
37 for N in 1 0; do
38 echo 0 > /sys/devices/system/cpu/cpu$N/online
39 done''',
40
41 # pylint: disable=line-too-long
42
43 # Set GPU bus and idle timer
44 # Set DDR frequency to max
45 # Set GPU to performance mode, 315 MHZ
46 # See https://android.googlesource.com/platform/frameworks/base/+/master/libs/hwui/tests/scripts/prep_marlfish.sh
47 '''
48 echo 0 > /sys/class/kgsl/kgsl-3d0/bus_split
49 echo 1 > /sys/class/kgsl/kgsl-3d0/force_clk_on
50 echo 10000 > /sys/class/kgsl/kgsl-3d0/idle_timer
51
52 echo 13763 > /sys/class/devfreq/soc:qcom,gpubw/min_freq
53
54 echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor
55 echo %i > /sys/class/kgsl/kgsl-3d0/devfreq/max_freq
56 echo %i > /sys/class/kgsl/kgsl-3d0/devfreq/min_freq
57
58 echo 4 > /sys/class/kgsl/kgsl-3d0/max_pwrlevel
59 echo 4 > /sys/class/kgsl/kgsl-3d0/min_pwrlevel''' %
60 tuple(GPU_CLOCK_RATE for _ in range(2))]))
61
62 return self
63
static SkString join(const CommandLineFlags::StringArray &)
Definition: skpbench.cpp:741

◆ sanity_check()

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

Reimplemented from tools.skpbench._hardware_android.HardwareAndroid.

Definition at line 64 of file _hardware_pixel.py.

64 def sanity_check(self):
65 HardwareAndroid.sanity_check(self)
66
67 if not self._adb.is_root():
68 return
69
70 result = self._adb.check(' '.join(
71 ['cat',
72 '/sys/class/power_supply/battery/capacity',
73 '/sys/devices/system/cpu/online'] + \
74 ['/sys/devices/system/cpu/cpu%i/cpufreq/scaling_cur_freq' % i
75 for i in range(2, 4)] + \
76 ['/sys/kernel/debug/clk/bimc_clk/measure',
77 '/sys/class/thermal/thermal_zone22/temp',
78 '/sys/class/thermal/thermal_zone23/temp']))
79
80 expectations = \
81 [Expectation(int, min_value=30, name='battery', sleeptime=30*60),
82 Expectation(str, exact_value='2-3', name='online cpus')] + \
83 [Expectation(int, exact_value=CPU_CLOCK_RATE, name='cpu_%i clock rate' %i)
84 for i in range(2, 4)] + \
85 [Expectation(long, min_value=902390000, max_value=902409999,
86 name='measured ddr clock', sleeptime=10),
87 Expectation(int, max_value=41000, name='pm8994_tz temperature'),
88 Expectation(int, max_value=40, name='msm_therm temperature')]
89
90 Expectation.check_all(expectations, result.splitlines())
#define check(reporter, ref, unref, make, kill)
Definition: RefCntTest.cpp:85

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