1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

GfxInfo: Update to use nano second measurments

GfxInfo reports in nano seconds however was incorrectly labeled as
microseconds. Update to consistently deal in nano seconds.
This commit is contained in:
Marc Bonnici 2019-01-09 13:29:13 +00:00
parent c13e3c260b
commit a9ee41855d
2 changed files with 8 additions and 8 deletions

View File

@ -106,17 +106,17 @@ class DerivedGfxInfoStats(DerivedFpsStats):
frame_count += 1 frame_count += 1
if start_vsync is None: if start_vsync is None:
start_vsync = frame_data.Vsync_time_us start_vsync = frame_data.Vsync_time_ns
end_vsync = frame_data.Vsync_time_us end_vsync = frame_data.Vsync_time_ns
frame_time = frame_data.FrameCompleted_time_us - frame_data.IntendedVsync_time_us frame_time = frame_data.FrameCompleted_time_ns - frame_data.IntendedVsync_time_ns
pff = 1e9 / frame_time pff = 1e9 / frame_time
if pff > self.drop_threshold: if pff > self.drop_threshold:
per_frame_fps.append([pff]) per_frame_fps.append([pff])
if frame_count: if frame_count:
duration = end_vsync - start_vsync duration = end_vsync - start_vsync
fps = (1e6 * frame_count) / float(duration) fps = (1e9 * frame_count) / float(duration)
else: else:
duration = 0 duration = 0
fps = 0 fps = 0
@ -133,15 +133,15 @@ class DerivedGfxInfoStats(DerivedFpsStats):
def _process_with_pandas(self, measurements_csv): def _process_with_pandas(self, measurements_csv):
data = pd.read_csv(measurements_csv.path) data = pd.read_csv(measurements_csv.path)
data = data[data.Flags_flags == 0] data = data[data.Flags_flags == 0]
frame_time = data.FrameCompleted_time_us - data.IntendedVsync_time_us frame_time = data.FrameCompleted_time_ns - data.IntendedVsync_time_ns
per_frame_fps = (1e6 / frame_time) per_frame_fps = (1e9 / frame_time)
keep_filter = per_frame_fps > self.drop_threshold keep_filter = per_frame_fps > self.drop_threshold
per_frame_fps = per_frame_fps[keep_filter] per_frame_fps = per_frame_fps[keep_filter]
per_frame_fps.name = 'fps' per_frame_fps.name = 'fps'
frame_count = data.index.size frame_count = data.index.size
if frame_count > 1: if frame_count > 1:
duration = data.Vsync_time_us.iloc[-1] - data.Vsync_time_us.iloc[0] duration = data.Vsync_time_ns.iloc[-1] - data.Vsync_time_ns.iloc[0]
fps = (1e9 * frame_count) / float(duration) fps = (1e9 * frame_count) / float(duration)
else: else:
duration = 0 duration = 0

View File

@ -82,7 +82,7 @@ class GfxInfoFramesInstrument(FramesInstrument):
if entry == 'Flags': if entry == 'Flags':
self.add_channel('Flags', MeasurementType('flags', 'flags')) self.add_channel('Flags', MeasurementType('flags', 'flags'))
else: else:
self.add_channel(entry, 'time_us') self.add_channel(entry, 'time_ns')
self.header = [chan.label for chan in self.channels.values()] self.header = [chan.label for chan in self.channels.values()]