unwinder/native: Per code region unwinder selection #2419
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this commit we either used frame pointers or DWARF-derived unwind
information to unwind a process. We first attempt to unwind using frame
pointers and if it looks like it worked (we can't be sure about this,
see comments for more details) we aggregate the sample, otherwise we ask
userspace to write unwind information, if present. We have to exceptions
for this case, we never generated unwind info for v8-based apps 0 nor
for Go-based apps [1].
This commit enables per code region switching of unwinders, what this
means in practice is that it will allow us to unwind Go or V8
applications, that should have frame pointers in the majority of their
code using the FP unwinder, but switch to the DWARF-derived unwinder for
part of the code that do not have them, such as for native libraries
written in C or C++ that were compiled without them. Our agent is a good
example of this as we rely on CGO with a bunch of libraries that can be
compiled without FPs.
Additionally, this work also adds support for unwinding interpreters
whose native code sections contain FPs.
Test Plan
Tested on the Agent, CI is clean,
Signed-off-by: Francisco Javier Honduvilla Coto javierhonduco@gmail.com