@@ -57,6 +57,8 @@ public static void LoadTrace(string traceFilename)
5757 runtime . EnableCooker ( PerfettoPluginConstants . StackProfileFrameCookerPath ) ;
5858 runtime . EnableCooker ( PerfettoPluginConstants . StackProfileMappingCookerPath ) ;
5959 runtime . EnableCooker ( PerfettoPluginConstants . StackProfileSymbolCookerPath ) ;
60+ runtime . EnableCooker ( PerfettoPluginConstants . ExpectedFrameCookerPath ) ;
61+ runtime . EnableCooker ( PerfettoPluginConstants . ActualFrameCookerPath ) ;
6062
6163 // Enable the composite data cookers
6264 runtime . EnableCooker ( PerfettoPluginConstants . GenericEventCookerPath ) ;
@@ -66,6 +68,7 @@ public static void LoadTrace(string traceFilename)
6668 runtime . EnableCooker ( PerfettoPluginConstants . FtraceEventCookerPath ) ;
6769 runtime . EnableCooker ( PerfettoPluginConstants . CpuFrequencyEventCookerPath ) ;
6870 runtime . EnableCooker ( PerfettoPluginConstants . CpuSamplingEventCookerPath ) ;
71+ runtime . EnableCooker ( PerfettoPluginConstants . FrameEventCookerPath ) ;
6972
7073 // Process our data.
7174 RuntimeExecutionResults = runtime . Process ( ) ;
@@ -228,6 +231,28 @@ public void TestChromeTrace()
228231 Assert . IsTrue ( logcatEventData . Count == 43 ) ;
229232 Assert . IsTrue ( logcatEventData [ 0 ] . Message == "type: 97 score: 0.8\n " ) ;
230233 Assert . IsTrue ( logcatEventData [ 1 ] . ProcessName == "Browser" ) ;
234+ }
235+
236+ [ TestMethod ]
237+ public void TestJankFrameTrace ( )
238+ {
239+ LoadTrace ( @"..\..\..\..\TestData\Perfetto\jankFrame.pftrace" ) ;
240+
241+ var frameEvents = RuntimeExecutionResults . QueryOutput < ProcessedEventData < PerfettoFrameEvent > > (
242+ new DataOutputPath ( PerfettoPluginConstants . FrameEventCookerPath , nameof ( PerfettoFrameEventCooker . FrameEvents ) ) ) ;
243+
244+ Assert . IsTrue ( frameEvents . Count == 4827 ) ;
245+ Assert . IsTrue ( frameEvents [ 0 ] . ProcessName == "com.android.systemui" ) ;
246+ Assert . IsTrue ( frameEvents [ 1 ] . StartTimestamp . ToNanoseconds == 16666666 ) ;
247+ Assert . IsTrue ( frameEvents [ 3007 ] . FrameType == "Actual" ) ;
248+ Assert . IsTrue ( frameEvents [ 3007 ] . JankTag == "Self Jank" ) ;
249+ Assert . IsTrue ( frameEvents [ 3007 ] . DisplayToken == 20016 ) ;
250+ Assert . IsTrue ( frameEvents [ 3926 ] . GpuComposition == "0" ) ;
251+ Assert . IsTrue ( frameEvents [ 3926 ] . PresentType == "Late Present" ) ;
252+ Assert . IsTrue ( frameEvents [ 3926 ] . DisplayToken == 21423 ) ;
253+ Assert . IsTrue ( frameEvents [ 3926 ] . PredictionType == "Valid Prediction" ) ;
254+ Assert . IsTrue ( frameEvents [ 3926 ] . JankType == "SurfaceFlinger CPU Deadline Missed, App Deadline Missed, Buffer Stuffing" ) ;
255+ Assert . IsTrue ( frameEvents [ 3926 ] . AppOnTime == "0" ) ;
231256 }
232257 }
233258}
0 commit comments