Skip to content

Commit

Permalink
Workaround fix for issue 91. For long running sessions where the firs…
Browse files Browse the repository at this point in the history
…t information is missing this API will throw.
  • Loading branch information
AloisKraus committed Sep 9, 2024
1 parent 21ed660 commit 98a5f80
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ETWAnalyzer/Extractors/CPU/CpuFrequencyExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 98a5f80

Please sign in to comment.