Fix remapping arrays and improve test coverage #704
Closed
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.
This is a rather large work to reimplement the indy linking to avoid deadlocks between tracing and linking.
Unfortunately, this involves some hackery - we need to instrument
java.lang.invoke.MethodHandleNatives
and track the start and end of the linking process. The reason is that we need to hook-in deeply into the JDK linking process, otherwise we are not able to prevent BTrace probes firing while in the indy linking.That particular instrumentation will increment thread-local value of a linking flag when the linking starts and decrement once the linking is finished. Then, the injected code needs to be adjusted such that the BTrace action invocation is guarded by a check for the linking flag, skipping the action if the linking is in progress.
Once all of this is in place, it is possible to drastically reduce the exclusion filter for 'sensitive' classes, leaving just a bunch of classes that are crucial to BTrace. Here is the minimal list of excluded classes, still allowing full functionality of BTrace
While working on this change, the instrumentor tests were converted to parametric tests and using golden files.