From 8e540d380521237cb3f5c538f2dc035d89933528 Mon Sep 17 00:00:00 2001 From: Alois Kraus Date: Wed, 20 Nov 2024 09:10:38 +0100 Subject: [PATCH] Fix for issue #92. Microsoft.Windows.EventTracing.InvalidTraceDataException: Two info sources disagree on the number of processors. at Microsoft.Windows.EventTracing.Metadata.SystemMetadata.get_Processors() at Microsoft.Windows.EventTracing.Power.ProcessorFrequencyObjectContext.GetAverageFrequency(ProcessorFrequencyIntervalFlyweight flyweight) at Microsoft.Windows.EventTracing.Power.ProcessorFrequencyInterval.get_AverageFrequency() at ETWAnalyzer.Extractors.CPU.CpuFrequencyExtractor.Extract(ITraceProcessor processor, ETWExtract results) in C:\Builds\ETWAnalyzer\ETWAnalyzer\Extractors\CPU\CpuFrequencyExtractor.cs:line 34 --- ETWAnalyzer/ETWAnalyzer.csproj | 2 +- ETWAnalyzer/Extractors/CPU/CpuFrequencyExtractor.cs | 9 ++++++++- ETWAnalyzer/Properties/AssemblyInfo.cs | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ETWAnalyzer/ETWAnalyzer.csproj b/ETWAnalyzer/ETWAnalyzer.csproj index 0840a62..481f6be 100644 --- a/ETWAnalyzer/ETWAnalyzer.csproj +++ b/ETWAnalyzer/ETWAnalyzer.csproj @@ -22,7 +22,7 @@ True https://github.com/Siemens-Healthineers/ETWAnalyzer ProgramaticAccess.md - 3.0.0.10 + 3.0.0.11 x64 true 1 diff --git a/ETWAnalyzer/Extractors/CPU/CpuFrequencyExtractor.cs b/ETWAnalyzer/Extractors/CPU/CpuFrequencyExtractor.cs index 1afda4f..8e10ce2 100644 --- a/ETWAnalyzer/Extractors/CPU/CpuFrequencyExtractor.cs +++ b/ETWAnalyzer/Extractors/CPU/CpuFrequencyExtractor.cs @@ -37,11 +37,18 @@ public override void Extract(ITraceProcessor processor, ETWExtract results) break; } } - catch(ArgumentOutOfRangeException) + 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; } + catch (InvalidTraceDataException ex) + { + string msg = $"File {results.SourceETLFileName} contains CPU frequency ETW data, but AverageFrequency is not accessible, because of a CPU count mismatch: "; + Console.WriteLine("Warning: " + msg + ex.Message); + Logger.Warn(msg + ex); + break; + } if (cpu.AverageFrequency.Value.TotalMegahertz > 0.0m) // sometimes we get 0 readings which are spurious events which are arriving also sometimes even if we did not record Frequency data { diff --git a/ETWAnalyzer/Properties/AssemblyInfo.cs b/ETWAnalyzer/Properties/AssemblyInfo.cs index 9b4c575..4d81531 100644 --- a/ETWAnalyzer/Properties/AssemblyInfo.cs +++ b/ETWAnalyzer/Properties/AssemblyInfo.cs @@ -42,4 +42,4 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("3.0.0.10")] +[assembly: AssemblyFileVersion("3.0.0.11")]