summaryrefslogtreecommitdiff
path: root/src/mscorlib/shared/System
diff options
context:
space:
mode:
authorBrian Robbins <brianrob@microsoft.com>2017-05-15 22:23:44 -0700
committerBrian Robbins <brianrob@microsoft.com>2017-05-15 23:35:26 -0700
commitc3d04c6c600b064ec23d2d3636d309791979351d (patch)
treeac1989f52dbb80a4bca517bf67b95088c860c252 /src/mscorlib/shared/System
parenta7fae647fc09448cce04276a87a2873c09d31d42 (diff)
downloadcoreclr-c3d04c6c600b064ec23d2d3636d309791979351d.tar.gz
coreclr-c3d04c6c600b064ec23d2d3636d309791979351d.tar.bz2
coreclr-c3d04c6c600b064ec23d2d3636d309791979351d.zip
Fix EventSource tests.
Diffstat (limited to 'src/mscorlib/shared/System')
-rwxr-xr-x[-rw-r--r--]src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs17
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 a0f0e1e06d..f87d74d5f7 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();
@@ -2295,7 +2297,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";
@@ -2331,7 +2333,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));
}
}
}
@@ -2779,11 +2781,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
@@ -2907,12 +2911,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);
@@ -3132,6 +3138,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);
@@ -3168,7 +3175,7 @@ namespace System.Diagnostics.Tracing
#if FEATURE_PERFTRACING
// Initialize the EventPipe event handles.
DefineEventPipeEvents();
-#endif
+#endif
}
if (s_currentPid == 0)
{
@@ -3701,11 +3708,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)