Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Merge System.Diagnostics.Tracing.EventCounter fix to release #24342

Merged
merged 1 commit into from
Oct 4, 2017

Conversation

vancem
Copy link
Contributor

@vancem vancem commented Sep 29, 2017

System.Diagnostics.Tracing.EventCounter relies on a relatively new callback added to System.Diagnostics.Tracing.EventSource. Due to an build configuration problem the code that calls this callback was #ifdefed out in the .NET Core 2.0 release. This was fixed months ago but the fix has not made it into the release branches.

The result is that EventCounters can't be turned on (that is if you signal to the EventSource that you want EventCounter data, it is ignored). This makes the type useless.

This PR merges the fix from the master branch for this issue. It also fixes a number of races associated with the code that happened to be fixed in the same PR as well as beefed up the testing.

The change is safe because it only affect EventCounter (or its testing), and currently EventCounter is pretty broken .

There were a number of races in EventCounters.  Did an audit and fixed these.
Also prepped to add a  Dispose() method so that you can make counters for transient objects (e.g. files)
Have actually made it public yet, pending API review.
Also turned on and beefed up the testing.  Fixed tests.
@vancem
Copy link
Contributor Author

vancem commented Sep 29, 2017

Fixes issue https://github.com/dotnet/corefx/issues/24273

The original PR is #22422. This just merges it into the release branch.

@analogrelay
Copy link

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants