[mips] Disable div with mul on 32bit mips
[mono.git] / mcs / class / corlib / System.Diagnostics.Tracing / EventSource.cs
1 //
2 // EventSource.cs
3 //
4 // Authors:
5 //      Marek Safar  <marek.safar@gmail.com>
6 //      Frederik Carlier <frederik.carlier@quamotion.mobi>
7 //
8 // Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
9 // Copyrithg (C) 2015 Quamotion (http://quamotion.mobi)
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 //
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 //
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 using System.Collections.Generic;
32
33 namespace System.Diagnostics.Tracing
34 {
35         public class EventSource : IDisposable
36         {
37                 protected internal struct EventData
38                 {
39                         public IntPtr DataPointer { get; set; }
40                         public int Size { get; set; }
41                 }
42
43                 protected EventSource ()
44                 {
45                         this.Name = this.GetType().Name;
46                 }
47
48                 protected EventSource (bool throwOnEventWriteErrors)
49                         : this ()
50                 {
51                 }
52
53                 protected EventSource (EventSourceSettings settings)
54                         : this ()
55                 {
56                         this.Settings = settings;
57                 }
58
59                 protected EventSource (EventSourceSettings settings, params string[] traits)
60                         : this (settings)
61                 {
62                 }
63
64                 public EventSource (string eventSourceName)
65                 {
66                         this.Name = eventSourceName;
67                 }
68
69                 public EventSource (string eventSourceName, EventSourceSettings config)
70                         : this (eventSourceName)
71                 {
72                         this.Settings = config;
73                 }
74
75                 public EventSource (string eventSourceName, EventSourceSettings config, params string[] traits)
76                         : this (eventSourceName, config)
77                 {
78                 }
79
80                 ~EventSource ()
81                 {
82                         Dispose (false);
83                 }
84
85                 public Exception ConstructionException
86                 {
87                         get { return null; }
88                 }
89
90                 public static Guid CurrentThreadActivityId
91                 {
92                         get { return Guid.Empty; }
93                 }
94
95                 public Guid Guid
96                 {
97                         get { return Guid.Empty; }
98                 }
99
100                 public string Name
101                 {
102                         get;
103                         private set;
104                 }
105
106                 public EventSourceSettings Settings
107                 {
108                         get;
109                         private set;
110                 }
111
112                 public bool IsEnabled ()
113                 {
114                         return false;
115                 }
116
117                 public bool IsEnabled (EventLevel level, EventKeywords keywords)
118                 {
119                         return false;
120                 }
121
122                 public bool IsEnabled (EventLevel level, EventKeywords keywords, EventChannel channel)
123                 {
124                         return false;
125                 }
126
127                 public void Dispose ()
128                 {
129                         Dispose (true);
130                         GC.SuppressFinalize (this);
131                 }
132
133                 public string GetTrait (string key)
134                 {
135                         return null;
136                 }
137
138                 public void Write (string eventName)
139                 {
140                 }
141
142                 public void Write (string eventName, EventSourceOptions options)
143                 {
144                 }
145
146                 public void Write<T> (string eventName, T data)
147                 {
148                 }
149
150                 public void Write<T> (string eventName, EventSourceOptions options, T data)
151                 {
152                 }
153
154                 public void Write<T> (string eventName, ref EventSourceOptions options, ref T data)
155                 {
156                 }
157
158                 public void Write<T> (string eventName, ref EventSourceOptions options, ref Guid activityId, ref Guid relatedActivityId, ref T data)
159                 {
160                 }
161
162                 protected virtual void Dispose (bool disposing)
163                 {
164                 }
165
166                 protected virtual void OnEventCommand (EventCommandEventArgs command)
167                 {
168                 }
169
170                 protected void WriteEvent (int eventId)
171                 {
172                         WriteEvent (eventId, new object[] { } );
173                 }
174
175                 protected void WriteEvent (int eventId, byte[] arg1)
176                 {
177                         WriteEvent (eventId, new object[] { arg1 } );
178                 }
179
180                 protected void WriteEvent (int eventId, int arg1)
181                 {
182                         WriteEvent (eventId, new object[] { arg1 } );
183                 }
184
185                 protected void WriteEvent (int eventId, string arg1)
186                 {
187                         WriteEvent (eventId, new object[] { arg1 } );
188                 }
189
190                 protected void WriteEvent (int eventId, int arg1, int arg2)
191                 {
192                         WriteEvent (eventId, new object[] { arg1, arg2 } );
193                 }
194
195                 protected void WriteEvent (int eventId, int arg1, int arg2, int arg3)
196                 {
197                         WriteEvent (eventId, new object[] { arg1, arg2, arg3 } );
198                 }
199
200                 protected void WriteEvent (int eventId, int arg1, string arg2)
201                 {
202                         WriteEvent (eventId, new object[] { arg1, arg2 } );
203                 }
204
205                 protected void WriteEvent (int eventId, long arg1)
206                 {
207                         WriteEvent (eventId, new object[] { arg1 } );
208                 }
209
210                 protected void WriteEvent (int eventId, long arg1, byte[] arg2)
211                 {
212                         WriteEvent (eventId, new object[] { arg1, arg2 } );
213                 }
214
215                 protected void WriteEvent (int eventId, long arg1, long arg2)
216                 {
217                         WriteEvent (eventId, new object[] { arg1, arg2 } );
218                 }
219
220                 protected void WriteEvent (int eventId, long arg1, long arg2, long arg3)
221                 {
222                         WriteEvent (eventId, new object[] { arg1, arg2, arg3 } );
223                 }
224
225                 protected void WriteEvent (int eventId, long arg1, string arg2)
226                 {
227                         WriteEvent (eventId, new object[] { arg1, arg2 } );
228                 }
229
230                 protected void WriteEvent (int eventId, params object[] args)
231                 {
232                 }
233
234                 protected void WriteEvent (int eventId, string arg1, int arg2)
235                 {
236                         WriteEvent (eventId, new object[] { arg1, arg2 } );
237                 }
238
239                 protected void WriteEvent (int eventId, string arg1, int arg2, int arg3)
240                 {
241                         WriteEvent (eventId, new object[] { arg1, arg2, arg3 } );
242                 }
243
244                 protected void WriteEvent (int eventId, string arg1, long arg2)
245                 {
246                         WriteEvent (eventId, new object[] { arg1, arg2 } );
247                 }
248
249                 protected void WriteEvent (int eventId, string arg1, string arg2)
250                 {
251                         WriteEvent (eventId, new object[] { arg1, arg2 } );
252                 }
253
254                 protected void WriteEvent (int eventId, string arg1, string arg2, string arg3)
255                 {
256                         WriteEvent (eventId, new object[] { arg1, arg2, arg3 } );
257                 }
258
259                 [CLSCompliant (false)]
260                 protected unsafe void WriteEventCore (int eventId, int eventDataCount, EventData* data)
261                 {
262                 }
263
264                 protected unsafe void WriteEventWithRelatedActivityId (int eventId, Guid relatedActivityId, params object[] args)
265                 {
266                 }
267
268                 [CLSCompliant (false)]
269                 protected unsafe void WriteEventWithRelatedActivityIdCore (int eventId, Guid* relatedActivityId, int eventDataCount, EventSource.EventData* data)
270                 {
271                 }
272
273 #if NETSTANDARD
274                 [MonoTODO]
275                 public event EventHandler<EventCommandEventArgs> EventCommandExecuted
276                 {
277                         add { throw new NotImplementedException (); }
278                         remove { throw new NotImplementedException (); }
279                 }
280 #endif
281
282                 [MonoTODO]
283                 public static string GenerateManifest (Type eventSourceType, string assemblyPathToIncludeInManifest)
284                 {
285                         throw new NotImplementedException ();
286                 }
287
288                 [MonoTODO]
289                 public static string GenerateManifest (Type eventSourceType, string assemblyPathToIncludeInManifest, EventManifestOptions flags)
290                 {
291                         throw new NotImplementedException ();
292                 }
293
294                 [MonoTODO]
295                 public static Guid GetGuid (Type eventSourceType)
296                 {
297                         throw new NotImplementedException ();
298                 }
299
300                 [MonoTODO]
301                 public static string GetName (Type eventSourceType)
302                 {
303                         throw new NotImplementedException ();
304                 }
305
306                 [MonoTODO]
307                 public static IEnumerable<EventSource> GetSources ()
308                 {
309                         throw new NotImplementedException ();
310                 }
311
312                 [MonoTODO]
313                 public static void SendCommand (EventSource eventSource, EventCommand command, IDictionary<string, string> commandArguments)
314                 {
315                         throw new NotImplementedException ();
316                 }
317
318                 [MonoTODO]
319                 public static void SetCurrentThreadActivityId (Guid activityId)
320                 {
321                         throw new NotImplementedException ();
322                 }
323
324                 [MonoTODO]
325                 public static void SetCurrentThreadActivityId (Guid activityId, out Guid oldActivityThatWillContinue)
326                 {
327                         throw new NotImplementedException ();
328                 }
329         }
330 }
331