diff --git a/pkg/proc/amd64_arch.go b/pkg/proc/amd64_arch.go index dc426ac3d8..ad7fe7dca5 100644 --- a/pkg/proc/amd64_arch.go +++ b/pkg/proc/amd64_arch.go @@ -200,11 +200,19 @@ func amd64SwitchStack(it *stackIterator, _ *op.DwarfRegisters) bool { return true - case "runtime.goexit", "runtime.rt0_go", "runtime.mcall": + case "runtime.goexit", "runtime.rt0_go": // Look for "top of stack" functions. it.atend = true return true + case "runtime.mcall": + if it.systemstack && it.g != nil && it.bi.GOOS == "freebsd" { + it.switchToGoroutineStack() + return true + } + it.atend = true + return true + case "runtime.mstart": // Calls to runtime.systemstack will switch to the systemstack then: // 1. alter the goroutine stack so that it looks like systemstack_switch