-
Notifications
You must be signed in to change notification settings - Fork 17.6k
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
runtime: cpu profile is not useful due to systemstack #10609
Labels
Milestone
Comments
/cc @rsc @randall77 @RLH @aclements |
I'm thinking that it would be generally good to combine the stack traces on either side of a systemstack call (not just for profiles). Maybe with a ----- mark as we used to have between stack segments. |
yeah, that will be very helpful.
|
CL https://golang.org/cl/9506 mentions this issue. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When profiling my program with pprof, I see that 80% of time is spent in runtime.memclr called from runtime._System. This is not useful. I have to attach gdb and sample stacks to figure out that the guilty call stack is:
#0 runtime.memclr () at src/runtime/memclr_amd64.s:13
#1 0x0000000000425b2a in runtime.heapBits.initSpan (h=..., size=131072, n=1, total=131072) at src/runtime/mbitmap.go:284
#2 0x0000000000423d27 in runtime.largeAlloc (size=124063, flag=1, ~r2=0x7f6e0004c7d8) at src/runtime/malloc.go:715
#3 0x000000000045faba in runtime.mallocgc.func3 () at src/runtime/malloc.go:631
#4 0x000000000046aa59 in runtime.systemstack () at src/runtime/asm_amd64.s:262
#5 0x0000000000441a10 in runtime.starttheworld () at src/runtime/proc1.go:643
But it is still unclear who is calling mallocgc.
Similar situation is possible for e.g. defers, for which one won't even get a hint from heap profile.
Cpu profiler should unwind through systemstack.
The text was updated successfully, but these errors were encountered: