diff --git a/ETWAnalyzer/Extractors/CPU/CpuFrequencyExtractor.cs b/ETWAnalyzer/Extractors/CPU/CpuFrequencyExtractor.cs index 52326815..1afda4ff 100644 --- a/ETWAnalyzer/Extractors/CPU/CpuFrequencyExtractor.cs +++ b/ETWAnalyzer/Extractors/CPU/CpuFrequencyExtractor.cs @@ -29,9 +29,17 @@ public override void Extract(ITraceProcessor processor, ETWExtract results) foreach(Microsoft.Windows.EventTracing.Power.IProcessorFrequencyInterval cpu in myCpuFrequencies.Result.Intervals) { - if( cpu.AverageFrequency == null) + try { - Console.WriteLine($"Warning: File {results.SourceETLFileName} contains CPU frequency ETW data, but AverageFrequency is null. This happens when the CaptureState for the Microsoft-Windows-Kernel-Processor-Power provider is missing."); + if (cpu.AverageFrequency == null) + { + Console.WriteLine($"Warning: File {results.SourceETLFileName} contains CPU frequency ETW data, but AverageFrequency is null. This happens when the CaptureState for the Microsoft-Windows-Kernel-Processor-Power provider is missing."); + break; + } + } + catch(ArgumentOutOfRangeException) + { + Console.WriteLine($"Warning: File {results.SourceETLFileName} contains CPU frequency ETW data, but AverageFrequency is not accessible. This happens when the CaptureState for the Microsoft-Windows-Kernel-Processor-Power provider is missing."); break; }