PageRenderTime 56ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingDataType.cs

https://github.com/directhex/mono-1
C# | 351 lines | 62 code | 43 blank | 246 comment | 0 complexity | 7475342578c2efbcd4ab1507bc8c6fe1 MD5 | raw file
  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. #if ES_BUILD_STANDALONE
  5. using System;
  6. #endif
  7. #if ES_BUILD_STANDALONE
  8. namespace Microsoft.Diagnostics.Tracing
  9. #else
  10. namespace System.Diagnostics.Tracing
  11. #endif
  12. {
  13. /// <summary>
  14. /// TraceLogging: Used when implementing a custom TraceLoggingTypeInfo.
  15. /// These are passed to metadataCollector.Add to specify the low-level
  16. /// type of a field in the event payload. Note that a "formatted"
  17. /// TraceLoggingDataType consists of a core TraceLoggingDataType value
  18. /// (a TraceLoggingDataType with a value less than 32) plus an OutType.
  19. /// Any combination of TraceLoggingDataType + OutType is valid, but not
  20. /// all are useful. In particular, combinations not explicitly listed
  21. /// below are unlikely to be recognized by decoders, and will typically
  22. /// be decoded as the corresponding core type (i.e. the decoder will
  23. /// mask off any unrecognized OutType value).
  24. /// </summary>
  25. internal enum TraceLoggingDataType
  26. {
  27. /// <summary>
  28. /// Core type.
  29. /// Data type with no value (0-length payload).
  30. /// NOTE: arrays of Nil are illegal.
  31. /// NOTE: a fixed-length array of Nil is interpreted by the decoder as
  32. /// a struct (obsolete but retained for backwards-compatibility).
  33. /// </summary>
  34. Nil = 0,
  35. /// <summary>
  36. /// Core type.
  37. /// Encoding assumes null-terminated Char16 string.
  38. /// Decoding treats as UTF-16LE string.
  39. /// </summary>
  40. Utf16String = 1,
  41. /// <summary>
  42. /// Core type.
  43. /// Encoding assumes null-terminated Char8 string.
  44. /// Decoding treats as MBCS string.
  45. /// </summary>
  46. MbcsString = 2,
  47. /// <summary>
  48. /// Core type.
  49. /// Encoding assumes 8-bit value.
  50. /// Decoding treats as signed integer.
  51. /// </summary>
  52. Int8 = 3,
  53. /// <summary>
  54. /// Core type.
  55. /// Encoding assumes 8-bit value.
  56. /// Decoding treats as unsigned integer.
  57. /// </summary>
  58. UInt8 = 4,
  59. /// <summary>
  60. /// Core type.
  61. /// Encoding assumes 16-bit value.
  62. /// Decoding treats as signed integer.
  63. /// </summary>
  64. Int16 = 5,
  65. /// <summary>
  66. /// Core type.
  67. /// Encoding assumes 16-bit value.
  68. /// Decoding treats as unsigned integer.
  69. /// </summary>
  70. UInt16 = 6,
  71. /// <summary>
  72. /// Core type.
  73. /// Encoding assumes 32-bit value.
  74. /// Decoding treats as signed integer.
  75. /// </summary>
  76. Int32 = 7,
  77. /// <summary>
  78. /// Core type.
  79. /// Encoding assumes 32-bit value.
  80. /// Decoding treats as unsigned integer.
  81. /// </summary>
  82. UInt32 = 8,
  83. /// <summary>
  84. /// Core type.
  85. /// Encoding assumes 64-bit value.
  86. /// Decoding treats as signed integer.
  87. /// </summary>
  88. Int64 = 9,
  89. /// <summary>
  90. /// Core type.
  91. /// Encoding assumes 64-bit value.
  92. /// Decoding treats as unsigned integer.
  93. /// </summary>
  94. UInt64 = 10,
  95. /// <summary>
  96. /// Core type.
  97. /// Encoding assumes 32-bit value.
  98. /// Decoding treats as Float.
  99. /// </summary>
  100. Float = 11,
  101. /// <summary>
  102. /// Core type.
  103. /// Encoding assumes 64-bit value.
  104. /// Decoding treats as Double.
  105. /// </summary>
  106. Double = 12,
  107. /// <summary>
  108. /// Core type.
  109. /// Encoding assumes 32-bit value.
  110. /// Decoding treats as Boolean.
  111. /// </summary>
  112. Boolean32 = 13,
  113. /// <summary>
  114. /// Core type.
  115. /// Encoding assumes 16-bit bytecount followed by binary data.
  116. /// Decoding treats as binary data.
  117. /// </summary>
  118. Binary = 14,
  119. /// <summary>
  120. /// Core type.
  121. /// Encoding assumes 16-byte value.
  122. /// Decoding treats as GUID.
  123. /// </summary>
  124. Guid = 15,
  125. /// <summary>
  126. /// Core type.
  127. /// Encoding assumes 64-bit value.
  128. /// Decoding treats as FILETIME.
  129. /// </summary>
  130. FileTime = 17,
  131. /// <summary>
  132. /// Core type.
  133. /// Encoding assumes 16-byte value.
  134. /// Decoding treats as SYSTEMTIME.
  135. /// </summary>
  136. SystemTime = 18,
  137. /// <summary>
  138. /// Core type.
  139. /// Encoding assumes 32-bit value.
  140. /// Decoding treats as hexadecimal unsigned integer.
  141. /// </summary>
  142. HexInt32 = 20,
  143. /// <summary>
  144. /// Core type.
  145. /// Encoding assumes 64-bit value.
  146. /// Decoding treats as hexadecimal unsigned integer.
  147. /// </summary>
  148. HexInt64 = 21,
  149. /// <summary>
  150. /// Core type.
  151. /// Encoding assumes 16-bit bytecount followed by Char16 data.
  152. /// Decoding treats as UTF-16LE string.
  153. /// </summary>
  154. CountedUtf16String = 22,
  155. /// <summary>
  156. /// Core type.
  157. /// Encoding assumes 16-bit bytecount followed by Char8 data.
  158. /// Decoding treats as MBCS string.
  159. /// </summary>
  160. CountedMbcsString = 23,
  161. /// <summary>
  162. /// Core type.
  163. /// Special case: Struct indicates that this field plus the
  164. /// subsequent N logical fields are to be considered as one logical
  165. /// field (i.e. a nested structure). The OutType is used to encode N.
  166. /// The maximum value for N is 127. This field has no payload by
  167. /// itself, but logically contains the payload of the following N
  168. /// fields. It is legal to have an array of Struct.
  169. /// </summary>
  170. Struct = 24,
  171. /// <summary>
  172. /// Formatted type.
  173. /// Encoding assumes 16-bit value.
  174. /// Decoding treats as UTF-16LE character.
  175. /// </summary>
  176. Char16 = UInt16 + (EventFieldFormat.String << 8),
  177. /// <summary>
  178. /// Formatted type.
  179. /// Encoding assumes 8-bit value.
  180. /// Decoding treats as character.
  181. /// </summary>
  182. Char8 = UInt8 + (EventFieldFormat.String << 8),
  183. /// <summary>
  184. /// Formatted type.
  185. /// Encoding assumes 8-bit value.
  186. /// Decoding treats as Boolean.
  187. /// </summary>
  188. Boolean8 = UInt8 + (EventFieldFormat.Boolean << 8),
  189. /// <summary>
  190. /// Formatted type.
  191. /// Encoding assumes 8-bit value.
  192. /// Decoding treats as hexadecimal unsigned integer.
  193. /// </summary>
  194. HexInt8 = UInt8 + (EventFieldFormat.Hexadecimal << 8),
  195. /// <summary>
  196. /// Formatted type.
  197. /// Encoding assumes 16-bit value.
  198. /// Decoding treats as hexadecimal unsigned integer.
  199. /// </summary>
  200. HexInt16 = UInt16 + (EventFieldFormat.Hexadecimal << 8),
  201. #if false
  202. /// <summary>
  203. /// Formatted type.
  204. /// Encoding assumes 32-bit value.
  205. /// Decoding treats as process identifier.
  206. /// </summary>
  207. ProcessId = UInt32 + (EventSourceFieldFormat.ProcessId << 8),
  208. /// <summary>
  209. /// Formatted type.
  210. /// Encoding assumes 32-bit value.
  211. /// Decoding treats as thread identifier.
  212. /// </summary>
  213. ThreadId = UInt32 + (EventSourceFieldFormat.ThreadId << 8),
  214. /// <summary>
  215. /// Formatted type.
  216. /// Encoding assumes 16-bit value.
  217. /// Decoding treats as IP port.
  218. /// </summary>
  219. Port = UInt16 + (EventSourceFieldFormat.Port << 8),
  220. /// <summary>
  221. /// Formatted type.
  222. /// Encoding assumes 32-bit value.
  223. /// Decoding treats as IPv4 address.
  224. /// </summary>
  225. Ipv4Address = UInt32 + (EventSourceFieldFormat.Ipv4Address << 8),
  226. /// <summary>
  227. /// Formatted type.
  228. /// Encoding assumes 16-bit bytecount followed by binary data.
  229. /// Decoding treats as IPv6 address.
  230. /// </summary>
  231. Ipv6Address = Binary + (EventSourceFieldFormat.Ipv6Address << 8),
  232. /// <summary>
  233. /// Formatted type.
  234. /// Encoding assumes 16-bit bytecount followed by binary data.
  235. /// Decoding treats as SOCKADDR.
  236. /// </summary>
  237. SocketAddress = Binary + (EventSourceFieldFormat.SocketAddress << 8),
  238. #endif
  239. /// <summary>
  240. /// Formatted type.
  241. /// Encoding assumes null-terminated Char16 string.
  242. /// Decoding treats as UTF-16LE XML string.
  243. /// </summary>
  244. Utf16Xml = Utf16String + (EventFieldFormat.Xml << 8),
  245. /// <summary>
  246. /// Formatted type.
  247. /// Encoding assumes null-terminated Char8 string.
  248. /// Decoding treats as MBCS XML string.
  249. /// </summary>
  250. MbcsXml = MbcsString + (EventFieldFormat.Xml << 8),
  251. /// <summary>
  252. /// Formatted type.
  253. /// Encoding assumes 16-bit bytecount followed by Char16 data.
  254. /// Decoding treats as UTF-16LE XML.
  255. /// </summary>
  256. CountedUtf16Xml = CountedUtf16String + (EventFieldFormat.Xml << 8),
  257. /// <summary>
  258. /// Formatted type.
  259. /// Encoding assumes 16-bit bytecount followed by Char8 data.
  260. /// Decoding treats as MBCS XML.
  261. /// </summary>
  262. CountedMbcsXml = CountedMbcsString + (EventFieldFormat.Xml << 8),
  263. /// <summary>
  264. /// Formatted type.
  265. /// Encoding assumes null-terminated Char16 string.
  266. /// Decoding treats as UTF-16LE JSON string.
  267. /// </summary>
  268. Utf16Json = Utf16String + (EventFieldFormat.Json << 8),
  269. /// <summary>
  270. /// Formatted type.
  271. /// Encoding assumes null-terminated Char8 string.
  272. /// Decoding treats as MBCS JSON string.
  273. /// </summary>
  274. MbcsJson = MbcsString + (EventFieldFormat.Json << 8),
  275. /// <summary>
  276. /// Formatted type.
  277. /// Encoding assumes 16-bit bytecount followed by Char16 data.
  278. /// Decoding treats as UTF-16LE JSON.
  279. /// </summary>
  280. CountedUtf16Json = CountedUtf16String + (EventFieldFormat.Json << 8),
  281. /// <summary>
  282. /// Formatted type.
  283. /// Encoding assumes 16-bit bytecount followed by Char8 data.
  284. /// Decoding treats as MBCS JSON.
  285. /// </summary>
  286. CountedMbcsJson = CountedMbcsString + (EventFieldFormat.Json << 8),
  287. #if false
  288. /// <summary>
  289. /// Formatted type.
  290. /// Encoding assumes 32-bit value.
  291. /// Decoding treats as Win32 error.
  292. /// </summary>
  293. Win32Error = UInt32 + (EventSourceFieldFormat.Win32Error << 8),
  294. /// <summary>
  295. /// Formatted type.
  296. /// Encoding assumes 32-bit value.
  297. /// Decoding treats as NTSTATUS.
  298. /// </summary>
  299. NTStatus = UInt32 + (EventSourceFieldFormat.NTStatus << 8),
  300. #endif
  301. /// <summary>
  302. /// Formatted type.
  303. /// Encoding assumes 32-bit value.
  304. /// Decoding treats as HRESULT.
  305. /// </summary>
  306. HResult = Int32 + (EventFieldFormat.HResult << 8)
  307. }
  308. }