Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
tools.skpbench._hardware_pixel_c.HardwarePixelC Class Reference
Inheritance diagram for tools.skpbench._hardware_pixel_c.HardwarePixelC:
tools.skpbench._hardware_android.HardwareAndroid tools.skpbench._hardware.Hardware

Public Member Functions

 __init__ (self, adb)
 
 __enter__ (self)
 
 filter_line (self, line)
 
 sanity_check (self)
 
- Public Member Functions inherited from tools.skpbench._hardware_android.HardwareAndroid
 __exit__ (self, exception_type, exception_value, traceback)
 
 print_debug_diagnostics (self)
 
 setDesiredClock (self, c)
 
 lock_top_three_cores (self)
 
 lock_adreno_gpu (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
 
- Protected Attributes inherited from tools.skpbench._hardware_android.HardwareAndroid
 _adb
 

Detailed Description

Definition at line 15 of file _hardware_pixel_c.py.

Constructor & Destructor Documentation

◆ __init__()

tools.skpbench._hardware_pixel_c.HardwarePixelC.__init__ (   self,
  adb 
)

Reimplemented from tools.skpbench._hardware_android.HardwareAndroid.

Definition at line 16 of file _hardware_pixel_c.py.

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

Member Function Documentation

◆ __enter__()

tools.skpbench._hardware_pixel_c.HardwarePixelC.__enter__ (   self)

Reimplemented from tools.skpbench._hardware_android.HardwareAndroid.

Definition at line 19 of file _hardware_pixel_c.py.

19 def __enter__(self):
20 HardwareAndroid.__enter__(self)
21 if not self._adb.is_root():
22 return self
23
24 self._adb.shell('\n'.join([
25 # pylint: disable=line-too-long
26 # Based on https://android.googlesource.com/platform/frameworks/base/+/master/libs/hwui/tests/scripts/prep_ryu.sh
27 # All CPUs have the same scaling settings, so we only need to set it once
28 '''
29 stop thermal-engine
30 stop perfd
31
32 echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
33 echo %i > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
34 echo %i > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
35 echo %i > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
36 ''' % tuple(CPU_CLOCK_RATE for _ in range(3)),
37 # turn off the fourth core. This will hopefully produce less heat, allowing
38 # for more consistent results. 3 cores should be enough to run Ganesh,
39 # the graphics driver, and the OS.
40 '''
41 echo 0 > /sys/devices/system/cpu/cpu3/online''',
42
43 # lock gpu/emc clocks.
44 '''
45 chown root:root /sys/devices/57000000.gpu/pstate
46 echo %s > /sys/devices/57000000.gpu/pstate''' % GPU_EMC_PROFILE_ID]))
47
48 return self
49

◆ filter_line()

tools.skpbench._hardware_pixel_c.HardwarePixelC.filter_line (   self,
  line 
)
Returns False if the provided output line can be suppressed.

Reimplemented from tools.skpbench._hardware.Hardware.

Definition at line 50 of file _hardware_pixel_c.py.

50 def filter_line(self, line):
51 JUNK = ['NvRmPrivGetChipPlatform: Could not read platform information',
52 'Expected on kernels without fuse support, using silicon']
53 return False if line in JUNK else HardwareAndroid.filter_line(self, line)
54

◆ sanity_check()

tools.skpbench._hardware_pixel_c.HardwarePixelC.sanity_check (   self)
Raises a HardwareException if any hardware state is not as expected.

Reimplemented from tools.skpbench._hardware_android.HardwareAndroid.

Definition at line 55 of file _hardware_pixel_c.py.

55 def sanity_check(self):
56 HardwareAndroid.sanity_check(self)
57
58 if not self._adb.is_root():
59 return
60
61 # only issue one shell command in an attempt to minimize interference.
62 result = self._adb.check('''\
63 cat /sys/class/power_supply/bq27742-0/capacity \
64 /sys/devices/system/cpu/online \
65 /sys/class/thermal/thermal_zone7/temp \
66 /sys/class/thermal/thermal_zone0/temp \
67 /sys/class/thermal/thermal_zone1/temp \
68 /sys/class/thermal/thermal_zone7/cdev1/cur_state \
69 /sys/class/thermal/thermal_zone7/cdev0/cur_state
70 for N in 0 1 2; do
71 cat /sys/devices/system/cpu/cpu$N/cpufreq/scaling_cur_freq
72 done
73 cat /sys/devices/57000000.gpu/pstate | grep \*$''')
74
75 expectations = \
76 [Expectation(int, min_value=30, name='battery', sleeptime=30*60),
77 Expectation(str, exact_value='0-2', name='online cpus'),
78 Expectation(int, max_value=40000, name='skin temperature'),
79 Expectation(int, max_value=86000, name='cpu temperature'),
80 Expectation(int, max_value=87000, name='gpu temperature'),
81 Expectation(int, exact_value=0, name='cpu throttle'),
82 Expectation(int, exact_value=0, name='gpu throttle')] + \
83 [Expectation(int, exact_value=CPU_CLOCK_RATE,
84 name='cpu_%i clock rate' % i, sleeptime=30)
85 for i in (0, 1, 2)] + \
86 [Expectation(str, exact_value=GPU_EMC_PROFILE, name='gpu/emc profile')]
87
88 Expectation.check_all(expectations, result.splitlines())
#define check(reporter, ref, unref, make, kill)

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