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.
On Thursday, February 15, 2024 at 10:18:07 PM UTC-8 Prashant V wrote: > Is it expected that CPU profiles taken with pprof don't include inlined > frames? > > With a simple repro <https://go.dev/play/p/6-JjlhAT14z>, 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? > > Thanks > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/3239bdd0-05c0-4538-a955-ff33e18c9659n%40googlegroups.com.