Refactor dispatch.{c,h}#932
Merged
morrisonlevi merged 4 commits intomasterfrom Jun 24, 2020
Merged
Conversation
This saves 8 bytes per dispatch on a 64 bit arch.
Also refactor some of the functions in dispatch.{c,h}
SammyK
approved these changes
Jun 24, 2020
Contributor
SammyK
left a comment
There was a problem hiding this comment.
Looks great @morrisonlevi! I just left one question, but 👍.
| src/ext/configuration_php_iface.c \ | ||
| src/ext/ddtrace_string.c \ | ||
| src/ext/dispatch.c \ | ||
| src/ext/dispatch_setup.c \ |
| retval = &rv; | ||
| } | ||
| _dd_end_span(span, retval); | ||
| ddtrace_posthook(NULL, span, retval); |
Contributor
There was a problem hiding this comment.
We should have access to the fbc from the execute_data here (and in the other return handlers). Or is there a reason we need to keep it NULL?
Collaborator
Author
There was a problem hiding this comment.
It's because we don't need to check for a span stack mismatch because of the way the handlers works -- if there was a mismatch we wouldn't even be running the posthook in these handlers. This is the only thing the FBC is used for.
Contributor
There was a problem hiding this comment.
Good point. Just FYI, that assumption will likely change in #931.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Ahead of some work on the non-instrumentation API, I discovered some cruft in the dispatch process. This PR:
dispatch_setup.cintodispatch.cddtrace_prehookandddtrace_posthookDD_PRINTFusageOverall it deletes more code than it adds, which I am happy about. There shouldn't be any behavior changes, and don't expect it to substantially affect overhead. It will lower the amount of memory used, however, I expect the non-instrumentation API to increase it more than this reduces it.
There is more work to do, but it was getting large enough that I figured it was time for code review.
Readiness checklist
Tests added for this feature/bug.Reviewer checklist