mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
utils.rendering: Fix activity matching
Change the SurfaceFlingerFrameCollector to match activities by prefix instead of looking for an exact match. This will allow to account for activities with variable suffixes. Raise an error if more than one activity matches the provided view. Show a warning if no activities match the provided view in order to avoid silently failing. Suggested-by: Andriani Mappoura <andriani.mappoura@arm.com> Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
This commit is contained in:
parent
be988bb42b
commit
59ff6100d8
@ -131,9 +131,18 @@ class SurfaceFlingerFrameCollector(FrameCollector):
|
|||||||
self.header = header or SurfaceFlingerFrame._fields
|
self.header = header or SurfaceFlingerFrame._fields
|
||||||
|
|
||||||
def collect_frames(self, wfh):
|
def collect_frames(self, wfh):
|
||||||
for activity in self.list():
|
activities = [a for a in self.list() if a.startswith(self.view)]
|
||||||
if activity == self.view:
|
|
||||||
wfh.write(self.get_latencies(activity).encode('utf-8'))
|
if len(activities) > 1:
|
||||||
|
raise ValueError(
|
||||||
|
"More than one activity matching view '{}' was found: {}".format(self.view, activities)
|
||||||
|
)
|
||||||
|
|
||||||
|
if not activities:
|
||||||
|
logger.warning("No activities matching view '{}' were found".format(self.view))
|
||||||
|
|
||||||
|
for activity in activities:
|
||||||
|
wfh.write(self.get_latencies(activity).encode('utf-8'))
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
self.target.execute('dumpsys SurfaceFlinger --latency-clear ')
|
self.target.execute('dumpsys SurfaceFlinger --latency-clear ')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user