]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/pprof: fix test
authorRuss Cox <rsc@golang.org>
Fri, 17 Oct 2014 15:23:15 +0000 (11:23 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 17 Oct 2014 15:23:15 +0000 (11:23 -0400)
gogo called from GC is okay
for the same reasons that
gogo called from System or ExternalCode is okay.
All three are fake stack traces.

Fixes #8408.

LGTM=dvyukov, r
R=r, dvyukov
CC=golang-codereviews
https://golang.org/cl/152580043

src/runtime/pprof/pprof_test.go

index edd471a0c9843b2ff132c2b65aa15a89a6df5b5d..8677cb30c5556ef794e6b64e8358019bb66baf64 100644 (file)
@@ -249,7 +249,7 @@ func TestGoroutineSwitch(t *testing.T) {
                        // exists to record a PC without a traceback. Those are okay.
                        if len(stk) == 2 {
                                f := runtime.FuncForPC(stk[1])
-                               if f != nil && (f.Name() == "System" || f.Name() == "ExternalCode") {
+                               if f != nil && (f.Name() == "System" || f.Name() == "ExternalCode" || f.Name() == "GC") {
                                        return
                                }
                        }