From a9ee41855d978e2cdd18f09028a4d842d7cf2d88 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Wed, 9 Jan 2019 13:29:13 +0000 Subject: [PATCH] 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. --- devlib/derived/fps.py | 14 +++++++------- devlib/instrument/frames.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/devlib/derived/fps.py b/devlib/derived/fps.py index b47d328..b7ef4ca 100644 --- a/devlib/derived/fps.py +++ b/devlib/derived/fps.py @@ -106,17 +106,17 @@ class DerivedGfxInfoStats(DerivedFpsStats): frame_count += 1 if start_vsync is None: - start_vsync = frame_data.Vsync_time_us - end_vsync = frame_data.Vsync_time_us + start_vsync = frame_data.Vsync_time_ns + 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 if pff > self.drop_threshold: per_frame_fps.append([pff]) if frame_count: duration = end_vsync - start_vsync - fps = (1e6 * frame_count) / float(duration) + fps = (1e9 * frame_count) / float(duration) else: duration = 0 fps = 0 @@ -133,15 +133,15 @@ class DerivedGfxInfoStats(DerivedFpsStats): def _process_with_pandas(self, measurements_csv): 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 = (1e6 / frame_time) + frame_time = data.FrameCompleted_time_ns - data.IntendedVsync_time_ns + per_frame_fps = (1e9 / frame_time) keep_filter = per_frame_fps > self.drop_threshold per_frame_fps = per_frame_fps[keep_filter] per_frame_fps.name = 'fps' frame_count = data.index.size 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) else: duration = 0 diff --git a/devlib/instrument/frames.py b/devlib/instrument/frames.py index 1ec85fb..d634724 100644 --- a/devlib/instrument/frames.py +++ b/devlib/instrument/frames.py @@ -82,7 +82,7 @@ class GfxInfoFramesInstrument(FramesInstrument): if entry == 'Flags': self.add_channel('Flags', MeasurementType('flags', 'flags')) else: - self.add_channel(entry, 'time_us') + self.add_channel(entry, 'time_ns') self.header = [chan.label for chan in self.channels.values()]