diff options
author | Stephen Toub <stoub@microsoft.com> | 2017-05-16 10:35:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-16 10:35:21 -0400 |
commit | 0e71141cf38dd146c2d34dc53e2b2b66e0bade8a (patch) | |
tree | 1f3334d451cac5f0456024bc0e2a25fd67b0a8a7 | |
parent | 094d8301dc238abe470f67342c8b17217585c798 (diff) | |
parent | c3d04c6c600b064ec23d2d3636d309791979351d (diff) | |
download | coreclr-0e71141cf38dd146c2d34dc53e2b2b66e0bade8a.tar.gz coreclr-0e71141cf38dd146c2d34dc53e2b2b66e0bade8a.tar.bz2 coreclr-0e71141cf38dd146c2d34dc53e2b2b66e0bade8a.zip |
Merge pull request #11639 from brianrob/fix_corefx
Fix EventSource Test Breaks in CoreFX
-rwxr-xr-x[-rw-r--r--] | src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs index df3ea163ce..3349c069c6 100644..100755 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs @@ -1422,6 +1422,7 @@ namespace System.Diagnostics.Tracing if (disposing) { #if FEATURE_MANAGED_ETW +#if !FEATURE_PERFTRACING // Send the manifest one more time to ensure circular buffers have a chance to get to this information // even in scenarios with a high volume of ETW events. if (m_eventSourceEnabled) @@ -1434,6 +1435,7 @@ namespace System.Diagnostics.Tracing { } // If it fails, simply give up. m_eventSourceEnabled = false; } +#endif if (m_provider != null) { m_provider.Dispose(); @@ -2289,7 +2291,7 @@ namespace System.Diagnostics.Tracing [SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")] private unsafe void WriteEventString(EventLevel level, long keywords, string msgString) { -#if FEATURE_MANAGED_ETW +#if FEATURE_MANAGED_ETW && !FEATURE_PERFTRACING if (m_provider != null) { string eventName = "EventSourceMessage"; @@ -2325,7 +2327,7 @@ namespace System.Diagnostics.Tracing data.Ptr = (ulong)msgStringPtr; data.Size = (uint)(2 * (msgString.Length + 1)); data.Reserved = 0; - m_provider.WriteEvent(ref descr, m_eventData[0].EventHandle, null, null, 1, (IntPtr)((void*)&data)); + m_provider.WriteEvent(ref descr, IntPtr.Zero, null, null, 1, (IntPtr)((void*)&data)); } } } @@ -2773,11 +2775,13 @@ namespace System.Diagnostics.Tracing { // eventSourceDispatcher == null means this is the ETW manifest +#if !FEATURE_PERFTRACING // Note that we unconditionally send the manifest whenever we are enabled, even if // we were already enabled. This is because there may be multiple sessions active // and we can't know that all the sessions have seen the manifest. if (!SelfDescribingEvents) SendManifest(m_rawManifest); +#endif } #if FEATURE_ACTIVITYSAMPLING @@ -2901,12 +2905,14 @@ namespace System.Diagnostics.Tracing } else { +#if !FEATURE_PERFTRACING if (commandArgs.Command == EventCommand.SendManifest) { // TODO: should we generate the manifest here if we hadn't already? if (m_rawManifest != null) SendManifest(m_rawManifest); } +#endif // These are not used for non-update commands and thus should always be 'default' values // Debug.Assert(enable == true); @@ -3126,6 +3132,7 @@ namespace System.Diagnostics.Tracing { // GetMetadata failed, so we have to set it via reflection. Debug.Assert(m_rawManifest == null); + m_rawManifest = CreateManifestAndDescriptors(this.GetType(), Name, this); Debug.Assert(m_eventData != null); @@ -3162,7 +3169,7 @@ namespace System.Diagnostics.Tracing #if FEATURE_PERFTRACING // Initialize the EventPipe event handles. DefineEventPipeEvents(); -#endif +#endif } if (s_currentPid == 0) { @@ -3695,11 +3702,7 @@ namespace System.Diagnostics.Tracing throw new ArgumentException(msg, exception); } -#if FEATURE_PERFTRACING - return null; -#else return bNeedsManifest ? res : null; -#endif } private static bool RemoveFirstArgIfRelatedActivityId(ref ParameterInfo[] args) |