-
Notifications
You must be signed in to change notification settings - Fork 589
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
pprof source and disasm views overcount recursive functions #707
Labels
Comments
Forgot to mention that the graph view looks correct. The disasm view is similarly broken:
|
kvakil
changed the title
pprof source view overcounts recursive functions
pprof source and disasm views overcount recursive functions
Jun 26, 2022
Louis-Ye
added
type: bug
Buganizer type - Bug
Priority: p2
Buganizer priority - P2
labels
Jun 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of pprof are you using?
go tool pprof
with go1.18.3.Full
go env
outputWhat operating system and processor architecture are you using?
Linux, x86-64 Intel.
What did you do?
I opened the attached profile with
go tool pprof -http=: fac.pb.gz
,and navigated to the "Sources" page. Here is the output:
As you can see, it is claimed that
fac
took 6193% of the total time.It is also said that it took 150 seconds, which is wrong since the
program took only a couple of seconds.
The issue also occurs with the command line version, although strangely
the output is better.
What did you expect to see?
cum%
should not be more than100%
.What did you see instead?
cum%
is claimed to be 6193%.Root cause(?)
I believe the root cause is this line of code:
pprof/internal/report/source.go
Line 104 in c488b8f
This is wrong, since the cumulative time spent in the current function
is not
fns.Sum()
if the function calls itself recursively. In thosecases some nodes will be counted multiple times.
Source Code
The text was updated successfully, but these errors were encountered: