Update the System.Diagnostics.Tracing namespace to better match the .NET API
authorFrederik Carlier <frederik.carlier@quamotion.mobi>
Sat, 12 Dec 2015 23:44:59 +0000 (00:44 +0100)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Sat, 19 Dec 2015 16:58:34 +0000 (17:58 +0100)
mcs/class/corlib/System.Diagnostics.Tracing/EventKeywords.cs [deleted file]
mcs/class/corlib/System.Diagnostics.Tracing/EventLevel.cs [deleted file]
mcs/class/corlib/System.Diagnostics.Tracing/EventSource.cs
mcs/class/corlib/System.Diagnostics.Tracing/EventSourceSettings.cs [new file with mode: 0644]
mcs/class/corlib/corlib-net_4_x.csproj
mcs/class/corlib/corlib.dll.sources

diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventKeywords.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventKeywords.cs
deleted file mode 100644 (file)
index ca2bfd7..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// EventKeywords.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Diagnostics.Tracing
-{
-       [Flags]
-       public enum EventKeywords : long
-       {
-               None,
-               WdiContext =            0x2000000000000,
-               WdiDiagnostic =         0x4000000000000,
-               Sqm =                           0x8000000000000,
-               AuditFailure =          0x10000000000000,
-               AuditSuccess =          0x20000000000000,
-               CorrelationHint =       0x10000000000000,
-               EventLogClassic =       0x80000000000000
-       }
-}
-
diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventLevel.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventLevel.cs
deleted file mode 100644 (file)
index 6d56cff..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-// EventLevel.cs
-//
-// Authors:
-//     Marek Safar  <marek.safar@gmail.com>
-//
-// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-namespace System.Diagnostics.Tracing
-{
-       public enum EventLevel
-       {
-               LogAlways,
-               Critical,
-               Error,
-               Warning,
-               Informational,
-               Verbose
-       }
-}
-
index 329d7cbc9537b79b3c4d3f309add7fa9f800c99a..181eedff023051bba455a2f3462b63e1d498fa89 100644 (file)
@@ -33,12 +33,68 @@ namespace System.Diagnostics.Tracing
        {
                protected EventSource ()
                {
+                       this.Name = this.GetType().Name;
                }
 
                protected EventSource (bool throwOnEventWriteErrors)
+                       : this ()
                {
                }
 
+               protected EventSource (EventSourceSettings settings)
+                       : this ()
+               {
+                       this.Settings = settings;
+               }
+
+               protected EventSource (EventSourceSettings settings, params string[] traits)
+                       : this (settings)
+               {
+               }
+
+               public EventSource (string eventSourceName)
+               {
+                       this.Name = eventSourceName;
+               }
+
+               public EventSource (string eventSourceName, EventSourceSettings config)
+                       : this (eventSourceName)
+               {
+                       this.Settings = config;
+               }
+
+               public EventSource (string eventSourceName, EventSourceSettings config, params string[] traits)
+                       : this (eventSourceName, config)
+               {
+               }
+
+               public Exception ConstructionException
+               {
+                       get { return null; }
+               }
+
+               public static Guid CurrentThreadActivityId
+               {
+                       get { return Guid.Empty; }
+               }
+
+               public Guid Guid
+               {
+                       get { return Guid.Empty; }
+               }
+
+               public string Name
+               {
+                       get;
+                       private set;
+               }
+
+               public EventSourceSettings Settings
+               {
+                       get;
+                       private set;
+               }
+
                public bool IsEnabled ()
                {
                        return false;
@@ -49,24 +105,66 @@ namespace System.Diagnostics.Tracing
                        return false;
                }
 
+               public bool IsEnabled (EventLevel level, EventKeywords keywords, EventChannel channel)
+               {
+                       return false;
+               }
+
                public void Dispose ()
                {
                        Dispose (true);
                }
 
+               public string GetTrait (string key)
+               {
+                       return null;
+               }
+
+               public void Write (string eventName)
+               {
+               }
+
+               public void Write<T> (string eventName, T data)
+               {
+               }
+
+               public void Write<T> (string eventName, EventSourceOptions options, T data)
+               {
+               }
+
+               public void Write<T> (string eventName, ref EventSourceOptions options, ref T data)
+               {
+               }
+
+               public void Write<T> (string eventName, ref EventSourceOptions options, ref Guid activityId, ref Guid relatedActivityId, ref T data)
+               {
+               }
+
                protected virtual void Dispose (bool disposing)
-               {                       
+               {
                }
 
                protected virtual void OnEventCommand (EventCommandEventArgs command)
                {
                }
 
+               protected void WriteEvent (int eventId)
+               {
+               }
+
+               protected void WriteEvent (int eventId, byte[] arg1)
+               {
+               }
+
+               protected void WriteEvent (int eventId, int arg1)
+               {
+               }
+
                protected void WriteEvent (int eventId, string arg1)
                {
                }
 
-               protected void WriteEvent (int eventId, string arg1, int arg2)
+               protected void WriteEvent (int eventId, int arg1, int arg2)
                {
                }
 
@@ -74,7 +172,7 @@ namespace System.Diagnostics.Tracing
                {
                }
 
-               protected void WriteEvent (int eventId, string arg1, int arg2, int arg3)
+               protected void WriteEvent (int eventId, int arg1, string arg2)
                {
                }
 
@@ -82,6 +180,10 @@ namespace System.Diagnostics.Tracing
                {
                }
 
+               protected void WriteEvent (int eventId, long arg1, byte[] arg2)
+               {
+               }
+
                protected void WriteEvent (int eventId, long arg1, long arg2)
                {
                }
@@ -90,9 +192,33 @@ namespace System.Diagnostics.Tracing
                {
                }
 
+               protected void WriteEvent (int eventId, long arg1, string arg2)
+               {
+               }
+
                protected void WriteEvent (int eventId, params object[] args)
                {
                }
+
+               protected void WriteEvent (int eventId, string arg1, int arg2)
+               {
+               }
+
+               protected void WriteEvent (int eventId, string arg1, int arg2, int arg3)
+               {
+               }
+
+               protected void WriteEvent (int eventId, string arg1, long arg2)
+               {
+               }
+
+               protected void WriteEvent (int eventId, string arg1, string arg2)
+               {
+               }
+
+               protected void WriteEvent (int eventId, string arg1, string arg2, string arg3)
+               {
+               }
        }
 }
 
diff --git a/mcs/class/corlib/System.Diagnostics.Tracing/EventSourceSettings.cs b/mcs/class/corlib/System.Diagnostics.Tracing/EventSourceSettings.cs
new file mode 100644 (file)
index 0000000..2891172
--- /dev/null
@@ -0,0 +1,41 @@
+//
+// EventSourceSettings.cs
+//
+// Authors:
+//     Frederik Carlier  <frederik.carlier@quamotion.mobi>
+//
+// Copyright (C) 2015 Quamotion (http://quamotion.mobi)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+namespace System.Diagnostics.Tracing
+{
+       [Flags]
+       public enum EventSourceSettings
+       {
+               Default = 0,
+               ThrowOnEventWriteErrors = 1,
+               EtwManifestEventFormat = 4,
+               EtwSelfDescribingEventFormat = 8
+       }
+}
+
index ddb4b98b3e0b48579b2ce22d84dcbfda99898883..4a63553993268e1ce4cee997d72953a359d2d005 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>\r
+<?xml version="1.0" encoding="utf-8"?>\r
 <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
     <Compile Include="System.Diagnostics.SymbolStore\SymDocumentType.cs" />\r
     <Compile Include="System.Diagnostics.SymbolStore\SymLanguageType.cs" />\r
     <Compile Include="System.Diagnostics.SymbolStore\SymLanguageVendor.cs" />\r
+    <Compile Include="System.Diagnostics.Tracing\EventActivityOptions.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventAttribute.cs" />\r
+    <Compile Include="System.Diagnostics.Tracing\EventChannel.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventCommand.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventCommandEventArgs.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventKeywords.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventLevel.cs" />\r
+    <Compile Include="System.Diagnostics.Tracing\EventOpcode.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventSource.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\EventSourceAttribute.cs" />\r
+    <Compile Include="System.Diagnostics.Tracing\EventSourceOptions.cs" />\r
+    <Compile Include="System.Diagnostics.Tracing\EventSourceSettings.cs" />\r
+    <Compile Include="System.Diagnostics.Tracing\EventTags.cs" />\r
     <Compile Include="System.Diagnostics.Tracing\NonEventAttribute.cs" />\r
     <Compile Include="System.Diagnostics\Debugger.cs" />\r
     <Compile Include="System.Diagnostics\StackFrame.cs" />\r
     <Compile Include="System\Void.cs" />\r
     <Compile Include="System\WeakReference.cs" />\r
     <Compile Include="System\WeakReference_T.cs" />\r
-    <Compile Include="System\WindowsConsoleDriver.cs" />\r  </ItemGroup>\r
+    <Compile Include="System\WindowsConsoleDriver.cs" />\r
+  </ItemGroup>\r
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
        Other similar extension points exist, see Microsoft.Common.targets.\r
   <Target Name="BeforeBuild">\r
     </EmbeddedResource>\r
   </ItemGroup>\r
 </Project>\r
-
+\r
index 89f9fc965b4ce7dc4a3f816c73b011b25b513cc2..f76b8d5ffcf8d8296f2f015049d9f7d955e116f4 100644 (file)
@@ -164,10 +164,13 @@ System.Diagnostics/StackFrame.cs
 System.Diagnostics/StackTrace.cs
 System.Diagnostics.Tracing/EventAttribute.cs
 System.Diagnostics.Tracing/EventCommand.cs
-System.Diagnostics.Tracing/EventKeywords.cs
-System.Diagnostics.Tracing/EventLevel.cs
+../../../external/referencesource/mscorlib/system/diagnostics/eventing/winmeta.cs
+../../../external/referencesource/mscorlib/system/diagnostics/eventing/eventactivityoptions.cs
+../../../external/referencesource/mscorlib/system/diagnostics/eventing/TraceLogging/EventSourceOptions.cs
+../../../external/referencesource/mscorlib/system/diagnostics/eventing/TraceLogging/TraceLoggingEventTraits.cs
 System.Diagnostics.Tracing/EventSource.cs
 System.Diagnostics.Tracing/EventSourceAttribute.cs
+System.Diagnostics.Tracing/EventSourceSettings.cs
 System.Diagnostics.Tracing/EventCommandEventArgs.cs
 System.Diagnostics.Tracing/NonEventAttribute.cs
 System.Diagnostics.SymbolStore/ISymbolBinder.cs