-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/pprof: go1.3 profiles and tip profiles show different information #8942
Labels
Milestone
Comments
Related: the malloc that shows up is all stack-less because it is on the g0 stack. Probably want to charge g0 ticks to the curg if there is one. Something like diff -r 284a98e61e32 src/runtime/proc.c --- a/src/runtime/proc.c Wed Oct 15 19:33:15 2014 -0400 +++ b/src/runtime/proc.c Wed Oct 15 23:13:50 2014 -0400 @@ -2436,7 +2436,7 @@ void runtime·sigprof(uint8 *pc, uint8 *sp, uint8 *lr, G *gp, M *mp) { - int32 n; + int32 n, off; bool traceback; // Do not use global m in this function, use mp instead. // On windows one m is sending reports about all the g's, so m means a wrong thing. @@ -2530,9 +2530,20 @@ ((uint8*)runtime·gogo <= pc && pc < (uint8*)runtime·gogo + RuntimeGogoBytes)) traceback = false; + off = 0; + if(gp == mp->g0 && mp->curg != nil) { + stk[0] = (uintptr)pc; + off = 1; + gp = mp->curg; + pc = (uint8*)gp->sched.pc; + sp = (uint8*)gp->sched.sp; + lr = 0; + traceback = true; + } + n = 0; if(traceback) - n = runtime·gentraceback((uintptr)pc, (uintptr)sp, (uintptr)lr, gp, 0, stk, nelem(stk), nil, nil, false); + n = runtime·gentraceback((uintptr)pc, (uintptr)sp, (uintptr)lr, gp, 0, stk+off, nelem(stk)-off, nil, nil, false); if(!traceback || n <= 0) { // Normal traceback is impossible or has failed. // See if it falls into several common cases. |
There is also related issue https://golang.org/issue/8867 |
CL https://golang.org/cl/159990043 mentions this issue. |
This issue was updated by revision 7ed8723. This does not fully address issue #8942 but it does make the profiles much more useful, until that issue can be fixed completely. LGTM=dvyukov R=r, dvyukov CC=golang-codereviews https://golang.org/cl/159990043 |
This issue was updated by revision 1ba977c. This does not fully address issue #8942 but it does make the profiles much more useful, until that issue can be fixed completely. LGTM=dvyukov R=r, dvyukov CC=golang-codereviews https://golang.org/cl/159990043 »»» TBR=dvyukov CC=golang-codereviews https://golang.org/cl/160030043 |
I was just looking at pprof profiles and it seems okay now. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: