1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 
5 using System;
6 
7 namespace Mono.Profiler.Log {
8 
9 	// mono/profiler/log.h : TYPE_*
10 	enum LogEventType {
11 		Allocation = 0,
12 		GC = 1,
13 		Metadata = 2,
14 		Method = 3,
15 		Exception = 4,
16 		Monitor = 5,
17 		Heap = 6,
18 		Sample = 7,
19 		Runtime = 8,
20 		Meta = 10,
21 
22 		AllocationNoBacktrace = 0 << 4,
23 		AllocationBacktrace = 1 << 4,
24 
25 		GCEvent = 1 << 4,
26 		GCResize = 2 << 4,
27 		GCMove = 3 << 4,
28 		GCHandleCreationNoBacktrace = 4 << 4,
29 		GCHandleDeletionNoBacktrace = 5 << 4,
30 		GCHandleCreationBacktrace = 6 << 4,
31 		GCHandleDeletionBacktrace = 7 << 4,
32 		GCFinalizeBegin = 8 << 4,
33 		GCFinalizeEnd = 9 << 4,
34 		GCFinalizeObjectBegin = 10 << 4,
35 		GCFinalizeObjectEnd = 11 << 4,
36 
37 		MetadataExtra = 0 << 4,
38 		MetadataEndLoad = 2 << 4,
39 		MetadataEndUnload = 4 << 4,
40 
41 		MethodLeave = 1 << 4,
42 		MethodEnter = 2 << 4,
43 		MethodLeaveExceptional = 3 << 4,
44 		MethodJit = 4 << 4,
45 
46 		ExceptionThrowNoBacktrace = 0 << 7,
47 		ExceptionThrowBacktrace = 1 << 7,
48 		ExceptionClause = 1 << 4,
49 
50 		MonitorNoBacktrace = 0 << 7,
51 		MonitorBacktrace = 1 << 7,
52 
53 		HeapBegin = 0 << 4,
54 		HeapEnd = 1 << 4,
55 		HeapObject = 2 << 4,
56 		HeapRoots = 3 << 4,
57 
58 		SampleHit = 0 << 4,
59 		SampleUnmanagedSymbol = 1 << 4,
60 		SampleUnmanagedBinary = 2 << 4,
61 		SampleCounterDescriptions = 3 << 4,
62 		SampleCounters = 4 << 4,
63 
64 		RuntimeJitHelper = 1 << 4,
65 
66 		MetaSynchronizationPoint = 0 << 4,
67 	}
68 
69 	// mono/profiler/log.h : TYPE_*
70 	enum LogMetadataType {
71 		Class = 1,
72 		Image = 2,
73 		Assembly = 3,
74 		AppDomain = 4,
75 		Thread = 5,
76 		Context = 6,
77 	}
78 
79 	// mono/utils/mono-counters.h : MONO_COUNTER_*
80 	public enum LogCounterType {
81 		Int32 = 0,
82 		UInt32 = 1,
83 		Word = 2,
84 		Int64 = 3,
85 		UInt64 = 4,
86 		Double = 5,
87 		String = 6,
88 		Interval = 7,
89 	}
90 
91 	// mono/utils/mono-counters.h : MONO_COUNTER_*
92 	public enum LogCounterSection {
93 		Jit = 1 << 8,
94 		GC = 1 << 9,
95 		Metadata = 1 << 10,
96 		Generics = 1 << 11,
97 		Security = 1 << 12,
98 		Runtime = 1 << 13,
99 		System = 1 << 14,
100 		User = 1 << 15,
101 		Profiler = 1 << 16,
102 	}
103 
104 	// mono/utils/mono-counters.h : MONO_COUNTER_*
105 	public enum LogCounterUnit {
106 		Raw = 0 << 24,
107 		Bytes = 1 << 24,
108 		Time = 2 << 24,
109 		Count = 3 << 24,
110 		Percentage = 4 << 24,
111 	}
112 
113 	// mono/utils/mono-counters.h : MONO_COUNTER_*
114 	public enum LogCounterVariance {
115 		Monotonic = 1 << 28,
116 		Constant = 1 << 29,
117 		Variable = 1 << 30,
118 	}
119 
120 	// mono/metadata/profiler.h : MonoProfilerCodeBufferType
121 	public enum LogJitHelper {
122 		Method = 0,
123 		MethodTrampoline = 1,
124 		UnboxTrampoline = 2,
125 		ImtTrampoline = 3,
126 		GenericsTrampoline = 4,
127 		SpecificTrampoline = 5,
128 		Helper = 6,
129 		Monitor = 7,
130 		DelegateInvoke = 8,
131 		ExceptionHandling = 9,
132 	}
133 
134 	// mono/metadata/profiler.h : MonoProfilerGCRootType
135 	[Flags]
136 	public enum LogHeapRootAttributes {
137 		Pinning = 1 << 8,
138 		WeakReference = 2 << 8,
139 		Interior = 4 << 8,
140 
141 		Stack = 1 << 0,
142 		Finalizer = 1 << 1,
143 		Handle = 1 << 2,
144 		Other = 1 << 3,
145 		Miscellaneous = 1 << 4,
146 
147 		TypeMask = 0xff,
148 	}
149 
150 	// mono/profiler/log.h : MonoProfilerMonitorEvent
151 	public enum LogMonitorEvent {
152 		Contention = 1,
153 		Done = 2,
154 		Fail = 3,
155 	}
156 
157 	// mono/metadata/metadata.h : MonoExceptionEnum
158 	public enum LogExceptionClause {
159 		Catch = 0,
160 		Filter = 1,
161 		Finally = 2,
162 		Fault = 4,
163 	}
164 
165 	// mono/metadata/profiler.h : MonoProfilerGCEvent
166 	public enum LogGCEvent {
167 		PreStopWorld = 6,
168 		PreStopWorldLocked = 10,
169 		PostStopWorld = 7,
170 		Begin = 0,
171 		End = 5,
172 		PreStartWorld = 8,
173 		PostStartWorld = 9,
174 		PostStartWorldUnlocked = 11,
175 		// Following are v13 and older only
176 		[Obsolete ("This event is no longer produced.")]
177 		MarkBegin = 1,
178 		[Obsolete ("This event is no longer produced.")]
179 		MarkEnd = 2,
180 		[Obsolete ("This event is no longer produced.")]
181 		ReclaimBegin = 3,
182 		[Obsolete ("This event is no longer produced.")]
183 		ReclaimEnd = 4
184 	}
185 
186 	// mono/metadata/mono-gc.h : MonoGCHandleType
187 	public enum LogGCHandleType {
188 		Weak = 0,
189 		WeakTrackResurrection = 1,
190 		Normal = 2,
191 		Pinned = 3,
192 	}
193 
194 	// mono/profiler/log.h : MonoProfilerSyncPointType
195 	public enum LogSynchronizationPoint {
196 		Periodic = 0,
197 		WorldStop = 1,
198 		WorldStart = 2,
199 	}
200 
201 	// mono/metadata/profiler.h : MonoProfilerSampleMode
202 	public enum LogSampleMode {
203 		None = 0,
204 		Process = 1,
205 		Real = 2,
206 	}
207 
208 	// mono/profiler/log.h : MonoProfilerHeapshotMode
209 	public enum LogHeapshotMode {
210 		None = 0,
211 		EveryMajor = 1,
212 		OnDemand = 2,
213 		Milliseconds = 3,
214 		Collections = 4,
215 	}
216 }
217