Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 31, 2025

Fixes #5610

Updates TraceEvent package to enable NetTrace v6 format with thread time samples and updates dotnet-trace convert and dotnet-trace report commands to handle .nettrace files generated by dotnet-trace collect-linux.

Changes

  • Updated MicrosoftDiagnosticsTracingTraceEventVersion in eng/Versions.props: 3.1.233.1.28
  • Updated dotnet-trace convert to use ThreadTimeStackComputer instead of SampleProfilerThreadTimeComputer
  • Updated dotnet-trace report to use ThreadTimeStackComputer instead of SampleProfilerThreadTimeComputer
  • Updated dependency versions to satisfy TraceEvent 3.1.28 requirements:
    • System.Text.Json: 8.0.59.0.8
    • System.Collections.Immutable: 8.0.09.0.8
    • System.Reflection.Metadata: 8.0.09.0.8
    • System.Text.Encodings.Web: 8.0.09.0.8

What this enables

NetTrace v6 adds:

  • Thread time samples in multi-process traces (from dotnet-trace collect-linux)
  • Improved metadata and label support (W3C TraceContext correlation)
  • Better compression and memory efficiency
  • Extended payload field types (VarInt, VarUInt, FixedLengthArray, etc.)

The ThreadTimeStackComputer class handles traces with thread time samples that don't have Microsoft-DotNETCore-SampleProfiler events, which is the case for .nettrace files generated by dotnet-trace collect-linux.

Affected components

  • dotnet-trace convert and dotnet-trace report commands (now support collect-linux traces)
  • All EventPipe-based tools: dotnet-counters, dotnet-gcdump, dotnet-stack, dotnet-dsrouter, and EventPipe monitoring libraries

See NetTrace v6 format spec for technical details.

Original prompt

Can you fix #5610. It involves bumping MicrosoftDiagnosticsTracingTraceEventVersion in eng/Versions.props to 3.1.28. The .nettrace generated by collect-linux is NetTrace v6 which is documented here https://github.com/microsoft/perfview/blob/main/src/TraceEvent/EventPipe/NetTraceFormat.md and there aren't any currently in the repository, so I would like to test it locally, or give you a .nettrace that has thread time samples.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Update MicrosoftDiagnosticsTracingTraceEventVersion to 3.1.28 Bump Microsoft.Diagnostics.Tracing.TraceEvent to 3.1.28 for NetTrace v6 support Oct 31, 2025
Copilot finished work on behalf of mdh1418 October 31, 2025 18:18
Copilot AI requested a review from mdh1418 October 31, 2025 18:18
@mdh1418
Copy link
Member

mdh1418 commented Oct 31, 2025

@copilot #5610 requires changes to dotnet-trace convert and dotnet-trace report to use the ThreadTimeStackComputer that was added to Microsoft.Diagnostics.Tracing.TraceEvent.3.1.28.nupkg. The issue describes that .nettraces generated by dotnet-trace collect-linux will not have any samples from Microsoft-DotNETCore-SampleProfiler, which dotnet-trace convert and dotnet-trace report rely on. The goal is to extend dotnet-trace convert and dotnet-trace report to handle the thread time samples in a dotnet-trace collect-linux .nettrace by using the ThreadTimeStackComputer.

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]>
Copy link
Contributor Author

Copilot AI commented Oct 31, 2025

@copilot #5610 requires changes to dotnet-trace convert and dotnet-trace report to use the ThreadTimeStackComputer that was added to Microsoft.Diagnostics.Tracing.TraceEvent.3.1.28.nupkg. The is...

Updated dotnet-trace convert and dotnet-trace report to use ThreadTimeStackComputer instead of SampleProfilerThreadTimeComputer to handle thread time samples from collect-linux .nettrace files.

Also updated dependency versions (System.Text.Json, System.Collections.Immutable, System.Reflection.Metadata, System.Text.Encodings.Web) to 9.0.8 to satisfy TraceEvent 3.1.28 requirements.

Changes in commit c1a67c9.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/dotnet/diagnostics/issues/5610
    • Triggering command: curl -s REDACTED (http block)
  • https://api.github.com/repos/microsoft/perfview/contents/src/TraceEvent/Stacks
    • Triggering command: curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Bump Microsoft.Diagnostics.Tracing.TraceEvent to 3.1.28 for NetTrace v6 support Bump Microsoft.Diagnostics.Tracing.TraceEvent to 3.1.28 and update dotnet-trace for NetTrace v6 support Oct 31, 2025
@mdh1418
Copy link
Member

mdh1418 commented Nov 20, 2025

@copilot Lets hold off on updating the PR for now, and lets just iterate on the files, check the changes without pushing commits. Can we do that?
I have a sample.nettrace that demonstrates the nettrace v6 with dynamic events that I want you to use to validate the fix. How can I get it to you?
The goal is to upgrade dotnet-trace convert and dotnet-trace report to be able to handle the new nettrace format, and be able to use the ThreadTimeStackComputer when appropriate. I dont quite understand why we need to update System.Text.Json, System.Collections.Immutable, System.Reflection.Metadata, and System.Text.Encodings.Web, can you explain how you got those dependency versions from TraceEvent 3.1.28?

@mdh1418 mdh1418 closed this Nov 20, 2025
@mdh1418 mdh1418 deleted the copilot/bump-trace-event-version branch November 20, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dotnet-trace] Convert and Report not compatible with collect-linux traces

2 participants