-
Notifications
You must be signed in to change notification settings - Fork 715
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
Flame Graph #502
Flame Graph #502
Conversation
@adamsitnik There is a failure in the debug test run. I looked into it a bit and it seems likely that it is issue #354 causihg the issue. You need to update StackWindows to that the TestIncludeItemOnCallerCalleeTabCallerAsync test has the folloiwng
|
PerfView has a mechanism where all files needed at runtime are emedded into the EXE itself and extracted at first launch. You added a new *.PNG file which needs to be emedded into PerfView.exe. To do this modify src\PerfView\PerfVIew.csproj to add the following lines
at line 417 (after all the other 'EmbeddedResource elements), but within the ItemGroup element. |
📝 I restarted the build, which may pass on second try with no changes. Edit: Yes, it passed. |
src/PerfView/FlameGraph.cs
Outdated
@@ -0,0 +1,160 @@ | |||
using System; |
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 put the FlameGraph.cs file in the 'src\perfView\StackViewer' directory.
It gives you very intelligible overview. | ||
The graph starts at the bottom. Each box represents a method in the stack. Every parent is the caller, children are the callees. | ||
The wider the box, the more time it was on-CPU. The samples count is shown in the tooltip and in the bottom panel. | ||
To change the content of the flame graph you need to apply the filters for call tree view. |
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.
Can you put a hyperlink to some documentation on how to use FlameGraphs that already exists somewhere on the internet?
Codecov Report
@@ Coverage Diff @@
## master #502 +/- ##
==========================================
- Coverage 17.53% 17.41% -0.13%
==========================================
Files 216 217 +1
Lines 123479 123627 +148
Branches 11910 11927 +17
==========================================
- Hits 21658 21530 -128
- Misses 100959 101231 +272
- Partials 862 866 +4
Continue to review full report at Codecov.
|
Please update the perfView version number (in the Directory.Build.Props file (it is in the 'Solution Items' folder in the solution). to be 2.0.1 and then udpate the 'ReleaseNotes' section of the UsersGuid.htm to indicate that flame graphs have been added in this version of PerfView). |
@@ -411,6 +412,8 @@ public void SetStackSource(StackSource newSource, Action onComplete = null) | |||
cumMax / 1000000, controller.GetStartTimeForBucket((HistogramCharacterIndex)cumMaxIdx)); | |||
} | |||
|
|||
RedrawFlameGraph(); |
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 would like this to be lazy. Simply have a bit that marks that the flame graph is invalid at this point. Then have an event when the canvas becomes visible that actually calls the RedrawFlamGraph.
This avoids a bunch of work that may never be used (if users never look at the flamegraph.
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 have left a number of small change requests (the biggest being to delay redrawing the flamegraph until the view is visable). Other than those I am OK with this change.
@vancem Done! Good idea with redrawing the graph only when it is visible. |
Looks good to me |
🎊 Very happy to see this merged! Nowadays I find that flame graphs are more useful than stack trees or other forms of stack visualization in 99% of the cases. Minor nitpick: if we could get rid of the "module" noise so that as much as possible of the actual function name would be shown in the flame rectangles, it would be even more awesome... |
ok. Once you start using it and have some more comments please create a separate issue. I would like to make the Flame Graphs user-friendly. And I did not forget about the colors, I just did not figure this out yet. |
:mips-interest |
This PR is recreated #440
PerfView is very powerful tool, but sometimes for some inexperienced users like me it is hard to get a fast overview of what takes most of the CPU if there are plenty of methods on the stack.
This PR provides a simple implementation of the "Flame Graph".
It is just different visualization of the "call tree" view.
Sample result (for the "tutorial.exe")
Sample result for more complicated app (dotnet cli):