Update dynamic logging to work with Go's 1.17+ calling convention #2108
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.
Summary: Update dynamic logging to work with Go's 1.17+ calling convention
Despite our earlier messaging that dynamic logging would be deprecated in #2105, I decided that it was easier to handle the new ABI instead of deprecating the Go parts of the dynamic tracer. My rationale for this is that the blocker for achieving feature parity for the new Go ABI, handling
STRUCT_BLOB
variables, is actually a concern for c/c++ tracepoint programs as well. I felt it was important to keep the dynamic tracer rather than deprecate it entirely.As mentioned above, this change does not have full feature parity with the legacy ABI since
STRUCT_BLOB
variables don't work with register based calling conventions -- these variables copy a blob of memory with the assumption that a packed struct exists in a contiguous chunk of memory. However, this isn't unique to Go binaries as c/c++ applications can pass certain structs via registers as well.This change replaces the previous Go
STRUCT_BLOB
tests with C equivalents that pass the variable on the stack. When a struct variable will be passed via a register, dynamic logging will now return an error and suggest to the user to access struct fields individually. This error and the test cases that assert the error is returned can be reverted to their original form once #2106 is complete.Relevant Issues: #2105
Type of change: /kind cleanup
Test Plan: Existing tests pass and new ones were added where coverage was needed
Changelog Message: Update Go dynamic logging feature to support Go 1.17+ binaries