@@ -108,6 +108,26 @@ public class ExecutionEventTable
108108 new ColumnMetadata ( new Guid ( "{5AB96EE5-FE5C-45AE-9BA2-965EFF4833D8}" ) , "Last Switch-Out Time" ) ,
109109 new UIHints { Width = 80 , } ) ;
110110
111+ private static readonly ColumnConfiguration instructionCountColumn =
112+ new ColumnConfiguration (
113+ new ColumnMetadata ( new Guid ( "{63447522-514D-4F7D-81E0-544E0670BB1D}" ) , "Instruction Count" ) ,
114+ new UIHints { Width = 80 , } ) ;
115+
116+ private static readonly ColumnConfiguration lastLevelCacheMissesColumn =
117+ new ColumnConfiguration (
118+ new ColumnMetadata ( new Guid ( "{7EB3DBFA-B1CA-4CB7-9D70-66E0BEFA0F32}" ) , "LLC Misses" ) ,
119+ new UIHints { Width = 80 , } ) ;
120+
121+ private static readonly ColumnConfiguration cpuCycleColumn =
122+ new ColumnConfiguration (
123+ new ColumnMetadata ( new Guid ( "{AC255EA6-BA80-4A7D-BCF5-710B6B3618A9}" ) , "CPU Cycle" ) ,
124+ new UIHints { Width = 80 , } ) ;
125+
126+ private static readonly ColumnConfiguration cacheMissesColumn =
127+ new ColumnConfiguration (
128+ new ColumnMetadata ( new Guid ( "{6BBB2F84-4215-46CF-9C92-FA79DB8DE55C}" ) , "Cache Misses" ) ,
129+ new UIHints { Width = 80 , } ) ;
130+
111131 private static readonly ColumnConfiguration cpuUsageInViewportPreset = new ColumnConfiguration (
112132 new ColumnMetadata ( new Guid ( "{0cf6ffa6-2f41-4460-a201-718c37cbf413}" ) , "CPU Usage (in view)" ) ,
113133 new UIHints
@@ -271,6 +291,10 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva
271291 table . AddColumn ( switchInTimeColumn , switchInTime ) ;
272292 table . AddColumn ( switchOutTimeColumn , switchOutTime ) ;
273293 table . AddColumn ( previousPidColumn , Projection . CreateUsingFuncAdaptor ( ( i ) => threads [ i ] . PreviousPid ) ) ;
294+ table . AddColumn ( instructionCountColumn , Projection . CreateUsingFuncAdaptor ( ( i ) => GetPerformanceCounterDiff ( threads [ i ] , "_perf_cpu_instructions" ) ) ) ;
295+ table . AddColumn ( lastLevelCacheMissesColumn , Projection . CreateUsingFuncAdaptor ( ( i ) => GetPerformanceCounterDiff ( threads [ i ] , "_perf_cpu_LLC_load_misses" ) ) ) ;
296+ table . AddColumn ( cpuCycleColumn , Projection . CreateUsingFuncAdaptor ( ( i ) => GetPerformanceCounterDiff ( threads [ i ] , "_perf_cpu_cpu_cycles" ) ) ) ;
297+ table . AddColumn ( cacheMissesColumn , Projection . CreateUsingFuncAdaptor ( ( i ) => GetPerformanceCounterDiff ( threads [ i ] , "_perf_cpu_cache_misses" ) ) ) ;
274298 table . AddColumn ( nextCommandColumn , Projection . CreateUsingFuncAdaptor ( ( i ) => threads [ i ] . NextImage ) ) ;
275299 table . AddColumn ( previousCommandColumn , Projection . CreateUsingFuncAdaptor ( ( i ) => threads [ i ] . PreviousImage ) ) ;
276300
@@ -294,6 +318,11 @@ public static void BuildTable(ITableBuilder tableBuilder, IDataExtensionRetrieva
294318 table . AddColumn ( cpuUsagePreset , cpuUsageColumn ) ;
295319 table . AddColumn ( percentCpuUsagePreset , percentCpuUsageColumn ) ;
296320 }
321+
322+ private static long GetPerformanceCounterDiff ( IExecutionEvent executionEvent , string counterName )
323+ {
324+ return executionEvent . PerformanceCountersDiffByName . TryGetValue ( counterName , out long value ) ? value : 0 ;
325+ }
297326 }
298327
299328 struct ReduceTimeSinceLastDiff
0 commit comments