Skip to content
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
Closed

build: enable frame pointers by default #15840

rsc opened this issue May 25, 2016 · 7 comments

Comments

@rsc
Copy link
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
Copy link

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

@rsc
Copy link
Contributor Author

rsc commented May 25, 2016

Found OS X problem - alignment in library startup.

@OneOfOne
Copy link
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.

@rsc
Copy link
Contributor Author

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
Copy link

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

@gopherbot
Copy link

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

gopherbot pushed a commit that referenced this issue May 26, 2016
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
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>
@davecheney
Copy link
Contributor

@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
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.
Projects
None yet
Development

No branches or pull requests

4 participants