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

cmd/compile: add epilogue_begin to DWARF line info #69329

Open
ajwerner opened this issue Sep 6, 2024 · 3 comments
Open

cmd/compile: add epilogue_begin to DWARF line info #69329

ajwerner opened this issue Sep 6, 2024 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FeatureRequest help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@ajwerner
Copy link

ajwerner commented Sep 6, 2024

Go does not currently (as of go1.23) emit epilogue_begin markers around where functions return. It does emit prologue_end.

The motivation here is that go is not friendly to things like ebpf return probes (uretprobe) because they inject a call frame into the stack (see iovisor/bcc#1320).

What folks do instead is simulate these return probes by finding all of the returns sites by parsing the text of the program (see iovisor/bcc#1320 (comment)). A more general approach that doesn't require access to the binary would be to store the relevant information in the line info.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Sep 6, 2024
@timothy-king timothy-king added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 9, 2024
@timothy-king timothy-king added this to the Backlog milestone Sep 9, 2024
@timothy-king timothy-king changed the title cmd/compile,dwarf: add epilogue_begin to line info cmd/compile: add epilogue_begin to DWARF line info Sep 9, 2024
@timothy-king
Copy link
Contributor

CC @golang/compiler

@AlexanderYastrebov
Copy link
Contributor

go is not friendly to things like ebpf return probes (uretprobe)

See #22008

@ajwerner
Copy link
Author

Thanks for the cross-reference! To clarify, this issue would help not in that it would make uretprobes work, but that it makes them easier to simulate with uprobes because it'll make it easier to find the return points using debug information rather than having to parse the program text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FeatureRequest help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Development

No branches or pull requests

5 participants