mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-22 12:58:36 +00:00
Instrumentation/FPS: Fixes attribute checking
Previously only the requirements for using SurfaceFlinger were checked, regardless of the FPS method being used. This commit now only ensure that a `View` attribute is present when using SurfaceFlinge and a `package` name is available if using gfxinfo otherwise falling back to SurfaceFlinger.
This commit is contained in:
parent
12230da959
commit
58a8ea9051
@ -158,11 +158,20 @@ class FpsInstrument(Instrument):
|
|||||||
|
|
||||||
def setup(self, context):
|
def setup(self, context):
|
||||||
workload = context.workload
|
workload = context.workload
|
||||||
if hasattr(workload, 'view'):
|
|
||||||
|
use_gfxinfo = not self.force_surfaceflinger and (self.device.get_sdk_version() >= 23)
|
||||||
|
if use_gfxinfo and not hasattr(workload, 'package'):
|
||||||
|
self.logger.debug('Workload does not contain a package; falling back to SurfaceFlinger...')
|
||||||
|
use_gfxinfo = False
|
||||||
|
if not use_gfxinfo and not hasattr(workload, 'view'):
|
||||||
|
self.logger.debug('Workload does not contain a view; disabling...')
|
||||||
|
self.is_enabled = False
|
||||||
|
return
|
||||||
|
|
||||||
self.fps_outfile = os.path.join(context.output_directory, 'fps.csv')
|
self.fps_outfile = os.path.join(context.output_directory, 'fps.csv')
|
||||||
self.outfile = os.path.join(context.output_directory, 'frames.csv')
|
self.outfile = os.path.join(context.output_directory, 'frames.csv')
|
||||||
# Android M brings a new method of collecting FPS data
|
# Android M brings a new method of collecting FPS data
|
||||||
if not self.force_surfaceflinger and (self.device.get_sdk_version() >= 23):
|
if use_gfxinfo:
|
||||||
# gfxinfo takes in the package name rather than a single view/activity
|
# gfxinfo takes in the package name rather than a single view/activity
|
||||||
# so there is no 'list_command' to run and compare against a list of
|
# so there is no 'list_command' to run and compare against a list of
|
||||||
# views/activities. Additionally, clearing the stats requires the package
|
# views/activities. Additionally, clearing the stats requires the package
|
||||||
@ -186,9 +195,6 @@ class FpsInstrument(Instrument):
|
|||||||
self.collector = LatencyCollector(self.outfile, self.device, params or '',
|
self.collector = LatencyCollector(self.outfile, self.device, params or '',
|
||||||
self.keep_raw, self.logger, self.dumpsys_period,
|
self.keep_raw, self.logger, self.dumpsys_period,
|
||||||
runcmd, lstcmd, self.fps_method)
|
runcmd, lstcmd, self.fps_method)
|
||||||
else:
|
|
||||||
self.logger.debug('Workload does not contain a view; disabling...')
|
|
||||||
self.is_enabled = False
|
|
||||||
|
|
||||||
def start(self, context):
|
def start(self, context):
|
||||||
if self.is_enabled:
|
if self.is_enabled:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user