Skip to content

Commit

Permalink
Refactor the code to split Etw specificities from EventPipe
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Dec 6, 2024
1 parent b3eb108 commit 8caa4df
Show file tree
Hide file tree
Showing 9 changed files with 468 additions and 371 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Ultra.Core;
/// <summary>
/// Converts an ETW trace file to a Firefox profile.
/// </summary>
public sealed class EtwConverterToFirefox : IDisposable
public sealed class ConverterToFirefox : IDisposable
{
private readonly Dictionary<ModuleFileIndex, int> _mapModuleFileIndexToFirefox;
private readonly HashSet<ModuleFileIndex> _setManagedModules;
Expand All @@ -32,7 +32,7 @@ public sealed class EtwConverterToFirefox : IDisposable
private ModuleFileIndex _clrJitModuleIndex = ModuleFileIndex.Invalid;
private ModuleFileIndex _coreClrModuleIndex = ModuleFileIndex.Invalid;
private int _profileThreadIndex;
private readonly EtwUltraProfilerOptions _options;
private readonly UltraProfilerOptions _options;
private readonly FirefoxProfiler.Profile _profile;

/// <summary>
Expand Down Expand Up @@ -70,7 +70,7 @@ public sealed class EtwConverterToFirefox : IDisposable
/// </summary>
public const int CategoryClr = 6;

private EtwConverterToFirefox(string traceFilePath, EtwUltraProfilerOptions options)
private ConverterToFirefox(string traceFilePath, UltraProfilerOptions options)
{
_etl = new ETWTraceEventSource(traceFilePath);
_traceLog = TraceLog.OpenOrConvert(traceFilePath);
Expand Down Expand Up @@ -110,9 +110,9 @@ public void Dispose()
/// <param name="options">The options used for converting.</param>
/// <param name="processIds">The list of process ids to extract from the ETL file.</param>
/// <returns>The converted Firefox profile.</returns>
public static FirefoxProfiler.Profile Convert(string traceFilePath, EtwUltraProfilerOptions options, List<int> processIds)
public static FirefoxProfiler.Profile Convert(string traceFilePath, UltraProfilerOptions options, List<int> processIds)
{
using var converter = new EtwConverterToFirefox(traceFilePath, options);
using var converter = new ConverterToFirefox(traceFilePath, options);
return converter.Convert(processIds);
}

Expand Down
301 changes: 0 additions & 301 deletions src/Ultra.Core/EtwUltraProfilerWindows.cs

This file was deleted.

Loading

0 comments on commit 8caa4df

Please sign in to comment.