Repository navigation
JVMTI based implementation of Wallclock profiler - #126
Merged
Merged
Conversation
Contributor
Contributor
|
🔧 Report generated by pr-comment-scanbuild Scan-Build Report
Bug Summary
Reports
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
jbachorik
force-pushed
the
jb/jvmti_wallclock
branch
from
September 5, 2024 15:10
5f42de7 to
b816a64
Compare
jbachorik
marked this pull request as ready for review
September 5, 2024 15:37
jbachorik
force-pushed
the
jb/jvmti_wallclock
branch
from
September 6, 2024 08:34
27aa7d6 to
096b537
Compare
jbachorik
force-pushed
the
jb/jvmti_wallclock
branch
from
September 12, 2024 15:18
096b537 to
84ea0a7
Compare
richardstartin
approved these changes
Sep 13, 2024
r1viollet
reviewed
Sep 16, 2024
r1viollet
reviewed
Sep 16, 2024
r1viollet
reviewed
Sep 16, 2024
| reservoir.reserve(size); | ||
| } | ||
|
|
||
| std::vector<T>& sample(const std::vector<T> &input) { |
Contributor
There was a problem hiding this comment.
I won't go into the actual algorithm we chose here and whether it was the correct one. Please tell me if I should spend more time here.
Collaborator
Author
There was a problem hiding this comment.
I am quite confident of the algorithm here.
Probably not worth spending a lot of time on it - @richardstartin has a link to an article describing this algorithm, IIRC, if you are interested.
MattAlp
approved these changes
Sep 17, 2024
1 of 3 tasks
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.
What does this PR do?:
Add a new wallclock engine based on JVMTI GetStackTrace function
Motivation:
We have witnessed a few crashes related to interleaved calls to AsyncGetCallTrace. There were certain rail-guards put in place to avoid that but not having to call AsyncGetCallTrace still feels like the safest option.
Since Java 11 the
GetStackTracefunction is using thread-local handshake and is not incurring the cost of safepoint. Therefore it is a quite cheap operation which is completely stable, though with slight safepoint bias.While it is possible to enable this engine also on Java 8, doing so will result in terrible performance.
Additional Notes:
Based on #118 by @richardstartin
How to test the change?:
New unit tests were added
Once you build the library
./gradlew assembleDebugJaryou can enable the new wallclock profiler by running your java application like:java -agentpath:<base>/ddprof-lib/build/lib/main/debug/linux/x64/libjavaProfiler.so=start,cpu,wall,wallsampler=jvmti,jfr,file=/tmp/profile.jfr ...(this is for linux - if you are building and testing on macos, adjust the paths accordingly)
For Datadog employees:
credentials of any kind, I've requested a review from
@DataDog/security-design-and-guidance.Unsure? Have a question? Request a review!