1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-02-07 05:30:44 +00:00

gfxinfo fixes

- Make sure timestamps are actually reported in microseconds.
- Eliminate duplicate entries from successive dumps
This commit is contained in:
Sergei Trofimov 2017-09-22 13:46:32 +01:00
parent 9f666320f3
commit 4593d8605d
3 changed files with 9 additions and 3 deletions

View File

@ -97,7 +97,7 @@ class DerivedGfxInfoStats(DerivedFpsStats):
if frame_count:
duration = end_vsync - start_vsync
fps = (1e9 * frame_count) / float(duration)
fps = (1e6 * frame_count) / float(duration)
else:
duration = 0
fps = 0
@ -116,7 +116,7 @@ class DerivedGfxInfoStats(DerivedFpsStats):
data = pd.read_csv(measurements_csv.path)
data = data[data.Flags_flags == 0]
frame_time = data.FrameCompleted_time_us - data.IntendedVsync_time_us
per_frame_fps = (1e9 / frame_time)
per_frame_fps = (1e6 / frame_time)
keep_filter = per_frame_fps > self.drop_threshold
per_frame_fps = per_frame_fps[keep_filter]
per_frame_fps.name = 'fps'

View File

@ -1,3 +1,4 @@
from __future__ import division
from devlib.instrument import (Instrument, CONTINUOUS,
MeasurementsCsv, MeasurementType)
from devlib.utils.rendering import (GfxinfoFrameCollector,

View File

@ -195,6 +195,7 @@ class GfxinfoFrameCollector(FrameCollector):
def _process_raw_file(self, fh):
found = False
try:
last_vsync = 0
while True:
for line in fh:
if line.startswith('---PROFILEDATA---'):
@ -205,7 +206,11 @@ class GfxinfoFrameCollector(FrameCollector):
for line in fh:
if line.startswith('---PROFILEDATA---'):
break
self.frames.append(map(int, line.strip().split(',')[:-1])) # has a trailing ','
entries = map(int, line.strip().split(',')[:-1]) # has a trailing ','
if entries[1] <= last_vsync:
continue # repeat frame
last_vsync = entries[1]
self.frames.append(entries)
except StopIteration:
pass
if not found: