-
Notifications
You must be signed in to change notification settings - Fork 6k
diagnostic: document waithandle keyword #40852
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f131b03
dotnet-trace: document waithandle keyword
verdie-g 14544d7
Document events
verdie-g 30cd953
Fix ClrInstanceID type
verdie-g b760c1d
Update docs/fundamentals/diagnostics/runtime-events.md
BillWagner ef43d93
Apply suggestions from code review
BillWagner 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
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
55 changes: 55 additions & 0 deletions
55
docs/fundamentals/diagnostics/runtime-wait-handle-events.md
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
title: "Wait handle runtime events" | ||
description: See ETW events that collect information specific to the wait handles. | ||
ms.date: "05/27/2024" | ||
helpviewer_keywords: | ||
- "wait handle events (CoreCLR)" | ||
- "ETW, EventPipe, LTTng wait handle events (CoreCLR)" | ||
--- | ||
|
||
# .NET runtime wait handle events | ||
|
||
These runtime events capture information about wait handles. They can be useful to investigate thread pool starvation issues. For more information about how to use these events for diagnostic purposes, see [logging and tracing .NET applications](../../core/diagnostics/logging-tracing.md) | ||
|
||
## WaitHandleWaitStart event | ||
|
||
This event is emitted at the start of a wait operation on a wait handle. Here is a non-exhaustive list of managed method that could emit this event: | ||
|
||
- `Monitor.Wait` | ||
- `Monitor.Enter` or the C# lock keyword | ||
- `ManualResetEvent.WaitOne` | ||
- `Task.Wait` | ||
|
||
|Keyword for raising the event|Level| | ||
|-----------------------------------|-----------| | ||
|`WaitHandleKeyword` (0x40000000000)|Verbose (5)| | ||
|
||
The following table shows event information. | ||
|
||
|Event|Event ID|Raised when| | ||
|-----------|--------------|-----------------| | ||
|`WaitHandleWaitStart`|301|A wait starts.| | ||
|
||
|Field name|Data type|Description| | ||
|----------------|---------------|-----------------| | ||
|`WaitSource`|`win:UInt8`|`0x0` - Other sources.<br /><br /> `0x1` - The wait originated from managed code through the `Monitor.Wait` method.| | ||
|`AssociatedObjectID`|`win:Pointer`|Address of the associated object (e.g. address of `obj` in the code `lock(obj) {}`).| | ||
|`ClrInstanceID`|`win:UInt16`|Unique ID for the instance of CoreCLR.| | ||
|
||
## WaitHandleWaitStop event | ||
|
||
This event is emitted at the end of a wait operation on a wait handle. | ||
|
||
|Keyword for raising the event|Level| | ||
|-----------------------------------|-----------| | ||
|`WaitHandleKeyword` (0x40000000000)|Verbose (5)| | ||
|
||
The following table shows event information. | ||
|
||
|Event|Event ID|Raised when| | ||
|-----------|--------------|-----------------| | ||
|`WaitHandleWaitStop`|302|A wait stops.| | ||
|
||
|Field name|Data type|Description| | ||
|----------------|---------------|-----------------| | ||
|`ClrInstanceID`|`win:UInt16`|Unique ID for the instance of CoreCLR.| |
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.
Uh oh!
There was an error while loading. Please reload this page.