mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 18:21:14 +00:00
fps: Added parameter to override FPS collection method
In Android M and above, there is a new method of collecting fps statistics, using gfxinfo rather than SurfaceFlinger, but the SF method is still available however. This parameter lets the user decide whether to always use SF, or to allow the instrument to pick the best method based on Android version it detects.
This commit is contained in:
parent
38b368eec2
commit
70b265dd34
@ -132,6 +132,12 @@ class FpsInstrument(Instrument):
|
||||
android/services/surfaceflinger/FrameTracker.h (as of the time of writing
|
||||
currently 128) and a frame rate of 60 fps that is applicable to most devices.
|
||||
"""),
|
||||
Parameter('force_surfaceflinger', kind=boolean, default=False,
|
||||
description="""
|
||||
By default, the method to capture fps data is based on Android version.
|
||||
If this is set to true, force the instrument to use the SurfaceFlinger method
|
||||
regardless of its Android version.
|
||||
"""),
|
||||
]
|
||||
|
||||
def __init__(self, device, **kwargs):
|
||||
@ -156,7 +162,7 @@ class FpsInstrument(Instrument):
|
||||
self.fps_outfile = os.path.join(context.output_directory, 'fps.csv')
|
||||
self.outfile = os.path.join(context.output_directory, 'frames.csv')
|
||||
# Android M brings a new method of collecting FPS data
|
||||
if self.device.get_sdk_version() >= 23:
|
||||
if not self.force_surfaceflinger and (self.device.get_sdk_version() >= 23):
|
||||
# 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
|
||||
# views/activities. Additionally, clearing the stats requires the package
|
||||
|
Loading…
x
Reference in New Issue
Block a user