Skip to content
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

Add EventSource event for WaitHandle waits #94737

Merged
merged 36 commits into from
Dec 7, 2023
Merged

Add EventSource event for WaitHandle waits #94737

merged 36 commits into from
Dec 7, 2023

Conversation

verdie-g
Copy link
Contributor

@verdie-g verdie-g commented Nov 14, 2023

Context: #94264

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Nov 14, 2023
@jkotas jkotas requested a review from kouvel November 14, 2023 22:23
@ghost
Copy link

ghost commented Nov 14, 2023

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

Issue Details

Context: #94264

Implementation details that need validation:

  • I've named the event just Wait. MonitorWait doesn't really fit because there name Monitor is not used where the event is emitted. ContentionWait could be confused with Contention.
  • It seems like event versions start at 0 with no suffix in the name. I've started this event at 1 and added a prefix, tell me if I need to change that
  • The start event includes the same properties as ContentionStart: ClrInstanceID, LockID, AssociatedObjectId but no ContentionFlags or LockOwnerThreadID
  • It could be interesting to add a ThreadID property. It would also help to have a IsThreadPoolThread but I don't think there is a concept of thread pool at that level
  • The new event is under the keyword contention (0x400). I think it makes sense to collect it whenever the contention events are collected
  • No changes are required on the Lock class because it doesn't support the wait operation
Author: verdie-g
Assignees: -
Labels:

area-System.Threading, area-VM-coreclr, community-contribution

Milestone: -

src/coreclr/vm/ClrEtwAll.man Outdated Show resolved Hide resolved
src/coreclr/vm/ClrEtwAll.man Outdated Show resolved Hide resolved
src/coreclr/vm/ClrEtwAll.man Outdated Show resolved Hide resolved
src/coreclr/vm/ClrEtwAll.man Show resolved Hide resolved
src/coreclr/vm/ClrEtwAll.man Outdated Show resolved Hide resolved
@verdie-g verdie-g marked this pull request as ready for review November 14, 2023 23:47
src/coreclr/vm/syncblk.cpp Outdated Show resolved Hide resolved
src/coreclr/inc/eventtracebase.h Outdated Show resolved Hide resolved
src/coreclr/vm/ClrEtwAll.man Outdated Show resolved Hide resolved
src/coreclr/vm/ClrEtwAll.man Outdated Show resolved Hide resolved
src/coreclr/vm/ClrEtwAll.man Outdated Show resolved Hide resolved
@verdie-g
Copy link
Contributor Author

It doesn't compile, the FireEtwWaitHandleWaitStart function is not generated. I'll continue tomorrow.

@verdie-g verdie-g marked this pull request as ready for review November 20, 2023 22:06
Copy link
Member

@kouvel kouvel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@verdie-g
Copy link
Contributor Author

verdie-g commented Dec 7, 2023

Thanks for all the help @kouvel! What should I do about the failed action?

@kouvel
Copy link
Member

kouvel commented Dec 7, 2023

The console log for the failure is almost empty, not sure what might have happened. Previous failures of the test didn't look similar. It seems to have passed on rerun.

@kouvel kouvel merged commit 7bbfcc4 into dotnet:main Dec 7, 2023
190 checks passed
brianrob pushed a commit to microsoft/perfview that referenced this pull request Dec 8, 2023
* Add WaitHandleWaitStart to AnyStacks

New event introduced in dotnet/runtime#94737

* Fix compilation

* Reorder generated members

* Address PR comment
verdie-g added a commit to criteo-forks/runtime that referenced this pull request Dec 12, 2023
Add start/stop events for WaitHandle waits

Context: dotnet#94264
@github-actions github-actions bot locked and limited conversation to collaborators Jan 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Threading community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants