@@ -51,7 +51,19 @@ public class PerfettoCpuSchedTable
5151 new UIHints { Width = 70 } ) ;
5252
5353 private static readonly ColumnConfiguration PriorityColumn = new ColumnConfiguration (
54- new ColumnMetadata ( new Guid ( "{73984a25-99b1-43a9-8412-c57b55de5518}" ) , "Priority" , "Priority of the event" ) ,
54+ new ColumnMetadata ( new Guid ( "{73984a25-99b1-43a9-8412-c57b55de5518}" ) , "Priority" , "Priority of the thread" ) ,
55+ new UIHints { Width = 70 } ) ;
56+
57+ private static readonly ColumnConfiguration PreviousCpuColumn = new ColumnConfiguration (
58+ new ColumnMetadata ( new Guid ( "{6F23E91A-299E-48E5-9F48-485144D9A50B}" ) , "PreviousCpu" , "CPU where the thread ran at previous scheduling event" ) ,
59+ new UIHints { Width = 70 , SortOrder = SortOrder . Ascending } ) ;
60+
61+ private static readonly ColumnConfiguration PreviousEndStateColumn = new ColumnConfiguration (
62+ new ColumnMetadata ( new Guid ( "{FB21B315-8AF9-475E-8792-7835B21AB193}" ) , "PreviousEndState" , "Ending state of the previous scheduling event of this thread" ) ,
63+ new UIHints { Width = 70 } ) ;
64+
65+ private static readonly ColumnConfiguration PreviousPriorityColumn = new ColumnConfiguration (
66+ new ColumnMetadata ( new Guid ( "{0B2806ED-14EE-4753-A31E-D408CEA95E1A}" ) , "PreviousPriority" , "Priority of the thread at previous scheduling event of this thread" ) ,
5567 new UIHints { Width = 70 } ) ;
5668
5769 private static readonly ColumnConfiguration WakeEventFoundColumn = new ColumnConfiguration (
@@ -78,6 +90,10 @@ public class PerfettoCpuSchedTable
7890 new ColumnMetadata ( new Guid ( "{51D27617-7734-42A8-921C-E83A585F77E0}" ) , "WakeTimestamp" , "Timestamp when thread was woken" ) ,
7991 new UIHints { Width = 70 } ) ;
8092
93+ private static readonly ColumnConfiguration WaitDurationColumn = new ColumnConfiguration (
94+ new ColumnMetadata ( new Guid ( "{F0B3CD76-0FB7-45C6-9791-DEDB351CFF11}" ) , "WaitDuration" , "Duration between previous slice end timestamp and woken timestamp" ) ,
95+ new UIHints { Width = 70 } ) ;
96+
8197 private static readonly ColumnConfiguration SchedulingLatencyColumn = new ColumnConfiguration (
8298 new ColumnMetadata ( new Guid ( "{8315395D-8738-4E1B-9F89-9E4EE239FD72}" ) , "SchedulingLatency" , "Duration between woken timestamp and schedule timestamp" ) ,
8399 new UIHints { Width = 70 } ) ;
@@ -124,9 +140,13 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva
124140 tableGenerator . AddColumn ( WakerThreadNameColumn , baseProjection . Compose ( x => x . WakeEvent ? . WakerThreadName ?? String . Empty ) ) ;
125141 tableGenerator . AddColumn ( WakerTidColumn , baseProjection . Compose ( x => x . WakeEvent ? . WakerTid ?? - 1 ) ) ;
126142 tableGenerator . AddColumn ( WakerPriorityColumn , baseProjection . Compose ( x => x . WakeEvent ? . Priority ?? - 1 ) ) ;
127- tableGenerator . AddColumn ( WakerCpuColumn , baseProjection . Compose ( x => x . WakeEvent != null ? ( int ) x . WakeEvent . Value . Cpu : - 1 ) ) ;
143+ tableGenerator . AddColumn ( WakerCpuColumn , baseProjection . Compose ( x => x . WakeEvent != null ? ( int ) x . WakeEvent . Cpu : - 1 ) ) ;
128144 tableGenerator . AddColumn ( WakeTimestampColumn , baseProjection . Compose ( x => x . WakeEvent ? . Timestamp ?? Timestamp . MinValue ) ) ;
129- tableGenerator . AddColumn ( SchedulingLatencyColumn , baseProjection . Compose ( x => x . StartTimestamp - ( x . WakeEvent ? . Timestamp ?? x . StartTimestamp ) ) ) ;
145+ tableGenerator . AddColumn ( SchedulingLatencyColumn , baseProjection . Compose ( x => x . SchedulingLatency ) ) ;
146+ tableGenerator . AddColumn ( WaitDurationColumn , baseProjection . Compose ( x => x . WaitDuration ) ) ;
147+ tableGenerator . AddColumn ( PreviousEndStateColumn , baseProjection . Compose ( x => x . PreviousSchedulingEvent ? . EndState ?? String . Empty ) ) ;
148+ tableGenerator . AddColumn ( PreviousPriorityColumn , baseProjection . Compose ( x => x . PreviousSchedulingEvent ? . Priority ?? - 1 ) ) ;
149+ tableGenerator . AddColumn ( PreviousCpuColumn , baseProjection . Compose ( x => x . PreviousSchedulingEvent != null ? ( int ) x . PreviousSchedulingEvent . Cpu : - 1 ) ) ;
130150
131151 // Create projections that are used for calculating CPU usage%
132152 var startProjectionClippedToViewport = Projection . ClipTimeToViewport . Create ( startProjection ) ;
@@ -161,6 +181,7 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva
161181 WakerTidColumn ,
162182 WakerCpuColumn ,
163183 WakeTimestampColumn ,
184+ WaitDurationColumn ,
164185 SchedulingLatencyColumn ,
165186 TableConfiguration . GraphColumn , // Columns after this get graphed
166187 StartTimestampColumn ,
@@ -177,6 +198,7 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva
177198 {
178199 Columns = new [ ]
179200 {
201+ WakeEventFoundColumn ,
180202 WakerProcessNameColumn ,
181203 WakerThreadNameColumn ,
182204 WakerTidColumn ,
@@ -190,8 +212,11 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva
190212 EndTimestampColumn ,
191213 EndStateColumn ,
192214 PriorityColumn ,
193- WakeEventFoundColumn ,
215+ PreviousEndStateColumn ,
216+ PreviousPriorityColumn ,
217+ PreviousCpuColumn ,
194218 WakerCpuColumn ,
219+ WaitDurationColumn ,
195220 SchedulingLatencyColumn ,
196221 TableConfiguration . GraphColumn , // Columns after this get graphed
197222 WakeTimestampColumn
@@ -223,6 +248,7 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva
223248 WakerTidColumn ,
224249 WakerCpuColumn ,
225250 WakeTimestampColumn ,
251+ WaitDurationColumn ,
226252 SchedulingLatencyColumn ,
227253 TableConfiguration . GraphColumn , // Columns after this get graphed
228254 PercentCpuUsageColumn
0 commit comments