feat: Adopt ThreadLocal for storing ProfiledThread#626
Conversation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ofiler into zgu/objmonitor_deflation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ofiler into zgu/objmonitor_deflation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ofiler into zgu/objmonitor_deflation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ofiler into zgu/objmonitor_deflation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
CI Test ResultsRun: #28622973063 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Failed Testsmusl-amd64/debug / 21-librcaJob: View logs No detailed failure information available. Check the job logs. musl-aarch64/debug / 11-librcaJob: View logs No detailed failure information available. Check the job logs. musl-amd64/debug / 17-librcaJob: View logs No detailed failure information available. Check the job logs. musl-aarch64/debug / 8-librcaJob: View logs No detailed failure information available. Check the job logs. musl-aarch64/debug / 21-librcaJob: View logs No detailed failure information available. Check the job logs. musl-amd64/debug / 25-librcaJob: View logs No detailed failure information available. Check the job logs. musl-amd64/debug / 8-librcaJob: View logs No detailed failure information available. Check the job logs. musl-aarch64/debug / 25-librcaJob: View logs No detailed failure information available. Check the job logs. musl-amd64/debug / 11-librcaJob: View logs No detailed failure information available. Check the job logs. musl-aarch64/debug / 17-librcaJob: View logs No detailed failure information available. Check the job logs. glibc-amd64/debug / 11Job: View logs No detailed failure information available. Check the job logs. glibc-amd64/debug / 11-j9Job: View logs No detailed failure information available. Check the job logs. glibc-amd64/debug / 8-j9Job: View logs No detailed failure information available. Check the job logs. glibc-amd64/debug / 21-graalJob: View logs No detailed failure information available. Check the job logs. glibc-amd64/debug / 25-graalJob: View logs No detailed failure information available. Check the job logs. glibc-amd64/debug / 25Job: View logs No detailed failure information available. Check the job logs. glibc-amd64/debug / 17Job: View logs No detailed failure information available. Check the job logs. glibc-amd64/debug / 8-orclJob: View logs No detailed failure information available. Check the job logs. glibc-amd64/debug / 17-graalJob: View logs No detailed failure information available. Check the job logs. glibc-amd64/debug / 17-j9Job: View logs No detailed failure information available. Check the job logs. glibc-amd64/debug / 8-ibmJob: View logs No detailed failure information available. Check the job logs. glibc-amd64/debug / 21Job: View logs No detailed failure information available. Check the job logs. Summary: Total: 32 | Passed: 9 | Failed: 23 Updated: 2026-07-02 21:49:30 UTC |
jbachorik
left a comment
There was a problem hiding this comment.
Some low-priority comments and clarification questions
| // If thrd == nullptr, we proceed but with limited handling capability. | ||
| // Only HotspotSupport::checkFault (which has its own sameStack fallback) | ||
| // and the JDK-8313796 workaround can safely handle faults without TLS. | ||
| // Only HotspotSupport::checkFault and the JDK-8313796 workaround can safely |
There was a problem hiding this comment.
Is this still true? HotspotSupport::checkFault just bails out if the profiled-thread is not set up or is not protected. Is this what this comment means?
| return isKeyValid(); | ||
| } else { | ||
| static constexpr int PTHREAD_KEY_2NDLEVEL_SIZE = 32; | ||
| assert(OS::isLinux() && "What else?"); |
| assert(get() != nullptr && "Must be"); | ||
| assert(isKeyValid() && "Must be"); |
There was a problem hiding this comment.
Plz, improve the assert message to be more telling. I assume the assert condition is not printed as the part of the message, is it?
| Log::error("Failed to allocate required resource"); | ||
| return RESOURCE_ERROR; |
There was a problem hiding this comment.
Nit: The indentation is wrong.
Also, would this be unreachable code when built with asserts?
| * profiler signal delivery. If the fix regresses, the JVM will crash with | ||
| * a SIGSEGV or SIGBUS inside MonitorDeflationThread before the test ends. | ||
| */ | ||
| public class MonitorDeflationThreadSafetyTest extends AbstractProfilerTest { |
There was a problem hiding this comment.
Is this reliably reproducing or is it more probabilistic?
What does this PR do?:
Motivation:
Additional Notes:
How to test the change?:
For Datadog employees:
credentials of any kind, I've requested a security review (run the
dd:platform-security-reviewskill, or file a request via the PSEC review form).
bewairealso runs automatically on every PR.Unsure? Have a question? Request a review!