-
Notifications
You must be signed in to change notification settings - Fork 617
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
Add -tagroot and -tagleaf options #649
Conversation
4c12914
to
941c168
Compare
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.
This looks very nice, thanks for adding this! Except the comment on formatting / scaling the numeric tag values this review is a bunch of style comments.
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.
All are nits except a question about handling NumLabel in the root tag loop.
af32cf2
to
2c8a6db
Compare
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.
Apologies about more comments, I should have tried to identify all these things earlier. I think this is very close though.
@mhansen looks like there are test failures. |
737947a
to
8a70904
Compare
Sorry about all the re-pushing and reapprovals necessary. I think I needed to upgrade my go version to get gofmt to work the same as CI. |
Codecov Report
@@ Coverage Diff @@
## master #649 +/- ##
==========================================
+ Coverage 67.89% 68.19% +0.29%
==========================================
Files 40 41 +1
Lines 7313 7388 +75
==========================================
+ Hits 4965 5038 +73
- Misses 1908 1909 +1
- Partials 440 441 +1
Continue to review full report at Codecov.
|
Looks like the CI tests fail on Go tip. We should probably fix this before we can submit this. |
Filed #653. |
I've been playing around with this a little, and I'm not so sure any more about prefixing with This isn't a showstopper, I just think it might be suboptimal, there might be a better solution hiding, and maybe we should discuss options. Let's generate some options:
Thoughts? (there's probably other options!) I think I'm leaning towards "Only show the label value" and perhaps "Add two frames, one for key, one for value" |
(why is there no way to reply to a comment in GitHub that is not a code review comment?..)
I need to sit on this a bit longer but my initial reaction is that I don't like two frame approach for how weirdly it will interplay with the filtering - e.g. |
If it would work, I might suggest storing tag value as the "function name" and the tag key as the "filename". For the flame graph, it should be be roughly equivalent visually "only show the label value", but the function name should still show up in the tooltip and be considered when filtering. |
I think it's a great idea to explore! |
b108d93
to
e97c361
Compare
I think this is a great idea! I've implemented it, and I like it. It looks great in our internal pprof flamegraph viewer (e.g. http://go/pprof-649) where the tooltip shows the filename. FYI, in the pprof web flamegraph the tooltip doesn't show the filename (yet): I think I still like this approach the best, using the filename, and perhaps we should file a separate issue to show the filename in the tooltip in the web UI's flamegraph. |
I should add, thank you for your ideas! This is a fun collaboration for me :-), I'm enjoying the brainstorming |
In my latest commit, I've changed the test strings to be https://github.com/brendangregg/FlameGraph "Folded Stack" format, which I'm fairly used to and I think demonstrates the empty stack frames (with semicolon-delimited frames) better than spaces. And I've gotten rid of the two layers of interning. You were right Alexey, I should have done this a while ago when you suggested it. |
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 think this looks good. A few bikeshedding comments but LGTM otherwise - I think it's ready to be merged.
These add synthetic stack frames to samples. Example usage: $ pprof -tagroot thread pprof.proto Will add synthetic stack frames at the root like "UIThread" and "BackgroundPool-1". The filename of the added frames will be the label key. Closes google#558
These add synthetic stack frames to samples.
Example usage:
Will add synthetic stack frames at the root like
thread:UIThread
andthread:BackgroundPool-1
.Closes #558