Skip to content

Commit c1a67c9

Browse files
Copilotmdh1418
andcommitted
Use ThreadTimeStackComputer in dotnet-trace convert and report commands
Update dotnet-trace convert and report to use ThreadTimeStackComputer instead of SampleProfilerThreadTimeComputer to handle thread time samples in NetTrace v6 format from collect-linux. Also update System.Text.Json, System.Collections.Immutable, System.Reflection.Metadata, and System.Text.Encodings.Web to 9.0.8 to satisfy TraceEvent 3.1.28 dependencies. Co-authored-by: mdh1418 <[email protected]>
1 parent f505e7d commit c1a67c9

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

eng/Versions.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
<!-- Uncomment this line to use the custom version of roslyn as needed. -->
2525
<!-- <UsingToolMicrosoftNetCompilers Condition="'$(DotNetBuildSourceOnly)' != 'true'">true</UsingToolMicrosoftNetCompilers> -->
2626
<!-- CoreFX -->
27-
<SystemReflectionMetadataVersion>8.0.0</SystemReflectionMetadataVersion>
28-
<SystemCollectionsImmutableVersion>8.0.0</SystemCollectionsImmutableVersion>
27+
<SystemReflectionMetadataVersion>9.0.8</SystemReflectionMetadataVersion>
28+
<SystemCollectionsImmutableVersion>9.0.8</SystemCollectionsImmutableVersion>
2929
<!-- Other libs -->
3030
<MicrosoftBclAsyncInterfacesVersion>9.0.8</MicrosoftBclAsyncInterfacesVersion>
3131
<MicrosoftDiaSymReaderNativeVersion>17.10.0-beta1.24272.1</MicrosoftDiaSymReaderNativeVersion>
@@ -44,8 +44,8 @@
4444
<SystemMemoryVersion>4.5.5</SystemMemoryVersion>
4545
<SystemRuntimeLoaderVersion>4.3.0</SystemRuntimeLoaderVersion>
4646
<SystemThreadingTasksExtensionsVersion>4.5.4</SystemThreadingTasksExtensionsVersion>
47-
<SystemTextEncodingsWebVersion>8.0.0</SystemTextEncodingsWebVersion>
48-
<SystemTextJsonVersion>8.0.5</SystemTextJsonVersion>
47+
<SystemTextEncodingsWebVersion>9.0.8</SystemTextEncodingsWebVersion>
48+
<SystemTextJsonVersion>9.0.8</SystemTextJsonVersion>
4949
<XUnitAbstractionsVersion>2.0.3</XUnitAbstractionsVersion>
5050
<StyleCopAnalyzersVersion>1.2.0-beta.556</StyleCopAnalyzersVersion>
5151
<cdbsosversion>10.0.26100.1</cdbsosversion>

src/Tools/dotnet-trace/CommandLine/Commands/ReportCommand.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ private static int TopNReport(string traceFile, int number, bool inclusive, bool
5353
OnlyManagedCodeStacks = true
5454
};
5555

56-
SampleProfilerThreadTimeComputer computer = new(eventLog, symbolReader);
56+
#pragma warning disable CS0618 // Type is marked as obsolete but is still the recommended approach
57+
ThreadTimeStackComputer computer = new(eventLog, symbolReader);
5758

5859
computer.GenerateThreadTimeStacks(stackSource);
60+
#pragma warning restore CS0618
5961

6062
FilterParams filterParams = new()
6163
{

src/Tools/dotnet-trace/TraceFileFormatConverter.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ private static void Convert(TraceFileFormat format, string fileToConvert, string
7878
OnlyManagedCodeStacks = true // EventPipe currently only has managed code stacks.
7979
};
8080

81-
SampleProfilerThreadTimeComputer computer = new(eventLog, symbolReader)
81+
#pragma warning disable CS0618 // Type is marked as obsolete but is still the recommended approach
82+
ThreadTimeStackComputer computer = new(eventLog, symbolReader)
8283
{
8384
IncludeEventSourceEvents = false // SpeedScope handles only CPU samples, events are not supported
8485
};
8586
computer.GenerateThreadTimeStacks(stackSource);
87+
#pragma warning restore CS0618
8688

8789
switch (format)
8890
{

0 commit comments

Comments
 (0)