Skip to content

Migrate runtime.Callers/2 #107

Closed
Closed

Description

@djui

Given Slide 25 from talk: Mid-stack inlining in the Go compiler (external) it seems like errors.callers should migrate.

Basically: "Avoid FuncForPC, use CallersFrames".

Activity

  1. alfred-landrum commented on Mar 8, 2017

    @alfred-landrum

    Here's a related golang issue, including the documentation change that recommends using CallersFrames:
    golang/go#19426

    Here's a closed experimental PR that uses CallersFrames, ignoring backwards compatibility, but passing for 1.7 and tip:
    #108

  2. davecheney commented on Mar 8, 2017

    @davecheney
    Member
  3. ChrisHines commented on Jun 15, 2017

    @ChrisHines
    Contributor

    We are exploring a similar migration over at go-stack/stack#13. Important links for reference:

  4. davecheney commented on Jun 15, 2017

    @davecheney
    Member

    Is there anything to do here, the method is depreciated, but it won't be going away any time soon.

  5. ChrisHines commented on Jun 17, 2017

    @ChrisHines
    Contributor

    It will probably be worth doing something for Go 1.9. From the draft release notes:

    Tracebacks generated by the runtime and recorded in profiles are now accurate in the presence of inlining. To retrieve tracebacks programmatically, applications should use runtime.CallersFrames rather than directly iterating over the results of runtime.Callers.

    Switching to runtime.CallersFrames will become critical once Go has mid-stack inlining, which seems likely in one of the next few releases. The proposal has been accepted.

  6. davecheney commented on Jun 17, 2017

    @davecheney
    Member
  7. agnivade commented on Aug 2, 2017

    @agnivade

    Hi everyone,

    Just saw the 1.9 release notes and thought to check on this library (I use it regularly and its awesome).
    Mid-stack inlining has landed in 1.9. https://tip.golang.org/doc/go1.9#callersframes.

    I believe this would be a good time to make the shift to runtime.CallersFrames.

  8. alfred-landrum commented on Aug 14, 2017

    @alfred-landrum

    @davecheney - given the above rationale, would you be ready to consider a more polished version of my early PR, #108 ?

  9. added a commit that references this issue on Jan 5, 2019
    d71697b
  10. added a commit that references this issue on Jan 5, 2019
    4f47277
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions