Skip to content

Commit 4d5791c

Browse files
committed
runtime: improve "P has cached GC work" debug info
For #27993. Change-Id: I20127e8a9844c2c488f38e1ab1f8f5a27a5df03e Reviewed-on: https://go-review.googlesource.com/c/149968 Run-TryBot: Austin Clements <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent c648485 commit 4d5791c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/runtime/mgc.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,6 +1934,19 @@ func gcMark(start_time int64) {
19341934

19351935
gcw := &p.gcw
19361936
if !gcw.empty() {
1937+
printlock()
1938+
print("runtime: P ", p.id, " flushedWork ", gcw.flushedWork)
1939+
if gcw.wbuf1 == nil {
1940+
print(" wbuf1=<nil>")
1941+
} else {
1942+
print(" wbuf1.n=", gcw.wbuf1.nobj)
1943+
}
1944+
if gcw.wbuf2 == nil {
1945+
print(" wbuf2=<nil>")
1946+
} else {
1947+
print(" wbuf2.n=", gcw.wbuf2.nobj)
1948+
}
1949+
print("\n")
19371950
throw("P has cached GC work at end of mark termination")
19381951
}
19391952
// There may still be cached empty buffers, which we

0 commit comments

Comments
 (0)