mirror of
https://github.com/golang/go
synced 2024-11-26 11:48:03 -07:00
runtime/trace: enable frame pointer unwinding by default for amd64 and arm64
Re-enable frame pointer unwinding for execution tracing on amd64 by default, now that CL 489015 and CL 488755 have fixed recently-discovered crashes. This reverts CL 486382. These fixes, together with CL 241158 to fix up frame pointers when copying stacks on arm64, also make frame pointer unwinding for tracing safe to enable for arm64. This should significantly reduce the CPU and latency overhead of execution tracing on arm64, as it has for amd64. Co-Authored-By: Felix Geisendörfer <felix.geisendoerfer@datadoghq.com> Change-Id: I64a88bd69dfd8cb13956ec46f8b1203dbeaa26a6 Reviewed-on: https://go-review.googlesource.com/c/go/+/490815 Reviewed-by: Felix Geisendörfer <felix.geisendoerfer@datadoghq.com> Run-TryBot: Nick Ripley <nick.ripley@datadoghq.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
c63066123b
commit
2d83b646d6
@ -369,7 +369,6 @@ func parsedebugvars() {
|
||||
debug.cgocheck = 1
|
||||
debug.invalidptr = 1
|
||||
debug.adaptivestackstart = 1 // set this to 0 to turn larger initial goroutine stacks off
|
||||
debug.tracefpunwindoff = 1 // Frame pointer unwinding sometimes crashes on amd64. See issue 59692.
|
||||
if GOOS == "linux" {
|
||||
// On Linux, MADV_FREE is faster than MADV_DONTNEED,
|
||||
// but doesn't affect many of the statistics that
|
||||
|
@ -927,12 +927,10 @@ func traceStackID(mp *m, pcBuf []uintptr, skip int) uint64 {
|
||||
return uint64(id)
|
||||
}
|
||||
|
||||
// tracefpunwindoff returns false if frame pointer unwinding for the tracer is
|
||||
// tracefpunwindoff returns true if frame pointer unwinding for the tracer is
|
||||
// disabled via GODEBUG or not supported by the architecture.
|
||||
func tracefpunwindoff() bool {
|
||||
// compiler emits frame pointers for amd64 and arm64, but issue 58432 blocks
|
||||
// arm64 support for now.
|
||||
return debug.tracefpunwindoff != 0 || goarch.ArchFamily != goarch.AMD64
|
||||
return debug.tracefpunwindoff != 0 || (goarch.ArchFamily != goarch.AMD64 && goarch.ArchFamily != goarch.ARM64)
|
||||
}
|
||||
|
||||
// fpTracebackPCs populates pcBuf with the return addresses for each frame and
|
||||
|
Loading…
Reference in New Issue
Block a user