add TaskBlock events for blocking intervals#570
Conversation
This comment has been minimized.
This comment has been minimized.
CI Test ResultsRun: #26892091993 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 32 | Failed: 0 Updated: 2026-06-03 15:09:38 UTC |
bcf3c2b to
a46d368
Compare
3f2f71a to
d1e3210
Compare
|
@copilot review this PR |
Reviewed and found a flaky assertion in |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d21e4936d2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (recorded && slot_to_arm != nullptr) { | ||
| slot_to_arm->markSampledThisRun(state_to_arm, event._sample_id); |
There was a problem hiding this comment.
Populate ASGCT wall sample IDs before anchoring
When wallprecheck is used with the default ASGCT wall-clock engine, recordSample() returns without ever assigning ExecutionEvent::_sample_id (unlike the JVMTI/deferred/external paths), so this line records 0 as the anchor for the blocked run. The resulting TaskBlock.anchorSampleId cannot point back to the MethodSample that was kept for the run, breaking the reconstruction metadata for the common wall=...,wallprecheck=true configuration.
Useful? React with 👍 / 👎.
2101007 to
a94677a
Compare
a94677a to
681582c
Compare
What does this PR do?:
Adds
datadog.TaskBlockJFR events for blocking intervals such asLockSupport.park,Object.wait, monitor contention, including recording APIs used bydd-trace-javafor instrumented blocking operations such asThread.sleep.Motivation:
This builds on
paul.fournillon/wallclock-suppression(#560) by preserving visibility into blocked spans as explicit duration events.Additional Notes:
This PR does not add the dd-trace-java instrumentation itself;
Thread.sleepemission depends on that side calling the new profiler APIs. Monitor callback support is HotSpot-specific, and virtual-thread carrier attribution is avoided.How to test the change?:
./.claude/commands/build-and-summarize :ddprof-test:testDebug -Ptests="*.wallclock.*TaskBlockTest"./.claude/commands/build-and-summarize :ddprof-lib:gtestDebugFor Datadog employees:
credentials of any kind, I've requested a review from
@DataDog/security-design-and-guidance.Unsure? Have a question? Request a review!