Skip to content

Commit 0c4f181

Browse files
committed
Try to fix Dictionary duplicate key (#4)
1 parent 097b036 commit 0c4f181

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/Ultra.Core/EtwConverterToFirefox.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,13 @@ public FirefoxProfiler.Profile Convert(string traceFilePath, List<int> processId
216216
var allModules = process.LoadedModules.ToList();
217217
foreach (var module in allModules)
218218
{
219+
if (_mapModuleFileIndexToFirefox.ContainsKey(module.ModuleFile.ModuleFileIndex))
220+
{
221+
continue; // Skip in case
222+
}
223+
219224
options.LogStepProgress?.Invoke($"Loading Symbols for Module `{module.Name}`, ImageSize: {ByteSize.FromBytes(module.ModuleFile.ImageSize)}");
220-
225+
221226
var lib = new FirefoxProfiler.Lib
222227
{
223228
Name = module.Name,
@@ -360,7 +365,7 @@ public FirefoxProfiler.Profile Convert(string traceFilePath, List<int> processId
360365
MethodILSize = methodJittingStarted.MethodILSize
361366
};
362367

363-
jitCompilePendingMethodId.Add(methodJittingStarted.MethodID, (jitCompile, evt.TimeStampRelativeMSec));
368+
jitCompilePendingMethodId[methodJittingStarted.MethodID] = (jitCompile, evt.TimeStampRelativeMSec);
364369
}
365370
else if (evt is MethodLoadUnloadTraceDataBase methodLoadUnloadVerbose)
366371
{

0 commit comments

Comments
 (0)