-
Notifications
You must be signed in to change notification settings - Fork 12
add TaskBlock events for blocking intervals #570
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
Open
kaahos
wants to merge
41
commits into
main
Choose a base branch
from
paul.fournillon/wallclock-taskblock
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
1045a85
feat: wall-clock precheck and signal suppression
kaahos aed7b1a
Merge branch 'main' into paul.fournillon/wallclock-suppression
kaahos 7a250b6
fix
kaahos 6028fdd
Merge branch 'main' into paul.fournillon/wallclock-suppression
kaahos 1e1bcd1
fix: fix build + tests
kaahos b1cb73f
fix: fix mem leaks in tests
kaahos a3a9462
fix: track wall precheck block state in thread filter
kaahos 137065c
fix: arm wall precheck after recording sample
kaahos c7caa46
fix: include wait states in wall precheck suppression
kaahos 55073d0
Fix ProfiledThread ownership in park_state_ut
kaahos 619449a
Add Java block-state bridge for wall-clock precheck
kaahos 1cd0f8b
Fix wall-clock thread filter reset
kaahos 3ee7f42
Gate wall-clock precheck on untraced context
kaahos 6bda356
Merge branch 'main' into paul.fournillon/wallclock-suppression
kaahos 8bb1fed
fix: avoid exact suppression for unowned blocked states
kaahos f82fe70
Merge branch 'main' into paul.fournillon/wallclock-suppression
kaahos 6ece88d
fix: address ownership correctness review
kaahos 110abaa
fix: address thread filter review
kaahos e9f53b9
fix: factorize code and add support for jvmti
kaahos e2d60da
fix: fix wall-clock counters and misleading comment
kaahos 5ab946c
Merge branch 'main' into paul.fournillon/wallclock-suppression
kaahos 37df0a5
fix: apply review about test and unused stuff
kaahos 43471ee
fix: apply review about drainSuppressedSampledRun
kaahos a764667
fix: clean up branch based on PR review recommendations
kaahos 0940fbe
fix: remove TaskBlock snapshot mechanism
kaahos dc3fdb8
chore: isolate TaskBlock recording infrastructure
kaahos d032564
chore: group park and monitor TaskBlock producers
kaahos 3163a96
chore: split out native socket interposition
kaahos 1f3627e
fix: address JFR recording review
kaahos 3d7ab5e
fix: address TaskBlock recorder review
kaahos c451125
fix: FLAG_PARKED was published before context
kaahos d2b453e
fix: address merge regressions
kaahos 5b3e863
fix: fix wallprecheck anchoring and delegated sample recording
kaahos b07a466
fix: fix TaskBlock monitor ownership and counters
kaahos bddb37c
fix: fix native socket hook correctness
kaahos 9eaecdc
fix: fix blocked-run ownership and exit races and add TaskBlockQueue …
kaahos 05d8933
fix: refresh native socket fd type after dup2 and dup3
kaahos fc0a61a
fix: document native patcher and call trace concurrency invariants
kaahos 64bec6a
fix: make TaskBlock events carry direct stack references
kaahos 673289b
fix: test TaskBlock stack reference capture
kaahos c278669
test: assert TaskBlock events are self-contained in JFR tests
kaahos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,11 +57,13 @@ class ExecutionEvent : public Event { | |
| OSThreadState _thread_state; | ||
| ExecutionMode _execution_mode; | ||
| u64 _weight; | ||
| u32 _call_trace_id; | ||
| u64 _call_trace_id; | ||
| u64 _correlation_id; | ||
| u64 _sample_id; | ||
|
|
||
| ExecutionEvent() | ||
| : Event(), _thread_state(OSThreadState::RUNNABLE), _execution_mode(ExecutionMode::UNKNOWN), | ||
| _weight(1), _call_trace_id(0) {} | ||
| _weight(1), _call_trace_id(0), _correlation_id(0), _sample_id(0) {} | ||
| }; | ||
|
|
||
| class AllocEvent : public Event { | ||
|
|
@@ -122,12 +124,18 @@ class WallClockEpochEvent { | |
| u32 _num_failed_samples; | ||
| u32 _num_exited_threads; | ||
| u32 _num_permission_denied; | ||
| u64 _num_suppressed_sampled_run; | ||
| u64 _num_task_block_emitted; | ||
| u64 _num_task_block_skipped_trace_context; | ||
| u64 _num_task_block_skipped_too_short; | ||
|
|
||
|
Comment on lines
+127
to
131
Collaborator
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. Clarification - are these counters supposed to be used to drive the data reconstruction from the samples? Or they are just counters? |
||
| WallClockEpochEvent(u64 start_time) | ||
| : _dirty(false), _start_time(start_time), _duration_millis(0), | ||
| _num_samplable_threads(0), _num_successful_samples(0), | ||
| _num_failed_samples(0), _num_exited_threads(0), | ||
| _num_permission_denied(0) {} | ||
| _num_permission_denied(0), _num_suppressed_sampled_run(0), | ||
| _num_task_block_emitted(0), _num_task_block_skipped_trace_context(0), | ||
| _num_task_block_skipped_too_short(0) {} | ||
|
|
||
| bool hasChanged() { return _dirty; } | ||
|
|
||
|
|
@@ -166,13 +174,45 @@ class WallClockEpochEvent { | |
| } | ||
| } | ||
|
|
||
| void addNumSuppressedSampledRun(u64 n) { | ||
| if (n > 0) { | ||
| _dirty = true; | ||
| _num_suppressed_sampled_run += n; | ||
| } | ||
| } | ||
|
|
||
| void addNumTaskBlockEmitted(u64 n) { | ||
| if (n > 0) { | ||
| _dirty = true; | ||
| _num_task_block_emitted += n; | ||
| } | ||
| } | ||
|
|
||
| void addNumTaskBlockSkippedTraceContext(u64 n) { | ||
| if (n > 0) { | ||
| _dirty = true; | ||
| _num_task_block_skipped_trace_context += n; | ||
| } | ||
| } | ||
|
|
||
| void addNumTaskBlockSkippedTooShort(u64 n) { | ||
| if (n > 0) { | ||
| _dirty = true; | ||
| _num_task_block_skipped_too_short += n; | ||
| } | ||
| } | ||
|
|
||
| void endEpoch(u64 millis) { _duration_millis = millis; } | ||
|
|
||
| void clean() { _dirty = false; } | ||
|
|
||
| void newEpoch(u64 start_time) { | ||
| _dirty = false; | ||
| _start_time = start_time; | ||
| _num_suppressed_sampled_run = 0; | ||
| _num_task_block_emitted = 0; | ||
| _num_task_block_skipped_trace_context = 0; | ||
| _num_task_block_skipped_too_short = 0; | ||
| } | ||
| }; | ||
|
|
||
|
|
@@ -197,4 +237,15 @@ typedef struct QueueTimeEvent { | |
| u32 _queueLength; | ||
| } QueueTimeEvent; | ||
|
|
||
| typedef struct TaskBlockEvent { | ||
| u64 _start; | ||
| u64 _end; | ||
| u64 _blocker; | ||
| u64 _unblockingSpanId; | ||
| Context _ctx; | ||
| u64 _callTraceId; | ||
| u64 _correlationId; | ||
| OSThreadState _observedBlockingState; | ||
| } TaskBlockEvent; | ||
|
|
||
| #endif // _EVENT_H | ||
Oops, something went wrong.
Oops, something went wrong.
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.
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.
I don't think this is necessary. The
TaskBlockEventdescribes time range on a particular thread so we don't need to connect it with an arbitrary sample.It should also capture the stacktrace (it does not, ATM) so it is fully self-contained.