From 0c4f1819442fc79ee1a0cd70c4c7c0191c9510d3 Mon Sep 17 00:00:00 2001 From: Alexandre Mutel Date: Mon, 18 Nov 2024 17:28:06 +0100 Subject: [PATCH] Try to fix Dictionary duplicate key (#4) --- src/Ultra.Core/EtwConverterToFirefox.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Ultra.Core/EtwConverterToFirefox.cs b/src/Ultra.Core/EtwConverterToFirefox.cs index 2e21757..aed8842 100644 --- a/src/Ultra.Core/EtwConverterToFirefox.cs +++ b/src/Ultra.Core/EtwConverterToFirefox.cs @@ -216,8 +216,13 @@ public FirefoxProfiler.Profile Convert(string traceFilePath, List processId var allModules = process.LoadedModules.ToList(); foreach (var module in allModules) { + if (_mapModuleFileIndexToFirefox.ContainsKey(module.ModuleFile.ModuleFileIndex)) + { + continue; // Skip in case + } + options.LogStepProgress?.Invoke($"Loading Symbols for Module `{module.Name}`, ImageSize: {ByteSize.FromBytes(module.ModuleFile.ImageSize)}"); - + var lib = new FirefoxProfiler.Lib { Name = module.Name, @@ -360,7 +365,7 @@ public FirefoxProfiler.Profile Convert(string traceFilePath, List processId MethodILSize = methodJittingStarted.MethodILSize }; - jitCompilePendingMethodId.Add(methodJittingStarted.MethodID, (jitCompile, evt.TimeStampRelativeMSec)); + jitCompilePendingMethodId[methodJittingStarted.MethodID] = (jitCompile, evt.TimeStampRelativeMSec); } else if (evt is MethodLoadUnloadTraceDataBase methodLoadUnloadVerbose) {