pprof CPU profiles missing inlined frames

Skip to first unread message

Prashant V

Feb 16, 2024, 1:18:07 AMFeb 16
to golang-nuts
Is it expected that CPU profiles taken with pprof don't include inlined frames?

With a simple repro, when the `double` function has `go:noinline`, then the pprof shows the double function as expected,

     3.34s 67.07% 67.07%      4.98s   100%  main.main
     1.64s 32.93%   100%      1.64s 32.93%  main.double

However, when the noinline directive is removed, the double function isn't shown, only the main function is:

     4.99s   100%   100%      4.99s   100%  main.main

Is this an expected limitation of pprof profiles, or this a bug that I should report?


Keith Randall

Feb 17, 2024, 12:27:03 PMFeb 17
to golang-nuts
This is a problem with your test. pprof is correct here. Since you never use n, when double is inlined its body is compiled completely away.

Prashant V

Feb 18, 2024, 2:26:19 AMFeb 18
to golang-nuts
Ahh, I simplified the test too much, my mistake.

I modified the example and verified that the profile does capture the inline function:

     3.95s 79.16% 79.16%      3.95s 79.16%  main.modify (inline)
     1.04s 20.84%   100%      4.99s   100%  main.main

Thank you


Feb 22, 2024, 11:55:36 PMFeb 22
to Prashant V, golang-nuts

You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit
Reply all
Reply to author
0 new messages