Add Exception Stacks view when viewing a .nettrace with exceptions#2223
Merged
Add Exception Stacks view when viewing a .nettrace with exceptions#2223
Conversation
Co-authored-by: brianrob <6210322+brianrob@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Exception Stacks view when viewing a .nettrace with exceptions
Add Exception Stacks view when viewing a .nettrace with exceptions
Jun 6, 2025
brianrob
reviewed
Jun 6, 2025
src/PerfView/PerfViewData.cs
Outdated
|
|
||
| var stackSource = new MutableTraceEventStackSource(eventLog); | ||
| // EventPipe currently only has managed code stacks. | ||
| stackSource.OnlyManagedCodeStacks = true; |
Member
There was a problem hiding this comment.
Suggested change
| stackSource.OnlyManagedCodeStacks = true; | |
| stackSource.OnlyManagedCodeStacks = !hasUniversalSystem; |
Contributor
Author
There was a problem hiding this comment.
Updated the setting to use !hasUniversalSystem to include native stacks when available, matching the ETL implementation behavior. Change implemented in commit 33fe190.
…salSystem Co-authored-by: brianrob <6210322+brianrob@users.noreply.github.com>
brianrob
reviewed
Jun 6, 2025
src/PerfView/PerfViewData.cs
Outdated
|
|
||
| var stackSource = new MutableTraceEventStackSource(eventLog); | ||
| // EventPipe currently only has managed code stacks. | ||
| stackSource.OnlyManagedCodeStacks = !hasUniversalSystem; |
Member
There was a problem hiding this comment.
Suggested change
| stackSource.OnlyManagedCodeStacks = !hasUniversalSystem; | |
| stackSource.OnlyManagedCodeStacks = !m_supportsProcesses; |
Contributor
Author
There was a problem hiding this comment.
Updated to use !m_supportsProcesses which provides a more comprehensive check that includes both system and CPU events, better aligning with the logic for determining stack information availability. Change implemented in commit 2604ed6.
…sUniversalSystem Co-authored-by: brianrob <6210322+brianrob@users.noreply.github.com>
Member
|
Copilot Post-Mortem:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When collecting a trace using
dotnet-trace collect, the generated .nettrace file contains call stacks for any exceptions thrown. Previously, while users could see exception events in the Events view and find associated stacks in the Any Stacks view by time filtering, there was no dedicated Exception Stacks view like the one available for .etl files.This PR adds Exception Stacks view support for .nettrace files by porting the logic from the ETL implementation to the EventPipe implementation.
Changes Made
EventPipePerfViewData.OpenImpl()to set thehasExceptionsflagEventPipePerfViewData.OpenStackSourceImpl()that:MutableTraceEventStackSourcewith managed-only stacksExceptionStartevents"Throw(ExceptionType) ExceptionMessage"Implementation Details
The implementation follows the exact same pattern as the existing ETL exception handling to ensure consistency:
Users will now see the "Exceptions" stack source in the Advanced Group when opening .nettrace files that contain exception events, providing the same exception analysis capabilities available for .etl files.
Fixes #1797.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.