Skip to content
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

Make '-noinlines' a separate flag, introduce '-filefunctions' granularity #420

Merged
merged 1 commit into from
Sep 21, 2018

Conversation

aalexand
Copy link
Collaborator

This change consists of two relatively independent parts, but they are
both about handling the granularity, so bundling them together.

First, in #415 there is a discussion that having a granularity mode by
source lines but with inlines hidden would be useful. The agreement is
also that adding -linenoinlines granularity would make the granularity
flags too messy (and they are already somewhat messy with -addresses
and -addressnoinlines. So, it was proposed to make -noinlines a
separate flag, which is what this change does. Note that the flag is now
pulled out of the granularity group so it's a bit of backward
incompatible change but I think it is acceptable. For the example in
issue #415 the user would now be able to specify -list foo -noinlines
to produce annotated source where the metrics from the inlined functions
are attributed to the calling inliner line.

With this change, I am also dropping the -addressnoinlines granularity
which is now supported as -addresses -noinlines combination. I
couldn't find any usage of this option at least internally at Google, so
I think it's safe to remove it.

Second, I am adding a separate -filefunctions granularity which groups
the data by both function and file. This is a follow-up to #110 from the
past where we changed the -functions granularity to not group by file
(it used to), and since then there was a couple of reports where using
just function name alone would over-aggregate the data in cases when a
function with the same name is contained in multiple source files (e.g.
see b/18874275 internally).

Also, make a number of assorted documentation and -help fixes.

rauls5382
rauls5382 previously approved these changes Sep 20, 2018
Copy link
Contributor

@rauls5382 rauls5382 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

nolanmar511
nolanmar511 previously approved these changes Sep 20, 2018
@codecov-io
Copy link

Codecov Report

Merging #420 into master will increase coverage by 0.02%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #420      +/-   ##
==========================================
+ Coverage   67.59%   67.61%   +0.02%     
==========================================
  Files          36       36              
  Lines        7612     7611       -1     
==========================================
+ Hits         5145     5146       +1     
+ Misses       2062     2060       -2     
  Partials      405      405
Impacted Files Coverage Δ
internal/driver/commands.go 44% <ø> (ø) ⬆️
internal/driver/driver.go 69.88% <93.33%> (+0.95%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e027b50...1aa4a2b. Read the comment docs.

doc/README.md Outdated
describe the same function will be merged into a report entry.
* **-addresses:** Accumulate samples at the instruction address; profile locations
that describe the same function address will be merged into a report entry.
* **-flat** [default], **-cum** Sort entries based on their flat or cumulative
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need ':' before ' Sort'

internal/driver/driver.go Show resolved Hide resolved
…rity.

This change consists of two relatively independent parts, but they are
both about handling the granularity, so bundling them together.

First, in google#415 there is a discussion that having a granularity mode by
source lines but with inlines hidden would be useful. The agreement is
also that adding `-linenoinlines` granularity would make the granularity
flags too messy (and they are already somewhat messy with `-addresses`
and `-addressnoinlines`. So, it was proposed to make `-noinlines` a
separate flag, which is what this change does. Note that the flag is now
pulled out of the granularity group so it's a bit of backward
incompatible change but I think it is acceptable. For the example in
issue google#415 the user would now be able to specify `-list foo -noinlines`
to produce annotated source where the metrics from the inlined functions
are attributed to the calling inliner line.

With this change, I am also dropping the `-addressnoinlines` granularity
which is now supported as `-addresses -noinlines` combination. I
couldn't find any usage of this option at least internally at Google, so
I think it's safe to remove it.

Second, I am adding a separate `-filefunctions` granularity which groups
the data by both function and file. This is a follow-up to google#110 from the
past where we changed the `-functions` granularity to not group by file
(it used to), and since then there was a couple of reports where using
just function name alone would over-aggregate the data in cases when a
function with the same name is contained in multiple source files (e.g.
see b/18874275 internally).

Also, make a number of assorted documentation and `-help` fixes.
@aalexand
Copy link
Collaborator Author

@nolanmar511 @rauls5382 Could you re-approve the most recent changes please?

@aalexand aalexand merged commit 7dadf64 into google:master Sep 21, 2018
@ardan-bkennedy
Copy link

What version will this change in be @aalexand

@ardan-bkennedy
Copy link

The default on the console is -noinlines, I need the opposite, I want the list command to use inlining.

@aalexand
Copy link
Collaborator Author

aalexand commented Jan 8, 2019

What version will this change in be @aalexand

Do you mean which Go version? I am not 100% sure about that, Go team would know. @hyangah do you know if 1.12 is going to have this change in?

The default on the console is -noinlines, I need the opposite, I want the list command to use inlining.

Is that with pprof from master branch of this repo?

@ardan-bkennedy
Copy link

ardan-bkennedy commented Jan 8, 2019

Inside pprof I need to be able to say

list algOne -inlines

The default is to use -noinlines.

It hurts to have to use weblist to see the inline view.

@hyangah
Copy link
Contributor

hyangah commented Jan 8, 2019

@aalexand Vendored version in 1.12 is fde099a, so includes 7dadf64

(while we are here - if there is any important fix to be cherry picked for 1.12, please file an issue)

@ardan-bkennedy
Copy link

I had this issue and it was closed?

#415

Do I need to create a new one from this?

@aalexand
Copy link
Collaborator Author

aalexand commented Jan 8, 2019

@ardan-bkennedy Do you use pprof from the master branch? The list command should have -inlines as the default, see

// Do not force 'noinlines' to be false so that specifying
.

@ardan-bkennedy
Copy link

Sorry, I didn't try the master branch. If this is the case, then we are good. Thanks for making that change. I can't wait for it to land.

gmarin13 pushed a commit to gmarin13/pprof that referenced this pull request Dec 17, 2020
…rity. (google#420)

This change consists of two relatively independent parts, but they are
both about handling the granularity, so bundling them together.

First, in google#415 there is a discussion that having a granularity mode by
source lines but with inlines hidden would be useful. The agreement is
also that adding `-linenoinlines` granularity would make the granularity
flags too messy (and they are already somewhat messy with `-addresses`
and `-addressnoinlines`. So, it was proposed to make `-noinlines` a
separate flag, which is what this change does. Note that the flag is now
pulled out of the granularity group so it's a bit of backward
incompatible change but I think it is acceptable. For the example in
issue google#415 the user would now be able to specify `-list foo -noinlines`
to produce annotated source where the metrics from the inlined functions
are attributed to the calling inliner line.

With this change, I am also dropping the `-addressnoinlines` granularity
which is now supported as `-addresses -noinlines` combination. I
couldn't find any usage of this option at least internally at Google, so
I think it's safe to remove it.

Second, I am adding a separate `-filefunctions` granularity which groups
the data by both function and file. This is a follow-up to google#110 from the
past where we changed the `-functions` granularity to not group by file
(it used to), and since then there was a couple of reports where using
just function name alone would over-aggregate the data in cases when a
function with the same name is contained in multiple source files (e.g.
see b/18874275 internally).

Also, make a number of assorted documentation and `-help` fixes.
@aalexand aalexand deleted the noinlines branch January 11, 2023 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants