Fix profiler sometimes not adding the "In native code" placeholder #2594
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.
What does this PR do?:
In #2583 we added a very small check to our custom
ddtrace_rb_profile_frames
to match a similar fix added to upstream Ruby.But I've just spotted this caused one of the profiling tests to become flaky:
This issue was caused by the
cfp == NULL
check being added before theend_cfp == NULL
check we have to detect when we should add the "In native code" placeholder.In some cases,
cfp
is set and the placeholder is added, but in others, it's not.To fix this, I've swapped the order of the checks, so that the check to introduce the placeholder gets higher priority.
Motivation:
Fix bug (that also causes flaky tests).
Additional Notes:
(N/A)
How to test the change?:
Validate that running profiling test suite works with for instance seed 14154.