-
Notifications
You must be signed in to change notification settings - Fork 10
[PROF-12714] Add CriticalNative support #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
4feff30
6cfd40f
19b54db
18c788e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,7 @@ namespace ddprof { | |
| initOffsets(); | ||
| initJvmFunctions(); | ||
| initUnsafeFunctions(); | ||
| initCriticalJNINatives(); | ||
| } | ||
|
|
||
| void VMStructs_::initOffsets() { | ||
|
|
@@ -98,6 +99,16 @@ namespace ddprof { | |
| } | ||
| } | ||
|
|
||
| void VMStructs_::initCriticalJNINatives() { | ||
| #ifdef __aarch64__ | ||
| // aarch64 does not support CriticalJNINatives | ||
| JVMFlag* flag = JVMFlag::find("CriticalJNINatives", {JVMFlag::Type::Bool}); | ||
| if (flag != nullptr && flag->get()) { | ||
| flag->set(0); | ||
| } | ||
| #endif // __aarch64__ | ||
| } | ||
zhengyu123 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
Comment on lines
+102
to
+111
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still think we should have better documentation here of:
"// aarch64 does not support CriticalJNINatives" I'm not sure will be enough for someone 1/2/n years from now to understand why this was added. Bonus points for reflecting this into the method name e.g. |
||
| const void *VMStructs_::findHeapUsageFunc() { | ||
| if (VM::hotspot_version() < 17) { | ||
| // For JDK 11 it is really unreliable to find the memory_usage function - | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Should we maybe declare these as
inlineto softly suggest to the compiler thatJava_com_datadoghq_profiler_JavaProfiler_filterThreadAdd0should inline this, not call into it?(Or does that not work very well anyway?)