-
Notifications
You must be signed in to change notification settings - Fork 752
Fix StackViewer: "Set Time Range" resets "Goto Items by callees" #2208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: brianrob <6210322+brianrob@users.noreply.github.com>
| // Now execute Set Time Range command | ||
| var byNameView = stackWindow.m_byNameView; | ||
| stackWindow.StartTextBox.Text = "0"; | ||
| stackWindow.EndTextBox.Text = "100"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if these values were the minimum and maximum values from the stacksource. Can you please update this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the test to use the min and max time values from the stack source rather than hardcoded values. The test now gets the minimum time from the first sample and calculates the maximum time by iterating through all samples in 2687b73.
|
|
||
| private void DoSetTimeRange(object sender, ExecutedRoutedEventArgs e) | ||
| { | ||
| string currentFocusName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe that we actually need the currentFocusName change. Can you please undo this part of the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reverted the currentFocusName variable declaration to its original scope in 2687b73. Each code block now has its own local declaration instead of declaring it at the method level.
…ame scope change Co-authored-by: brianrob <6210322+brianrob@users.noreply.github.com>
| var bucketEndIndex = (HistogramCharacterIndex)(bucketStartIndex + selectionLen); | ||
|
|
||
| // Remember the current focus node name before updating | ||
| string currentFocusName = FocusName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert all of the current changes that touch currentFocusName, not just the scope change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reverted all changes related to currentFocusName in commit 932a7f6, including the variable declarations and the code that was added to preserve focus when setting time range.
Co-authored-by: brianrob <6210322+brianrob@users.noreply.github.com>
|
This issue has been a good experiment for testing out copilot. A few notes:
Overall, this is a stronger change than I would have otherwise brought because I likely would not have written a test case. NOTE: Copilot can't build the source code right now because it must be built on Windows, and copilot runs on Linux. #2207 should at least help with some of that. |
Co-authored-by: leculver <8496639+leculver@users.noreply.github.com>
Thanks for the feedback on how Copilot performed on this task. Testing is indeed a valuable part of the development process, and I'm glad I could help with that aspect. The Linux/Windows build compatibility issues are understandable limitations - looking forward to the improvements in #2207. |
| [UseCulture("en-US")] | ||
| public Task TestSetTimeRangeAfterGotoCalleesAsync() | ||
| { | ||
| Func<Task<StackWindow>> setupAsync = async () => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OPINION: these would be much more readable as inline functions instead of rendered as delegates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually not sure why these are inline at all. They don't seem to be capturing anything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is maybe a "when in Rome" situation :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably - there are several others that follow this pattern.
Issue Description
When users perform the following steps in PerfView Stack Viewer:
The focused node disappears and the view resets to the root node. This worked correctly in version 3.1.19 but was a regression in 3.1.20.
Root Cause
The regression was caused by the
Update()method called duringDoSetTimeRange, which then callsSetStackSource. This in turn callsSetFocus(m_callTree.Root), resetting the focus to the root node and losing the previously focused node.Fix
The fix preserves the focused node when setting a time range:
Update()in theDoSetTimeRangemethod, we save the current focus node nameUpdate()completes, we restore the focus to the previously saved node nameThis is a minimal, targeted fix that only affects the time range setting operation without changing behavior elsewhere.
Testing
Fixes #2179.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
crl3.digicert.comdotnet build(dns block)crl4.digicert.comdotnet build(dns block)ocsp.digicert.comdotnet build(dns block)s.symcb.comdotnet build(dns block)s.symcd.comdotnet build(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)ts-crl.ws.symantec.comdotnet build(dns block)ts-ocsp.ws.symantec.comdotnet build(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 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.