Skip to content

Fix broken stacks warning for universal traces#2268

Merged
brianrob merged 4 commits intomainfrom
copilot/fix-2266
Jul 29, 2025
Merged

Fix broken stacks warning for universal traces#2268
brianrob merged 4 commits intomainfrom
copilot/fix-2266

Conversation

Copy link
Contributor

Copilot AI commented Jul 23, 2025

When opening a universal trace in PerfView and viewing CPU stacks, PerfView incorrectly shows a warning about "100% broken stacks" even when the stacks are not actually broken. This happens because the broken stack detection logic was designed specifically for ETW traces but was being applied to all trace types.

Broken Stacks Warning

Root Cause

The WarnAboutBrokenStacks method in PerfViewStackSource was running broken stack analysis on all trace types, but the logic for detecting broken stacks is only applicable to traces that originate from ETW.

Solution

Modified the WarnAboutBrokenStacks method to only perform broken stack analysis for ETW-based traces (ETLPerfViewData):

  1. Added a type check to verify if DataFile is an instance of ETLPerfViewData
  2. If not ETW-based, logs "Skipping broken stack analysis for non-ETW trace." and returns early
  3. Preserves existing broken stack analysis logic for ETW traces where it's actually applicable

Impact

  • Universal traces: No longer show false "100% broken stacks" warnings ✅
  • EventPipe traces: Also benefit from not showing inappropriate warnings ✅
  • Linux traces: Also benefit from not showing inappropriate warnings ✅
  • ETW traces: Continue to show broken stack warnings when appropriate ✅
  • Debugging: Added informative log message when analysis is skipped

Testing

Verified the type checking logic works correctly for different trace types:

  • ETLPerfViewData (ETW traces) → runs broken stack analysis
  • EventPipePerfViewData (universal traces) → skips broken stack analysis
  • LinuxPerfViewData (Linux traces) → skips broken stack analysis

Fixes #2266.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits July 23, 2025 00:37
…e is ETW-based

Co-authored-by: brianrob <6210322+brianrob@users.noreply.github.com>
Co-authored-by: brianrob <6210322+brianrob@users.noreply.github.com>
Copilot AI changed the title [WIP] CPU stacks shows 100% broken stacks for universal traces Fix broken stacks warning for universal traces Jul 23, 2025
Copilot AI requested a review from brianrob July 23, 2025 00:40
@brianrob
Copy link
Member

Copilot Post-Mortem:

  • This one was pretty simple. A good example of the kinds of changes that copilot can knock out easily.

@brianrob brianrob marked this pull request as ready for review July 29, 2025 17:59
@brianrob brianrob merged commit 4284608 into main Jul 29, 2025
5 checks passed
@brianrob brianrob deleted the copilot/fix-2266 branch July 29, 2025 18:37
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.

CPU stacks shows 100% broken stacks for universal traces

3 participants