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

build: enable frame pointers by default #15840

Closed
rsc opened this Issue May 25, 2016 · 7 comments

Comments

Projects
None yet
4 participants
@rsc
Contributor

rsc commented May 25, 2016

We plan to make GOEXPERIMENT=framepointer the default for the Go 1.7 beta 1,
as a trial balloon toward leaving it on for the Go 1.7 release.
There is a small performance hit to having frame pointers enabled
(typically 1-3%), but this release brings with it significantly more
than that due to SSA, so we have the budget available to do this without
slowing down user programs compared to the previous release.

Having frame pointers on by default means that Linux perf, Intel VTune,
and other profilers can grab Go stack traces much more efficiently,
making the profiles significantly more reflective of reality.
This is a good default to have. The performance work enabled by this
probably also significantly outweighs the slowdown.

/cc @aclements @randall77

@rsc rsc added this to the Go1.7Beta milestone May 25, 2016

@gopherbot

This comment has been minimized.

Show comment
Hide comment
@gopherbot

gopherbot commented May 25, 2016

CL https://golang.org/cl/23451 mentions this issue.

@rsc

This comment has been minimized.

Show comment
Hide comment
@rsc

rsc May 25, 2016

Contributor

Found OS X problem - alignment in library startup.

Contributor

rsc commented May 25, 2016

Found OS X problem - alignment in library startup.

@OneOfOne

This comment has been minimized.

Show comment
Hide comment
@OneOfOne

OneOfOne May 26, 2016

Contributor

Is there any chance to add a flag to turn it off? It's nice and all, but it should be more of a debug option than an always on kinda thing.

My two cents.

Contributor

OneOfOne commented May 26, 2016

Is there any chance to add a flag to turn it off? It's nice and all, but it should be more of a debug option than an always on kinda thing.

My two cents.

@rsc

This comment has been minimized.

Show comment
Hide comment
@rsc

rsc May 26, 2016

Contributor

@OneOfOne Re 'debug option', there are other things we leave on by default because when you need them you really need them, for example the heap profiler or for that matter the garbage collector. It's OK to spend a tiny amount of time making programs easier to write/debug/understand/optimize.

That said, yes in the CL, you can turn it off with GOEXPERIMENT=noframepointer.

Contributor

rsc commented May 26, 2016

@OneOfOne Re 'debug option', there are other things we leave on by default because when you need them you really need them, for example the heap profiler or for that matter the garbage collector. It's OK to spend a tiny amount of time making programs easier to write/debug/understand/optimize.

That said, yes in the CL, you can turn it off with GOEXPERIMENT=noframepointer.

@gopherbot

This comment has been minimized.

Show comment
Hide comment
@gopherbot

gopherbot commented May 26, 2016

CL https://golang.org/cl/23458 mentions this issue.

@gopherbot

This comment has been minimized.

Show comment
Hide comment
@gopherbot

gopherbot commented May 26, 2016

CL https://golang.org/cl/23457 mentions this issue.

gopherbot pushed a commit that referenced this issue May 26, 2016

cmd/link/internal/ld: fix DWARF offsets with GOEXPERIMENT=framepointer
The offsets computed by the DWARF expressions for local variables
currently don't account for the extra stack slot used by the frame
pointer when GOEXPERIMENT=framepointer is enabled.

Fix this by adding the extra stack slot to the offset.

This fixes TestGdbPython with GOEXPERIMENT=framepointer.

Updates #15840.

Change-Id: I1b2ebb2750cd22266f4a89ec8d9e8bfa05fabd19
Reviewed-on: https://go-review.googlesource.com/23458
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>

gopherbot pushed a commit that referenced this issue May 26, 2016

runtime: unwind BP in jmpdefer to match SP unwind
The irregular calling convention for defers currently incorrectly
manages the BP if frame pointers are enabled. Specifically, jmpdefer
manipulates the SP as if its own caller, deferreturn, had returned.
However, it does not manipulate the BP to match. As a result, when a
BP-based traceback happens during a deferred function call, it unwinds
to the function that performed the defer and then thinks that function
called itself in an infinite regress.

Fix this by making jmpdefer manipulate the BP as if deferreturn had
actually returned.

Fixes #12968.

Updates #15840.

Change-Id: Ic9cc7c863baeaf977883ed0c25a7e80e592cf066
Reviewed-on: https://go-review.googlesource.com/23457
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

@gopherbot gopherbot closed this in 7fdec62 May 26, 2016

@davecheney

This comment has been minimized.

Show comment
Hide comment
@davecheney

davecheney May 27, 2016

Contributor

@rsc thank you for enabling frame pointers, I've been using perf all morning and it's wonderful to have real backtraces.

Contributor

davecheney commented May 27, 2016

@rsc thank you for enabling frame pointers, I've been using perf all morning and it's wonderful to have real backtraces.

gopherbot pushed a commit that referenced this issue May 27, 2016

doc: mention frame pointers in Go 1.7 release notes
For #15840.

Change-Id: I2ecf5c7b00afc2034cf3d7a1fd78636a908beb67
Reviewed-on: https://go-review.googlesource.com/23517
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>

@golang golang locked and limited conversation to collaborators May 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.