@encharm/cws 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. package/dist/bindings/cws_linux_108.node +0 -0
  2. package/dist/bindings/cws_linux_64.node +0 -0
  3. package/dist/bindings/cws_linux_72.node +0 -0
  4. package/dist/bindings/cws_linux_79.node +0 -0
  5. package/dist/bindings/cws_linux_83.node +0 -0
  6. package/dist/bindings/cws_linux_93.node +0 -0
  7. package/dist/bindings/cws_win32_64.node +0 -0
  8. package/dist/bindings/cws_win32_72.node +0 -0
  9. package/dist/bindings/cws_win32_79.node +0 -0
  10. package/dist/bindings/cws_win32_83.node +0 -0
  11. package/dist/bindings/cws_win32_93.node +0 -0
  12. package/package.json +1 -1
  13. package/src/Addon.h +24 -2
  14. package/src/HTTPSocket.cpp +1 -1
  15. package/src/headers/{13 → 18}/aliased_buffer.h +61 -9
  16. package/src/headers/18/aliased_struct-inl.h +54 -0
  17. package/src/headers/18/aliased_struct.h +63 -0
  18. package/src/headers/{12 → 18}/async_wrap-inl.h +0 -0
  19. package/src/headers/{12 → 18}/async_wrap.h +26 -2
  20. package/src/headers/{12/base64.h → 18/base64-inl.h} +78 -86
  21. package/src/headers/18/base64.h +69 -0
  22. package/src/headers/{12 → 18}/base_object-inl.h +46 -25
  23. package/src/headers/{12 → 18}/base_object.h +82 -17
  24. package/src/headers/{12 → 18}/callback_queue-inl.h +9 -9
  25. package/src/headers/{12 → 18}/callback_queue.h +13 -5
  26. package/src/headers/18/cares_wrap.h +523 -0
  27. package/src/headers/{12 → 18}/connect_wrap.h +0 -0
  28. package/src/headers/{12 → 18}/connection_wrap.h +0 -0
  29. package/src/headers/18/crypto/crypto_aes.h +89 -0
  30. package/src/headers/{13/node_crypto_bio.h → 18/crypto/crypto_bio.h} +3 -4
  31. package/src/headers/18/crypto/crypto_cipher.h +291 -0
  32. package/src/headers/{13/node_crypto_clienthello-inl.h → 18/crypto/crypto_clienthello-inl.h} +4 -5
  33. package/src/headers/{13/node_crypto_clienthello.h → 18/crypto/crypto_clienthello.h} +3 -4
  34. package/src/headers/{12/node_crypto_common.h → 18/crypto/crypto_common.h} +49 -36
  35. package/src/headers/18/crypto/crypto_context.h +147 -0
  36. package/src/headers/18/crypto/crypto_dh.h +156 -0
  37. package/src/headers/18/crypto/crypto_dsa.h +77 -0
  38. package/src/headers/18/crypto/crypto_ec.h +170 -0
  39. package/src/headers/{12/node_crypto_groups.h → 18/crypto/crypto_groups.h} +3 -3
  40. package/src/headers/18/crypto/crypto_hash.h +89 -0
  41. package/src/headers/18/crypto/crypto_hkdf.h +65 -0
  42. package/src/headers/18/crypto/crypto_hmac.h +94 -0
  43. package/src/headers/18/crypto/crypto_keygen.h +305 -0
  44. package/src/headers/18/crypto/crypto_keys.h +420 -0
  45. package/src/headers/18/crypto/crypto_pbkdf2.h +76 -0
  46. package/src/headers/18/crypto/crypto_random.h +130 -0
  47. package/src/headers/18/crypto/crypto_rsa.h +141 -0
  48. package/src/headers/18/crypto/crypto_scrypt.h +87 -0
  49. package/src/headers/18/crypto/crypto_sig.h +168 -0
  50. package/src/headers/18/crypto/crypto_spkac.h +21 -0
  51. package/src/headers/18/crypto/crypto_timing.h +20 -0
  52. package/src/headers/{13/tls_wrap.h → 18/crypto/crypto_tls.h} +137 -66
  53. package/src/headers/18/crypto/crypto_util.h +791 -0
  54. package/src/headers/18/crypto/crypto_x509.h +143 -0
  55. package/src/headers/{12 → 18}/debug_utils-inl.h +0 -0
  56. package/src/headers/{13 → 18}/debug_utils.h +7 -4
  57. package/src/headers/{12 → 18}/diagnosticfilename-inl.h +0 -0
  58. package/src/headers/{12 → 18}/env-inl.h +397 -304
  59. package/src/headers/{12 → 18}/env.h +397 -172
  60. package/src/headers/{12 → 18}/handle_wrap.h +7 -3
  61. package/src/headers/18/histogram-inl.h +107 -0
  62. package/src/headers/18/histogram.h +239 -0
  63. package/src/headers/{13 → 18}/inspector_agent.h +4 -7
  64. package/src/headers/{12 → 18}/inspector_io.h +0 -0
  65. package/src/headers/{13 → 18}/inspector_profiler.h +17 -5
  66. package/src/headers/{12 → 18}/inspector_socket.h +0 -0
  67. package/src/headers/{12 → 18}/inspector_socket_server.h +0 -0
  68. package/src/headers/18/js_native_api.h +571 -0
  69. package/src/headers/{13 → 18}/js_native_api_types.h +30 -7
  70. package/src/headers/{12 → 18}/js_native_api_v8.h +220 -83
  71. package/src/headers/{12 → 18}/js_native_api_v8_internals.h +6 -5
  72. package/src/headers/{12 → 18}/js_stream.h +0 -0
  73. package/src/headers/{12 → 18}/json_utils.h +0 -0
  74. package/src/headers/{13 → 18}/memory_tracker-inl.h +6 -5
  75. package/src/headers/{13 → 18}/memory_tracker.h +0 -7
  76. package/src/headers/{13 → 18}/module_wrap.h +24 -7
  77. package/src/headers/{13 → 18}/node.h +329 -68
  78. package/src/headers/18/node_api.h +288 -0
  79. package/src/headers/18/node_api_internals.h +38 -0
  80. package/src/headers/{12 → 18}/node_api_types.h +12 -9
  81. package/src/headers/{12 → 18}/node_binding.h +0 -0
  82. package/src/headers/18/node_blob.h +191 -0
  83. package/src/headers/18/node_bob-inl.h +37 -0
  84. package/src/headers/18/node_bob.h +111 -0
  85. package/src/headers/{13 → 18}/node_buffer.h +0 -0
  86. package/src/headers/{13 → 18}/node_constants.h +5 -1
  87. package/src/headers/{12 → 18}/node_context_data.h +5 -0
  88. package/src/headers/{12 → 18}/node_contextify.h +37 -2
  89. package/src/headers/{10/node_win32_perfctr_provider.h → 18/node_crypto.h} +30 -31
  90. package/src/headers/{12 → 18}/node_dir.h +0 -0
  91. package/src/headers/{12 → 18}/node_dtrace.h +0 -0
  92. package/src/headers/{12 → 18}/node_errors.h +90 -24
  93. package/src/headers/18/node_external_reference.h +145 -0
  94. package/src/headers/{13 → 18}/node_file-inl.h +38 -21
  95. package/src/headers/{12 → 18}/node_file.h +74 -13
  96. package/src/headers/{13 → 18}/node_http2.h +365 -269
  97. package/src/headers/{12 → 18}/node_http2_state.h +40 -50
  98. package/src/headers/{13 → 18}/node_http_common-inl.h +25 -5
  99. package/src/headers/{13 → 18}/node_http_common.h +24 -20
  100. package/src/headers/{13 → 18}/node_i18n.h +2 -1
  101. package/src/headers/{12 → 18}/node_internals.h +39 -41
  102. package/src/headers/{13 → 18}/node_main_instance.h +15 -18
  103. package/src/headers/{12 → 18}/node_mem-inl.h +0 -0
  104. package/src/headers/{12 → 18}/node_mem.h +1 -1
  105. package/src/headers/{13 → 18}/node_messaging.h +170 -23
  106. package/src/headers/{12 → 18}/node_metadata.h +17 -4
  107. package/src/headers/{12 → 18}/node_mutex.h +77 -1
  108. package/src/headers/{12 → 18}/node_native_module.h +11 -1
  109. package/src/headers/{13 → 18}/node_native_module_env.h +14 -8
  110. package/src/headers/{12 → 18}/node_object_wrap.h +0 -0
  111. package/src/headers/{13 → 18}/node_options-inl.h +51 -21
  112. package/src/headers/{13 → 18}/node_options.h +46 -14
  113. package/src/headers/18/node_perf.h +168 -0
  114. package/src/headers/{12 → 18}/node_perf_common.h +16 -22
  115. package/src/headers/{12 → 18}/node_platform.h +21 -16
  116. package/src/headers/18/node_process-inl.h +26 -0
  117. package/src/headers/18/node_process.h +97 -0
  118. package/src/headers/{13 → 18}/node_report.h +2 -2
  119. package/src/headers/{13 → 18}/node_revert.h +10 -0
  120. package/src/headers/{12 → 18}/node_root_certs.h +439 -651
  121. package/src/headers/18/node_snapshot_builder.h +43 -0
  122. package/src/headers/18/node_snapshotable.h +130 -0
  123. package/src/headers/{12 → 18}/node_sockaddr-inl.h +100 -4
  124. package/src/headers/18/node_sockaddr.h +405 -0
  125. package/src/headers/{12 → 18}/node_stat_watcher.h +7 -1
  126. package/src/headers/{12 → 18}/node_union_bytes.h +0 -0
  127. package/src/headers/{13 → 18}/node_url.h +18 -1
  128. package/src/headers/18/node_v8.h +41 -0
  129. package/src/headers/{12 → 18}/node_v8_platform-inl.h +10 -0
  130. package/src/headers/{13 → 18}/node_version.h +7 -7
  131. package/src/headers/{12 → 18}/node_wasi.h +0 -0
  132. package/src/headers/18/node_wasm_web_api.h +55 -0
  133. package/src/headers/{13 → 18}/node_watchdog.h +0 -0
  134. package/src/headers/{10 → 18}/node_win32_etw_provider-inl.h +7 -6
  135. package/src/headers/{10 → 18}/node_win32_etw_provider.h +0 -0
  136. package/src/headers/{13 → 18}/node_worker.h +24 -17
  137. package/src/headers/{12 → 18}/pipe_wrap.h +2 -0
  138. package/src/headers/{12 → 18}/req_wrap-inl.h +0 -0
  139. package/src/headers/{12 → 18}/req_wrap.h +1 -1
  140. package/src/headers/{12 → 18}/spawn_sync.h +0 -0
  141. package/src/headers/{13 → 18}/stream_base-inl.h +58 -22
  142. package/src/headers/{13 → 18}/stream_base.h +29 -3
  143. package/src/headers/{13 → 18}/stream_pipe.h +8 -3
  144. package/src/headers/{12 → 18}/stream_wrap.h +4 -1
  145. package/src/headers/{13 → 18}/string_bytes.h +0 -7
  146. package/src/headers/{12 → 18}/string_decoder-inl.h +0 -0
  147. package/src/headers/{10 → 18}/string_decoder.h +0 -0
  148. package/src/headers/{13 → 18}/string_search.h +2 -2
  149. package/src/headers/{12 → 18}/tcp_wrap.h +4 -0
  150. package/src/headers/{12 → 18}/threadpoolwork-inl.h +0 -0
  151. package/src/headers/18/timer_wrap-inl.h +32 -0
  152. package/src/headers/18/timer_wrap.h +85 -0
  153. package/src/headers/{13 → 18}/tracing/agent.h +1 -1
  154. package/src/headers/{12 → 18}/tracing/node_trace_buffer.h +0 -0
  155. package/src/headers/{12 → 18}/tracing/node_trace_writer.h +0 -0
  156. package/src/headers/{13 → 18}/tracing/trace_event.h +23 -13
  157. package/src/headers/{12 → 18}/tracing/trace_event_common.h +0 -0
  158. package/src/headers/{12 → 18}/tracing/traced_value.h +0 -0
  159. package/src/headers/{13 → 18}/tty_wrap.h +2 -1
  160. package/src/headers/{13 → 18}/udp_wrap.h +5 -0
  161. package/src/headers/{13 → 18}/util-inl.h +69 -15
  162. package/src/headers/{13 → 18}/util.h +93 -31
  163. package/src/headers/18/v8-fast-api-calls.h +939 -0
  164. package/src/headers/{12 → 18}/v8abbr.h +2 -2
  165. package/src/headers/10/aliased_buffer.h +0 -241
  166. package/src/headers/10/async_wrap-inl.h +0 -106
  167. package/src/headers/10/async_wrap.h +0 -218
  168. package/src/headers/10/base64.h +0 -197
  169. package/src/headers/10/base_object-inl.h +0 -132
  170. package/src/headers/10/base_object.h +0 -115
  171. package/src/headers/10/connect_wrap.h +0 -28
  172. package/src/headers/10/connection_wrap.h +0 -30
  173. package/src/headers/10/debug_utils.h +0 -128
  174. package/src/headers/10/env-inl.h +0 -906
  175. package/src/headers/10/env.h +0 -1046
  176. package/src/headers/10/handle_wrap.h +0 -114
  177. package/src/headers/10/inspector_agent.h +0 -137
  178. package/src/headers/10/inspector_io.h +0 -97
  179. package/src/headers/10/inspector_socket.h +0 -59
  180. package/src/headers/10/inspector_socket_server.h +0 -104
  181. package/src/headers/10/js_stream.h +0 -57
  182. package/src/headers/10/memory_tracker-inl.h +0 -318
  183. package/src/headers/10/memory_tracker.h +0 -246
  184. package/src/headers/10/module_wrap.h +0 -100
  185. package/src/headers/10/node.h +0 -863
  186. package/src/headers/10/node_api.h +0 -752
  187. package/src/headers/10/node_api_types.h +0 -171
  188. package/src/headers/10/node_buffer.h +0 -90
  189. package/src/headers/10/node_code_cache.h +0 -17
  190. package/src/headers/10/node_constants.h +0 -74
  191. package/src/headers/10/node_context_data.h +0 -39
  192. package/src/headers/10/node_contextify.h +0 -141
  193. package/src/headers/10/node_counters.h +0 -59
  194. package/src/headers/10/node_crypto.h +0 -699
  195. package/src/headers/10/node_crypto_bio.h +0 -177
  196. package/src/headers/10/node_crypto_clienthello-inl.h +0 -92
  197. package/src/headers/10/node_crypto_clienthello.h +0 -131
  198. package/src/headers/10/node_crypto_groups.h +0 -416
  199. package/src/headers/10/node_dtrace.h +0 -84
  200. package/src/headers/10/node_errors.h +0 -118
  201. package/src/headers/10/node_file.h +0 -373
  202. package/src/headers/10/node_http2.h +0 -1304
  203. package/src/headers/10/node_http2_state.h +0 -158
  204. package/src/headers/10/node_i18n.h +0 -69
  205. package/src/headers/10/node_internals.h +0 -952
  206. package/src/headers/10/node_javascript.h +0 -41
  207. package/src/headers/10/node_messaging.h +0 -219
  208. package/src/headers/10/node_mutex.h +0 -191
  209. package/src/headers/10/node_object_wrap.h +0 -130
  210. package/src/headers/10/node_options-inl.h +0 -444
  211. package/src/headers/10/node_options.h +0 -397
  212. package/src/headers/10/node_perf.h +0 -134
  213. package/src/headers/10/node_perf_common.h +0 -96
  214. package/src/headers/10/node_persistent.h +0 -30
  215. package/src/headers/10/node_platform.h +0 -170
  216. package/src/headers/10/node_revert.h +0 -75
  217. package/src/headers/10/node_root_certs.h +0 -3393
  218. package/src/headers/10/node_stat_watcher.h +0 -65
  219. package/src/headers/10/node_url.h +0 -193
  220. package/src/headers/10/node_version.h +0 -120
  221. package/src/headers/10/node_watchdog.h +0 -114
  222. package/src/headers/10/node_worker.h +0 -94
  223. package/src/headers/10/pipe_wrap.h +0 -76
  224. package/src/headers/10/req_wrap-inl.h +0 -166
  225. package/src/headers/10/req_wrap.h +0 -61
  226. package/src/headers/10/sharedarraybuffer_metadata.h +0 -67
  227. package/src/headers/10/spawn_sync.h +0 -240
  228. package/src/headers/10/stream_base-inl.h +0 -458
  229. package/src/headers/10/stream_base.h +0 -378
  230. package/src/headers/10/stream_pipe.h +0 -72
  231. package/src/headers/10/stream_wrap.h +0 -130
  232. package/src/headers/10/string_bytes.h +0 -126
  233. package/src/headers/10/string_decoder-inl.h +0 -38
  234. package/src/headers/10/string_search.h +0 -620
  235. package/src/headers/10/tcp_wrap.h +0 -99
  236. package/src/headers/10/tls_wrap.h +0 -195
  237. package/src/headers/10/tracing/agent.h +0 -178
  238. package/src/headers/10/tracing/node_trace_buffer.h +0 -83
  239. package/src/headers/10/tracing/node_trace_writer.h +0 -75
  240. package/src/headers/10/tracing/trace_event.h +0 -706
  241. package/src/headers/10/tracing/trace_event_common.h +0 -1102
  242. package/src/headers/10/tracing/traced_value.h +0 -68
  243. package/src/headers/10/tty_wrap.h +0 -63
  244. package/src/headers/10/udp_wrap.h +0 -102
  245. package/src/headers/10/util-inl.h +0 -459
  246. package/src/headers/10/util.h +0 -508
  247. package/src/headers/10/v8abbr.h +0 -121
  248. package/src/headers/12/aliased_buffer.h +0 -263
  249. package/src/headers/12/debug_utils.h +0 -181
  250. package/src/headers/12/histogram-inl.h +0 -83
  251. package/src/headers/12/histogram.h +0 -98
  252. package/src/headers/12/http_parser_adaptor.h +0 -24
  253. package/src/headers/12/inspector_agent.h +0 -147
  254. package/src/headers/12/inspector_profiler.h +0 -137
  255. package/src/headers/12/js_native_api.h +0 -541
  256. package/src/headers/12/js_native_api_types.h +0 -139
  257. package/src/headers/12/memory_tracker-inl.h +0 -339
  258. package/src/headers/12/memory_tracker.h +0 -283
  259. package/src/headers/12/module_wrap.h +0 -99
  260. package/src/headers/12/node.h +0 -887
  261. package/src/headers/12/node_api.h +0 -239
  262. package/src/headers/12/node_buffer.h +0 -92
  263. package/src/headers/12/node_constants.h +0 -80
  264. package/src/headers/12/node_crypto.h +0 -800
  265. package/src/headers/12/node_crypto_bio.h +0 -195
  266. package/src/headers/12/node_crypto_clienthello-inl.h +0 -91
  267. package/src/headers/12/node_crypto_clienthello.h +0 -132
  268. package/src/headers/12/node_file-inl.h +0 -289
  269. package/src/headers/12/node_http2.h +0 -1311
  270. package/src/headers/12/node_http_parser_impl.h +0 -994
  271. package/src/headers/12/node_i18n.h +0 -144
  272. package/src/headers/12/node_main_instance.h +0 -97
  273. package/src/headers/12/node_messaging.h +0 -227
  274. package/src/headers/12/node_native_module_env.h +0 -65
  275. package/src/headers/12/node_options-inl.h +0 -447
  276. package/src/headers/12/node_options.h +0 -479
  277. package/src/headers/12/node_perf.h +0 -181
  278. package/src/headers/12/node_process.h +0 -41
  279. package/src/headers/12/node_report.h +0 -47
  280. package/src/headers/12/node_revert.h +0 -78
  281. package/src/headers/12/node_sockaddr.h +0 -123
  282. package/src/headers/12/node_url.h +0 -188
  283. package/src/headers/12/node_version.h +0 -98
  284. package/src/headers/12/node_watchdog.h +0 -152
  285. package/src/headers/12/node_win32_etw_provider-inl.h +0 -287
  286. package/src/headers/12/node_win32_etw_provider.h +0 -99
  287. package/src/headers/12/node_worker.h +0 -142
  288. package/src/headers/12/sharedarraybuffer_metadata.h +0 -72
  289. package/src/headers/12/stream_base-inl.h +0 -323
  290. package/src/headers/12/stream_base.h +0 -431
  291. package/src/headers/12/stream_pipe.h +0 -72
  292. package/src/headers/12/string_bytes.h +0 -142
  293. package/src/headers/12/string_decoder.h +0 -50
  294. package/src/headers/12/string_search.h +0 -638
  295. package/src/headers/12/tls_wrap.h +0 -221
  296. package/src/headers/12/tracing/agent.h +0 -195
  297. package/src/headers/12/tracing/trace_event.h +0 -710
  298. package/src/headers/12/tty_wrap.h +0 -64
  299. package/src/headers/12/udp_wrap.h +0 -222
  300. package/src/headers/12/util-inl.h +0 -529
  301. package/src/headers/12/util.h +0 -765
  302. package/src/headers/13/async_wrap-inl.h +0 -94
  303. package/src/headers/13/async_wrap.h +0 -224
  304. package/src/headers/13/base64.h +0 -197
  305. package/src/headers/13/base_object-inl.h +0 -353
  306. package/src/headers/13/base_object.h +0 -229
  307. package/src/headers/13/connect_wrap.h +0 -26
  308. package/src/headers/13/connection_wrap.h +0 -30
  309. package/src/headers/13/debug_utils-inl.h +0 -223
  310. package/src/headers/13/diagnosticfilename-inl.h +0 -33
  311. package/src/headers/13/env-inl.h +0 -1293
  312. package/src/headers/13/env.h +0 -1469
  313. package/src/headers/13/handle_wrap.h +0 -117
  314. package/src/headers/13/histogram-inl.h +0 -83
  315. package/src/headers/13/histogram.h +0 -98
  316. package/src/headers/13/inspector_io.h +0 -78
  317. package/src/headers/13/inspector_socket.h +0 -60
  318. package/src/headers/13/inspector_socket_server.h +0 -110
  319. package/src/headers/13/js_native_api.h +0 -541
  320. package/src/headers/13/js_native_api_v8.h +0 -303
  321. package/src/headers/13/js_native_api_v8_internals.h +0 -38
  322. package/src/headers/13/js_stream.h +0 -52
  323. package/src/headers/13/json_utils.h +0 -160
  324. package/src/headers/13/node_api.h +0 -239
  325. package/src/headers/13/node_api_types.h +0 -44
  326. package/src/headers/13/node_binding.h +0 -99
  327. package/src/headers/13/node_context_data.h +0 -39
  328. package/src/headers/13/node_contextify.h +0 -161
  329. package/src/headers/13/node_crypto.h +0 -800
  330. package/src/headers/13/node_crypto_common.h +0 -138
  331. package/src/headers/13/node_crypto_groups.h +0 -415
  332. package/src/headers/13/node_dir.h +0 -52
  333. package/src/headers/13/node_dtrace.h +0 -86
  334. package/src/headers/13/node_errors.h +0 -210
  335. package/src/headers/13/node_file.h +0 -364
  336. package/src/headers/13/node_http2_state.h +0 -144
  337. package/src/headers/13/node_internals.h +0 -405
  338. package/src/headers/13/node_mem-inl.h +0 -112
  339. package/src/headers/13/node_mem.h +0 -41
  340. package/src/headers/13/node_metadata.h +0 -109
  341. package/src/headers/13/node_mutex.h +0 -247
  342. package/src/headers/13/node_native_module.h +0 -99
  343. package/src/headers/13/node_object_wrap.h +0 -132
  344. package/src/headers/13/node_perf.h +0 -181
  345. package/src/headers/13/node_perf_common.h +0 -97
  346. package/src/headers/13/node_platform.h +0 -190
  347. package/src/headers/13/node_process.h +0 -41
  348. package/src/headers/13/node_root_certs.h +0 -3424
  349. package/src/headers/13/node_sockaddr-inl.h +0 -170
  350. package/src/headers/13/node_sockaddr.h +0 -123
  351. package/src/headers/13/node_stat_watcher.h +0 -66
  352. package/src/headers/13/node_union_bytes.h +0 -103
  353. package/src/headers/13/node_v8_platform-inl.h +0 -184
  354. package/src/headers/13/node_wasi.h +0 -108
  355. package/src/headers/13/node_win32_etw_provider-inl.h +0 -287
  356. package/src/headers/13/node_win32_etw_provider.h +0 -99
  357. package/src/headers/13/pipe_wrap.h +0 -78
  358. package/src/headers/13/req_wrap-inl.h +0 -170
  359. package/src/headers/13/req_wrap.h +0 -77
  360. package/src/headers/13/spawn_sync.h +0 -242
  361. package/src/headers/13/stream_wrap.h +0 -130
  362. package/src/headers/13/string_decoder-inl.h +0 -37
  363. package/src/headers/13/string_decoder.h +0 -50
  364. package/src/headers/13/tcp_wrap.h +0 -101
  365. package/src/headers/13/threadpoolwork-inl.h +0 -57
  366. package/src/headers/13/tracing/node_trace_buffer.h +0 -83
  367. package/src/headers/13/tracing/node_trace_writer.h +0 -75
  368. package/src/headers/13/tracing/trace_event_common.h +0 -1109
  369. package/src/headers/13/tracing/traced_value.h +0 -70
  370. package/src/headers/13/v8abbr.h +0 -124
@@ -1,1102 +0,0 @@
1
- // Copyright 2015 The Chromium Authors. All rights reserved.
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- // This header file defines the set of trace_event macros without specifying
6
- // how the events actually get collected and stored. If you need to expose trace
7
- // events to some other universe, you can copy-and-paste this file as well as
8
- // trace_event.h, modifying the macros contained there as necessary for the
9
- // target platform. The end result is that multiple libraries can funnel events
10
- // through to a shared trace event collector.
11
-
12
- // IMPORTANT: To avoid conflicts, if you need to modify this file for a library,
13
- // land your change in base/ first, and then copy-and-paste it.
14
-
15
- // Trace events are for tracking application performance and resource usage.
16
- // Macros are provided to track:
17
- // Begin and end of function calls
18
- // Counters
19
- //
20
- // Events are issued against categories. Whereas LOG's
21
- // categories are statically defined, TRACE categories are created
22
- // implicitly with a string. For example:
23
- // TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent",
24
- // TRACE_EVENT_SCOPE_THREAD)
25
- //
26
- // It is often the case that one trace may belong in multiple categories at the
27
- // same time. The first argument to the trace can be a comma-separated list of
28
- // categories, forming a category group, like:
29
- //
30
- // TRACE_EVENT_INSTANT0("input,views", "OnMouseOver", TRACE_EVENT_SCOPE_THREAD)
31
- //
32
- // We can enable/disable tracing of OnMouseOver by enabling/disabling either
33
- // category.
34
- //
35
- // Events can be INSTANT, or can be pairs of BEGIN and END in the same scope:
36
- // TRACE_EVENT_BEGIN0("MY_SUBSYSTEM", "SomethingCostly")
37
- // doSomethingCostly()
38
- // TRACE_EVENT_END0("MY_SUBSYSTEM", "SomethingCostly")
39
- // Note: our tools can't always determine the correct BEGIN/END pairs unless
40
- // these are used in the same scope. Use ASYNC_BEGIN/ASYNC_END macros if you
41
- // need them to be in separate scopes.
42
- //
43
- // A common use case is to trace entire function scopes. This
44
- // issues a trace BEGIN and END automatically:
45
- // void doSomethingCostly() {
46
- // TRACE_EVENT0("MY_SUBSYSTEM", "doSomethingCostly");
47
- // ...
48
- // }
49
- //
50
- // Additional parameters can be associated with an event:
51
- // void doSomethingCostly2(int howMuch) {
52
- // TRACE_EVENT1("MY_SUBSYSTEM", "doSomethingCostly",
53
- // "howMuch", howMuch);
54
- // ...
55
- // }
56
- //
57
- // The trace system will automatically add to this information the
58
- // current process id, thread id, and a timestamp in microseconds.
59
- //
60
- // To trace an asynchronous procedure such as an IPC send/receive, use
61
- // ASYNC_BEGIN and ASYNC_END:
62
- // [single threaded sender code]
63
- // static int send_count = 0;
64
- // ++send_count;
65
- // TRACE_EVENT_ASYNC_BEGIN0("ipc", "message", send_count);
66
- // Send(new MyMessage(send_count));
67
- // [receive code]
68
- // void OnMyMessage(send_count) {
69
- // TRACE_EVENT_ASYNC_END0("ipc", "message", send_count);
70
- // }
71
- // The third parameter is a unique ID to match ASYNC_BEGIN/ASYNC_END pairs.
72
- // ASYNC_BEGIN and ASYNC_END can occur on any thread of any traced process.
73
- // Pointers can be used for the ID parameter, and they will be mangled
74
- // internally so that the same pointer on two different processes will not
75
- // match. For example:
76
- // class MyTracedClass {
77
- // public:
78
- // MyTracedClass() {
79
- // TRACE_EVENT_ASYNC_BEGIN0("category", "MyTracedClass", this);
80
- // }
81
- // ~MyTracedClass() {
82
- // TRACE_EVENT_ASYNC_END0("category", "MyTracedClass", this);
83
- // }
84
- // }
85
- //
86
- // Trace event also supports counters, which is a way to track a quantity
87
- // as it varies over time. Counters are created with the following macro:
88
- // TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter", g_myCounterValue);
89
- //
90
- // Counters are process-specific. The macro itself can be issued from any
91
- // thread, however.
92
- //
93
- // Sometimes, you want to track two counters at once. You can do this with two
94
- // counter macros:
95
- // TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter0", g_myCounterValue[0]);
96
- // TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter1", g_myCounterValue[1]);
97
- // Or you can do it with a combined macro:
98
- // TRACE_COUNTER2("MY_SUBSYSTEM", "myCounter",
99
- // "bytesPinned", g_myCounterValue[0],
100
- // "bytesAllocated", g_myCounterValue[1]);
101
- // This indicates to the tracing UI that these counters should be displayed
102
- // in a single graph, as a summed area chart.
103
- //
104
- // Since counters are in a global namespace, you may want to disambiguate with a
105
- // unique ID, by using the TRACE_COUNTER_ID* variations.
106
- //
107
- // By default, trace collection is compiled in, but turned off at runtime.
108
- // Collecting trace data is the responsibility of the embedding
109
- // application. In Chrome's case, navigating to about:tracing will turn on
110
- // tracing and display data collected across all active processes.
111
- //
112
- //
113
- // Memory scoping note:
114
- // Tracing copies the pointers, not the string content, of the strings passed
115
- // in for category_group, name, and arg_names. Thus, the following code will
116
- // cause problems:
117
- // char* str = strdup("importantName");
118
- // TRACE_EVENT_INSTANT0("SUBSYSTEM", str); // BAD!
119
- // free(str); // Trace system now has dangling pointer
120
- //
121
- // To avoid this issue with the |name| and |arg_name| parameters, use the
122
- // TRACE_EVENT_COPY_XXX overloads of the macros at additional runtime overhead.
123
- // Notes: The category must always be in a long-lived char* (i.e. static const).
124
- // The |arg_values|, when used, are always deep copied with the _COPY
125
- // macros.
126
- //
127
- // When are string argument values copied:
128
- // const char* arg_values are only referenced by default:
129
- // TRACE_EVENT1("category", "name",
130
- // "arg1", "literal string is only referenced");
131
- // Use TRACE_STR_COPY to force copying of a const char*:
132
- // TRACE_EVENT1("category", "name",
133
- // "arg1", TRACE_STR_COPY("string will be copied"));
134
- // std::string arg_values are always copied:
135
- // TRACE_EVENT1("category", "name",
136
- // "arg1", std::string("string will be copied"));
137
- //
138
- //
139
- // Convertable notes:
140
- // Converting a large data type to a string can be costly. To help with this,
141
- // the trace framework provides an interface ConvertableToTraceFormat. If you
142
- // inherit from it and implement the AppendAsTraceFormat method the trace
143
- // framework will call back to your object to convert a trace output time. This
144
- // means, if the category for the event is disabled, the conversion will not
145
- // happen.
146
- //
147
- // class MyData : public base::trace_event::ConvertableToTraceFormat {
148
- // public:
149
- // MyData() {}
150
- // void AppendAsTraceFormat(std::string* out) const override {
151
- // out->append("{\"foo\":1}");
152
- // }
153
- // private:
154
- // ~MyData() override {}
155
- // DISALLOW_COPY_AND_ASSIGN(MyData);
156
- // };
157
- //
158
- // TRACE_EVENT1("foo", "bar", "data",
159
- // std::unique_ptr<ConvertableToTraceFormat>(new MyData()));
160
- //
161
- // The trace framework will take ownership if the passed pointer and it will
162
- // be free'd when the trace buffer is flushed.
163
- //
164
- // Note, we only do the conversion when the buffer is flushed, so the provided
165
- // data object should not be modified after it's passed to the trace framework.
166
- //
167
- //
168
- // Thread Safety:
169
- // A thread safe singleton and mutex are used for thread safety. Category
170
- // enabled flags are used to limit the performance impact when the system
171
- // is not enabled.
172
- //
173
- // TRACE_EVENT macros first cache a pointer to a category. The categories are
174
- // statically allocated and safe at all times, even after exit. Fetching a
175
- // category is protected by the TraceLog::lock_. Multiple threads initializing
176
- // the static variable is safe, as they will be serialized by the lock and
177
- // multiple calls will return the same pointer to the category.
178
- //
179
- // Then the category_group_enabled flag is checked. This is a unsigned char, and
180
- // not intended to be multithread safe. It optimizes access to AddTraceEvent
181
- // which is threadsafe internally via TraceLog::lock_. The enabled flag may
182
- // cause some threads to incorrectly call or skip calling AddTraceEvent near
183
- // the time of the system being enabled or disabled. This is acceptable as
184
- // we tolerate some data loss while the system is being enabled/disabled and
185
- // because AddTraceEvent is threadsafe internally and checks the enabled state
186
- // again under lock.
187
- //
188
- // Without the use of these static category pointers and enabled flags all
189
- // trace points would carry a significant performance cost of acquiring a lock
190
- // and resolving the category.
191
-
192
- // Check that nobody includes this file directly. Clients are supposed to
193
- // include the surrounding "trace_event.h" of their project instead.
194
- #if defined(TRACE_EVENT0)
195
- #error "Another copy of this file has already been included."
196
- #endif
197
-
198
- // This will mark the trace event as disabled by default. The user will need
199
- // to explicitly enable the event.
200
- #define TRACE_DISABLED_BY_DEFAULT(name) "disabled-by-default-" name
201
-
202
- // Records a pair of begin and end events called "name" for the current
203
- // scope, with 0, 1 or 2 associated arguments. If the category is not
204
- // enabled, then this does nothing.
205
- // - category and name strings must have application lifetime (statics or
206
- // literals). They may not include " chars.
207
- #define TRACE_EVENT0(category_group, name) \
208
- INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name)
209
- #define TRACE_EVENT_WITH_FLOW0(category_group, name, bind_id, flow_flags) \
210
- INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name, bind_id, \
211
- flow_flags)
212
- #define TRACE_EVENT1(category_group, name, arg1_name, arg1_val) \
213
- INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, arg1_name, arg1_val)
214
- #define TRACE_EVENT_WITH_FLOW1(category_group, name, bind_id, flow_flags, \
215
- arg1_name, arg1_val) \
216
- INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name, bind_id, \
217
- flow_flags, arg1_name, arg1_val)
218
- #define TRACE_EVENT2(category_group, name, arg1_name, arg1_val, arg2_name, \
219
- arg2_val) \
220
- INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, arg1_name, arg1_val, \
221
- arg2_name, arg2_val)
222
- #define TRACE_EVENT_WITH_FLOW2(category_group, name, bind_id, flow_flags, \
223
- arg1_name, arg1_val, arg2_name, arg2_val) \
224
- INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name, bind_id, \
225
- flow_flags, arg1_name, arg1_val, \
226
- arg2_name, arg2_val)
227
-
228
- // Records a single event called "name" immediately, with 0, 1 or 2
229
- // associated arguments. If the category is not enabled, then this
230
- // does nothing.
231
- // - category and name strings must have application lifetime (statics or
232
- // literals). They may not include " chars.
233
- #define TRACE_EVENT_INSTANT0(category_group, name, scope) \
234
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
235
- TRACE_EVENT_FLAG_NONE | scope)
236
- #define TRACE_EVENT_INSTANT1(category_group, name, scope, arg1_name, arg1_val) \
237
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
238
- TRACE_EVENT_FLAG_NONE | scope, arg1_name, arg1_val)
239
- #define TRACE_EVENT_INSTANT2(category_group, name, scope, arg1_name, arg1_val, \
240
- arg2_name, arg2_val) \
241
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
242
- TRACE_EVENT_FLAG_NONE | scope, arg1_name, arg1_val, \
243
- arg2_name, arg2_val)
244
- #define TRACE_EVENT_COPY_INSTANT0(category_group, name, scope) \
245
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
246
- TRACE_EVENT_FLAG_COPY | scope)
247
- #define TRACE_EVENT_COPY_INSTANT1(category_group, name, scope, arg1_name, \
248
- arg1_val) \
249
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
250
- TRACE_EVENT_FLAG_COPY | scope, arg1_name, arg1_val)
251
- #define TRACE_EVENT_COPY_INSTANT2(category_group, name, scope, arg1_name, \
252
- arg1_val, arg2_name, arg2_val) \
253
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \
254
- TRACE_EVENT_FLAG_COPY | scope, arg1_name, arg1_val, \
255
- arg2_name, arg2_val)
256
-
257
- #define TRACE_EVENT_INSTANT_WITH_TIMESTAMP0(category_group, name, scope, \
258
- timestamp) \
259
- INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \
260
- TRACE_EVENT_PHASE_INSTANT, category_group, name, timestamp, \
261
- TRACE_EVENT_FLAG_NONE | scope)
262
-
263
- #define TRACE_EVENT_INSTANT_WITH_TIMESTAMP1(category_group, name, scope, \
264
- timestamp, arg_name, arg_val) \
265
- INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \
266
- TRACE_EVENT_PHASE_INSTANT, category_group, name, timestamp, \
267
- TRACE_EVENT_FLAG_NONE | scope, arg_name, arg_val)
268
-
269
- // Records a single BEGIN event called "name" immediately, with 0, 1 or 2
270
- // associated arguments. If the category is not enabled, then this
271
- // does nothing.
272
- // - category and name strings must have application lifetime (statics or
273
- // literals). They may not include " chars.
274
- #define TRACE_EVENT_BEGIN(category_group, name, ...) \
275
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \
276
- TRACE_EVENT_FLAG_NONE, ##__VA_ARGS__)
277
- #define TRACE_EVENT_BEGIN0(category_group, name) \
278
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \
279
- TRACE_EVENT_FLAG_NONE)
280
- #define TRACE_EVENT_BEGIN1(category_group, name, arg1_name, arg1_val) \
281
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \
282
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
283
- #define TRACE_EVENT_BEGIN2(category_group, name, arg1_name, arg1_val, \
284
- arg2_name, arg2_val) \
285
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \
286
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \
287
- arg2_name, arg2_val)
288
- #define TRACE_EVENT_COPY_BEGIN0(category_group, name) \
289
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \
290
- TRACE_EVENT_FLAG_COPY)
291
- #define TRACE_EVENT_COPY_BEGIN1(category_group, name, arg1_name, arg1_val) \
292
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \
293
- TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
294
- #define TRACE_EVENT_COPY_BEGIN2(category_group, name, arg1_name, arg1_val, \
295
- arg2_name, arg2_val) \
296
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \
297
- TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \
298
- arg2_name, arg2_val)
299
-
300
- // Similar to TRACE_EVENT_BEGINx but with a custom |at| timestamp provided.
301
- // - |id| is used to match the _BEGIN event with the _END event.
302
- // Events are considered to match if their category_group, name and id values
303
- // all match. |id| must either be a pointer or an integer value up to 64 bits.
304
- // If it's a pointer, the bits will be xored with a hash of the process ID so
305
- // that the same pointer on two different processes will not collide.
306
- #define TRACE_EVENT_BEGIN_WITH_ID_TID_AND_TIMESTAMP0(category_group, name, id, \
307
- thread_id, timestamp) \
308
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
309
- TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id, \
310
- timestamp, TRACE_EVENT_FLAG_NONE)
311
- #define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP0( \
312
- category_group, name, id, thread_id, timestamp) \
313
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
314
- TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id, \
315
- timestamp, TRACE_EVENT_FLAG_COPY)
316
- #define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP1( \
317
- category_group, name, id, thread_id, timestamp, arg1_name, arg1_val) \
318
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
319
- TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id, \
320
- timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
321
- #define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP2( \
322
- category_group, name, id, thread_id, timestamp, arg1_name, arg1_val, \
323
- arg2_name, arg2_val) \
324
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
325
- TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id, \
326
- timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, \
327
- arg2_val)
328
-
329
- // Records a single END event for "name" immediately. If the category
330
- // is not enabled, then this does nothing.
331
- // - category and name strings must have application lifetime (statics or
332
- // literals). They may not include " chars.
333
- #define TRACE_EVENT_END(category_group, name, ...) \
334
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \
335
- TRACE_EVENT_FLAG_NONE, ##__VA_ARGS__)
336
- #define TRACE_EVENT_END0(category_group, name) \
337
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \
338
- TRACE_EVENT_FLAG_NONE)
339
- #define TRACE_EVENT_END1(category_group, name, arg1_name, arg1_val) \
340
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \
341
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
342
- #define TRACE_EVENT_END2(category_group, name, arg1_name, arg1_val, arg2_name, \
343
- arg2_val) \
344
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \
345
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \
346
- arg2_name, arg2_val)
347
- #define TRACE_EVENT_COPY_END0(category_group, name) \
348
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \
349
- TRACE_EVENT_FLAG_COPY)
350
- #define TRACE_EVENT_COPY_END1(category_group, name, arg1_name, arg1_val) \
351
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \
352
- TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
353
- #define TRACE_EVENT_COPY_END2(category_group, name, arg1_name, arg1_val, \
354
- arg2_name, arg2_val) \
355
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \
356
- TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \
357
- arg2_name, arg2_val)
358
-
359
- #define TRACE_EVENT_MARK_WITH_TIMESTAMP0(category_group, name, timestamp) \
360
- INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \
361
- TRACE_EVENT_PHASE_MARK, category_group, name, timestamp, \
362
- TRACE_EVENT_FLAG_NONE)
363
-
364
- #define TRACE_EVENT_MARK_WITH_TIMESTAMP1(category_group, name, timestamp, \
365
- arg1_name, arg1_val) \
366
- INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \
367
- TRACE_EVENT_PHASE_MARK, category_group, name, timestamp, \
368
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
369
-
370
- #define TRACE_EVENT_MARK_WITH_TIMESTAMP2( \
371
- category_group, name, timestamp, arg1_name, arg1_val, arg2_name, arg2_val) \
372
- INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \
373
- TRACE_EVENT_PHASE_MARK, category_group, name, timestamp, \
374
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
375
-
376
- #define TRACE_EVENT_COPY_MARK(category_group, name) \
377
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_MARK, category_group, name, \
378
- TRACE_EVENT_FLAG_COPY)
379
-
380
- #define TRACE_EVENT_COPY_MARK_WITH_TIMESTAMP(category_group, name, timestamp) \
381
- INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \
382
- TRACE_EVENT_PHASE_MARK, category_group, name, timestamp, \
383
- TRACE_EVENT_FLAG_COPY)
384
-
385
- // Similar to TRACE_EVENT_ENDx but with a custom |at| timestamp provided.
386
- // - |id| is used to match the _BEGIN event with the _END event.
387
- // Events are considered to match if their category_group, name and id values
388
- // all match. |id| must either be a pointer or an integer value up to 64 bits.
389
- // If it's a pointer, the bits will be xored with a hash of the process ID so
390
- // that the same pointer on two different processes will not collide.
391
- #define TRACE_EVENT_END_WITH_ID_TID_AND_TIMESTAMP0(category_group, name, id, \
392
- thread_id, timestamp) \
393
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
394
- TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id, \
395
- timestamp, TRACE_EVENT_FLAG_NONE)
396
- #define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP0( \
397
- category_group, name, id, thread_id, timestamp) \
398
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
399
- TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id, \
400
- timestamp, TRACE_EVENT_FLAG_COPY)
401
- #define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP1( \
402
- category_group, name, id, thread_id, timestamp, arg1_name, arg1_val) \
403
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
404
- TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id, \
405
- timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
406
- #define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP2( \
407
- category_group, name, id, thread_id, timestamp, arg1_name, arg1_val, \
408
- arg2_name, arg2_val) \
409
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
410
- TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id, \
411
- timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, \
412
- arg2_val)
413
-
414
- // Records the value of a counter called "name" immediately. Value
415
- // must be representable as a 32 bit integer.
416
- // - category and name strings must have application lifetime (statics or
417
- // literals). They may not include " chars.
418
- #define TRACE_COUNTER1(category_group, name, value) \
419
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
420
- TRACE_EVENT_FLAG_NONE, "value", \
421
- static_cast<int>(value))
422
- #define TRACE_COPY_COUNTER1(category_group, name, value) \
423
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
424
- TRACE_EVENT_FLAG_COPY, "value", \
425
- static_cast<int>(value))
426
-
427
- // Records the values of a multi-parted counter called "name" immediately.
428
- // The UI will treat value1 and value2 as parts of a whole, displaying their
429
- // values as a stacked-bar chart.
430
- // - category and name strings must have application lifetime (statics or
431
- // literals). They may not include " chars.
432
- #define TRACE_COUNTER2(category_group, name, value1_name, value1_val, \
433
- value2_name, value2_val) \
434
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
435
- TRACE_EVENT_FLAG_NONE, value1_name, \
436
- static_cast<int>(value1_val), value2_name, \
437
- static_cast<int>(value2_val))
438
- #define TRACE_COPY_COUNTER2(category_group, name, value1_name, value1_val, \
439
- value2_name, value2_val) \
440
- INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \
441
- TRACE_EVENT_FLAG_COPY, value1_name, \
442
- static_cast<int>(value1_val), value2_name, \
443
- static_cast<int>(value2_val))
444
-
445
- // Similar to TRACE_COUNTERx, but with a custom |timestamp| provided.
446
- #define TRACE_COUNTER_WITH_TIMESTAMP1(category_group, name, timestamp, value) \
447
- INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \
448
- TRACE_EVENT_PHASE_COUNTER, category_group, name, timestamp, \
449
- TRACE_EVENT_FLAG_NONE, "value", static_cast<int>(value))
450
-
451
- #define TRACE_COUNTER_WITH_TIMESTAMP2(category_group, name, timestamp, \
452
- value1_name, value1_val, value2_name, \
453
- value2_val) \
454
- INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \
455
- TRACE_EVENT_PHASE_COUNTER, category_group, name, timestamp, \
456
- TRACE_EVENT_FLAG_NONE, value1_name, static_cast<int>(value1_val), \
457
- value2_name, static_cast<int>(value2_val))
458
-
459
- // Records the value of a counter called "name" immediately. Value
460
- // must be representable as a 32 bit integer.
461
- // - category and name strings must have application lifetime (statics or
462
- // literals). They may not include " chars.
463
- // - |id| is used to disambiguate counters with the same name. It must either
464
- // be a pointer or an integer value up to 64 bits. If it's a pointer, the bits
465
- // will be xored with a hash of the process ID so that the same pointer on
466
- // two different processes will not collide.
467
- #define TRACE_COUNTER_ID1(category_group, name, id, value) \
468
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \
469
- name, id, TRACE_EVENT_FLAG_NONE, "value", \
470
- static_cast<int>(value))
471
- #define TRACE_COPY_COUNTER_ID1(category_group, name, id, value) \
472
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \
473
- name, id, TRACE_EVENT_FLAG_COPY, "value", \
474
- static_cast<int>(value))
475
-
476
- // Records the values of a multi-parted counter called "name" immediately.
477
- // The UI will treat value1 and value2 as parts of a whole, displaying their
478
- // values as a stacked-bar chart.
479
- // - category and name strings must have application lifetime (statics or
480
- // literals). They may not include " chars.
481
- // - |id| is used to disambiguate counters with the same name. It must either
482
- // be a pointer or an integer value up to 64 bits. If it's a pointer, the bits
483
- // will be xored with a hash of the process ID so that the same pointer on
484
- // two different processes will not collide.
485
- #define TRACE_COUNTER_ID2(category_group, name, id, value1_name, value1_val, \
486
- value2_name, value2_val) \
487
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \
488
- name, id, TRACE_EVENT_FLAG_NONE, \
489
- value1_name, static_cast<int>(value1_val), \
490
- value2_name, static_cast<int>(value2_val))
491
- #define TRACE_COPY_COUNTER_ID2(category_group, name, id, value1_name, \
492
- value1_val, value2_name, value2_val) \
493
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \
494
- name, id, TRACE_EVENT_FLAG_COPY, \
495
- value1_name, static_cast<int>(value1_val), \
496
- value2_name, static_cast<int>(value2_val))
497
-
498
- // TRACE_EVENT_SAMPLE_* events are injected by the sampling profiler.
499
- #define TRACE_EVENT_SAMPLE_WITH_TID_AND_TIMESTAMP0(category_group, name, \
500
- thread_id, timestamp) \
501
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
502
- TRACE_EVENT_PHASE_SAMPLE, category_group, name, 0, thread_id, timestamp, \
503
- TRACE_EVENT_FLAG_NONE)
504
-
505
- #define TRACE_EVENT_SAMPLE_WITH_TID_AND_TIMESTAMP1( \
506
- category_group, name, thread_id, timestamp, arg1_name, arg1_val) \
507
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
508
- TRACE_EVENT_PHASE_SAMPLE, category_group, name, 0, thread_id, timestamp, \
509
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
510
-
511
- #define TRACE_EVENT_SAMPLE_WITH_TID_AND_TIMESTAMP2(category_group, name, \
512
- thread_id, timestamp, \
513
- arg1_name, arg1_val, \
514
- arg2_name, arg2_val) \
515
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
516
- TRACE_EVENT_PHASE_SAMPLE, category_group, name, 0, thread_id, timestamp, \
517
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
518
-
519
- #define TRACE_EVENT_SAMPLE_WITH_ID1(category_group, name, id, arg1_name, \
520
- arg1_val) \
521
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_SAMPLE, category_group, \
522
- name, id, TRACE_EVENT_FLAG_NONE, arg1_name, \
523
- arg1_val)
524
-
525
- // ASYNC_STEP_* APIs should be only used by legacy code. New code should
526
- // consider using NESTABLE_ASYNC_* APIs to describe substeps within an async
527
- // event.
528
- // Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2
529
- // associated arguments. If the category is not enabled, then this
530
- // does nothing.
531
- // - category and name strings must have application lifetime (statics or
532
- // literals). They may not include " chars.
533
- // - |id| is used to match the ASYNC_BEGIN event with the ASYNC_END event. ASYNC
534
- // events are considered to match if their category_group, name and id values
535
- // all match. |id| must either be a pointer or an integer value up to 64 bits.
536
- // If it's a pointer, the bits will be xored with a hash of the process ID so
537
- // that the same pointer on two different processes will not collide.
538
- //
539
- // An asynchronous operation can consist of multiple phases. The first phase is
540
- // defined by the ASYNC_BEGIN calls. Additional phases can be defined using the
541
- // ASYNC_STEP_INTO or ASYNC_STEP_PAST macros. The ASYNC_STEP_INTO macro will
542
- // annotate the block following the call. The ASYNC_STEP_PAST macro will
543
- // annotate the block prior to the call. Note that any particular event must use
544
- // only STEP_INTO or STEP_PAST macros; they can not mix and match. When the
545
- // operation completes, call ASYNC_END.
546
- //
547
- // An ASYNC trace typically occurs on a single thread (if not, they will only be
548
- // drawn on the thread defined in the ASYNC_BEGIN event), but all events in that
549
- // operation must use the same |name| and |id|. Each step can have its own
550
- // args.
551
- #define TRACE_EVENT_ASYNC_BEGIN0(category_group, name, id) \
552
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \
553
- category_group, name, id, \
554
- TRACE_EVENT_FLAG_NONE)
555
- #define TRACE_EVENT_ASYNC_BEGIN1(category_group, name, id, arg1_name, \
556
- arg1_val) \
557
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \
558
- category_group, name, id, \
559
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
560
- #define TRACE_EVENT_ASYNC_BEGIN2(category_group, name, id, arg1_name, \
561
- arg1_val, arg2_name, arg2_val) \
562
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
563
- TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \
564
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
565
- #define TRACE_EVENT_COPY_ASYNC_BEGIN0(category_group, name, id) \
566
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \
567
- category_group, name, id, \
568
- TRACE_EVENT_FLAG_COPY)
569
- #define TRACE_EVENT_COPY_ASYNC_BEGIN1(category_group, name, id, arg1_name, \
570
- arg1_val) \
571
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \
572
- category_group, name, id, \
573
- TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
574
- #define TRACE_EVENT_COPY_ASYNC_BEGIN2(category_group, name, id, arg1_name, \
575
- arg1_val, arg2_name, arg2_val) \
576
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
577
- TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \
578
- TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val)
579
-
580
- // Similar to TRACE_EVENT_ASYNC_BEGINx but with a custom |at| timestamp
581
- // provided.
582
- #define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, id, \
583
- timestamp) \
584
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
585
- TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \
586
- TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
587
- #define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( \
588
- category_group, name, id, timestamp, arg1_name, arg1_val) \
589
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
590
- TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \
591
- TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
592
- arg1_name, arg1_val)
593
- #define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP2(category_group, name, id, \
594
- timestamp, arg1_name, \
595
- arg1_val, arg2_name, arg2_val) \
596
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
597
- TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \
598
- TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
599
- arg1_name, arg1_val, arg2_name, arg2_val)
600
- #define TRACE_EVENT_COPY_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, id, \
601
- timestamp) \
602
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
603
- TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \
604
- TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY)
605
-
606
- // Records a single ASYNC_STEP_INTO event for |step| immediately. If the
607
- // category is not enabled, then this does nothing. The |name| and |id| must
608
- // match the ASYNC_BEGIN event above. The |step| param identifies this step
609
- // within the async event. This should be called at the beginning of the next
610
- // phase of an asynchronous operation. The ASYNC_BEGIN event must not have any
611
- // ASYNC_STEP_PAST events.
612
- #define TRACE_EVENT_ASYNC_STEP_INTO0(category_group, name, id, step) \
613
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, \
614
- category_group, name, id, \
615
- TRACE_EVENT_FLAG_NONE, "step", step)
616
- #define TRACE_EVENT_ASYNC_STEP_INTO1(category_group, name, id, step, \
617
- arg1_name, arg1_val) \
618
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
619
- TRACE_EVENT_PHASE_ASYNC_STEP_INTO, category_group, name, id, \
620
- TRACE_EVENT_FLAG_NONE, "step", step, arg1_name, arg1_val)
621
-
622
- // Similar to TRACE_EVENT_ASYNC_STEP_INTOx but with a custom |at| timestamp
623
- // provided.
624
- #define TRACE_EVENT_ASYNC_STEP_INTO_WITH_TIMESTAMP0(category_group, name, id, \
625
- step, timestamp) \
626
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
627
- TRACE_EVENT_PHASE_ASYNC_STEP_INTO, category_group, name, id, \
628
- TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
629
- "step", step)
630
-
631
- // Records a single ASYNC_STEP_PAST event for |step| immediately. If the
632
- // category is not enabled, then this does nothing. The |name| and |id| must
633
- // match the ASYNC_BEGIN event above. The |step| param identifies this step
634
- // within the async event. This should be called at the beginning of the next
635
- // phase of an asynchronous operation. The ASYNC_BEGIN event must not have any
636
- // ASYNC_STEP_INTO events.
637
- #define TRACE_EVENT_ASYNC_STEP_PAST0(category_group, name, id, step) \
638
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_PAST, \
639
- category_group, name, id, \
640
- TRACE_EVENT_FLAG_NONE, "step", step)
641
- #define TRACE_EVENT_ASYNC_STEP_PAST1(category_group, name, id, step, \
642
- arg1_name, arg1_val) \
643
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
644
- TRACE_EVENT_PHASE_ASYNC_STEP_PAST, category_group, name, id, \
645
- TRACE_EVENT_FLAG_NONE, "step", step, arg1_name, arg1_val)
646
-
647
- // Records a single ASYNC_END event for "name" immediately. If the category
648
- // is not enabled, then this does nothing.
649
- #define TRACE_EVENT_ASYNC_END0(category_group, name, id) \
650
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \
651
- category_group, name, id, \
652
- TRACE_EVENT_FLAG_NONE)
653
- #define TRACE_EVENT_ASYNC_END1(category_group, name, id, arg1_name, arg1_val) \
654
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \
655
- category_group, name, id, \
656
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
657
- #define TRACE_EVENT_ASYNC_END2(category_group, name, id, arg1_name, arg1_val, \
658
- arg2_name, arg2_val) \
659
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
660
- TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \
661
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
662
- #define TRACE_EVENT_COPY_ASYNC_END0(category_group, name, id) \
663
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \
664
- category_group, name, id, \
665
- TRACE_EVENT_FLAG_COPY)
666
- #define TRACE_EVENT_COPY_ASYNC_END1(category_group, name, id, arg1_name, \
667
- arg1_val) \
668
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \
669
- category_group, name, id, \
670
- TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
671
- #define TRACE_EVENT_COPY_ASYNC_END2(category_group, name, id, arg1_name, \
672
- arg1_val, arg2_name, arg2_val) \
673
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
674
- TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \
675
- TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val)
676
-
677
- // Similar to TRACE_EVENT_ASYNC_ENDx but with a custom |at| timestamp provided.
678
- #define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP0(category_group, name, id, \
679
- timestamp) \
680
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
681
- TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \
682
- TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
683
- #define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP1(category_group, name, id, \
684
- timestamp, arg1_name, arg1_val) \
685
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
686
- TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \
687
- TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
688
- arg1_name, arg1_val)
689
- #define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP2(category_group, name, id, \
690
- timestamp, arg1_name, arg1_val, \
691
- arg2_name, arg2_val) \
692
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
693
- TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \
694
- TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
695
- arg1_name, arg1_val, arg2_name, arg2_val)
696
-
697
- // NESTABLE_ASYNC_* APIs are used to describe an async operation, which can
698
- // be nested within a NESTABLE_ASYNC event and/or have inner NESTABLE_ASYNC
699
- // events.
700
- // - category and name strings must have application lifetime (statics or
701
- // literals). They may not include " chars.
702
- // - A pair of NESTABLE_ASYNC_BEGIN event and NESTABLE_ASYNC_END event is
703
- // considered as a match if their category_group, name and id all match.
704
- // - |id| must either be a pointer or an integer value up to 64 bits.
705
- // If it's a pointer, the bits will be xored with a hash of the process ID so
706
- // that the same pointer on two different processes will not collide.
707
- // - |id| is used to match a child NESTABLE_ASYNC event with its parent
708
- // NESTABLE_ASYNC event. Therefore, events in the same nested event tree must
709
- // be logged using the same id and category_group.
710
- //
711
- // Unmatched NESTABLE_ASYNC_END event will be parsed as an event that starts
712
- // at the first NESTABLE_ASYNC event of that id, and unmatched
713
- // NESTABLE_ASYNC_BEGIN event will be parsed as an event that ends at the last
714
- // NESTABLE_ASYNC event of that id. Corresponding warning messages for
715
- // unmatched events will be shown in the analysis view.
716
-
717
- // Records a single NESTABLE_ASYNC_BEGIN event called "name" immediately, with
718
- // 0, 1 or 2 associated arguments. If the category is not enabled, then this
719
- // does nothing.
720
- #define TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(category_group, name, id) \
721
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \
722
- category_group, name, id, \
723
- TRACE_EVENT_FLAG_NONE)
724
- #define TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(category_group, name, id, arg1_name, \
725
- arg1_val) \
726
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \
727
- category_group, name, id, \
728
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
729
- #define TRACE_EVENT_NESTABLE_ASYNC_BEGIN2(category_group, name, id, arg1_name, \
730
- arg1_val, arg2_name, arg2_val) \
731
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
732
- TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \
733
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
734
- // Records a single NESTABLE_ASYNC_END event called "name" immediately, with 0
735
- // or 2 associated arguments. If the category is not enabled, then this does
736
- // nothing.
737
- #define TRACE_EVENT_NESTABLE_ASYNC_END0(category_group, name, id) \
738
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \
739
- category_group, name, id, \
740
- TRACE_EVENT_FLAG_NONE)
741
- // Records a single NESTABLE_ASYNC_END event called "name" immediately, with 1
742
- // associated argument. If the category is not enabled, then this does nothing.
743
- #define TRACE_EVENT_NESTABLE_ASYNC_END1(category_group, name, id, arg1_name, \
744
- arg1_val) \
745
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \
746
- category_group, name, id, \
747
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
748
- #define TRACE_EVENT_NESTABLE_ASYNC_END2(category_group, name, id, arg1_name, \
749
- arg1_val, arg2_name, arg2_val) \
750
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
751
- TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \
752
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
753
-
754
- // Records a single NESTABLE_ASYNC_INSTANT event called "name" immediately,
755
- // with none, one or two associated argument. If the category is not enabled,
756
- // then this does nothing.
757
- #define TRACE_EVENT_NESTABLE_ASYNC_INSTANT0(category_group, name, id) \
758
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, \
759
- category_group, name, id, \
760
- TRACE_EVENT_FLAG_NONE)
761
-
762
- #define TRACE_EVENT_NESTABLE_ASYNC_INSTANT1(category_group, name, id, \
763
- arg1_name, arg1_val) \
764
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, \
765
- category_group, name, id, \
766
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
767
-
768
- #define TRACE_EVENT_NESTABLE_ASYNC_INSTANT2( \
769
- category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \
770
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
771
- TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, category_group, name, id, \
772
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
773
-
774
- #define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TTS2( \
775
- category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \
776
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
777
- TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \
778
- TRACE_EVENT_FLAG_ASYNC_TTS | TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \
779
- arg2_name, arg2_val)
780
- #define TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TTS2( \
781
- category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \
782
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
783
- TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \
784
- TRACE_EVENT_FLAG_ASYNC_TTS | TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \
785
- arg2_name, arg2_val)
786
-
787
- // Similar to TRACE_EVENT_NESTABLE_ASYNC_{BEGIN,END}x but with a custom
788
- // |timestamp| provided.
789
- #define TRACE_EVENT_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, \
790
- id, timestamp) \
791
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
792
- TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \
793
- TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
794
- #define TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP0(category_group, name, \
795
- id, timestamp) \
796
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
797
- TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \
798
- TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
799
- #define TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP1( \
800
- category_group, name, id, timestamp, arg1_name, arg1_val) \
801
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
802
- TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \
803
- TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
804
- arg1_name, arg1_val)
805
- #define TRACE_EVENT_NESTABLE_ASYNC_INSTANT_WITH_TIMESTAMP0( \
806
- category_group, name, id, timestamp) \
807
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
808
- TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, category_group, name, id, \
809
- TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE)
810
- #define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0( \
811
- category_group, name, id, timestamp) \
812
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
813
- TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \
814
- TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY)
815
- #define TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TIMESTAMP0( \
816
- category_group, name, id, timestamp) \
817
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
818
- TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \
819
- TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY)
820
-
821
- // Records a single FLOW_BEGIN event called "name" immediately, with 0, 1 or 2
822
- // associated arguments. If the category is not enabled, then this
823
- // does nothing.
824
- // - category and name strings must have application lifetime (statics or
825
- // literals). They may not include " chars.
826
- // - |id| is used to match the FLOW_BEGIN event with the FLOW_END event. FLOW
827
- // events are considered to match if their category_group, name and id values
828
- // all match. |id| must either be a pointer or an integer value up to 64 bits.
829
- // If it's a pointer, the bits will be xored with a hash of the process ID so
830
- // that the same pointer on two different processes will not collide.
831
- // FLOW events are different from ASYNC events in how they are drawn by the
832
- // tracing UI. A FLOW defines asynchronous data flow, such as posting a task
833
- // (FLOW_BEGIN) and later executing that task (FLOW_END). Expect FLOWs to be
834
- // drawn as lines or arrows from FLOW_BEGIN scopes to FLOW_END scopes. Similar
835
- // to ASYNC, a FLOW can consist of multiple phases. The first phase is defined
836
- // by the FLOW_BEGIN calls. Additional phases can be defined using the FLOW_STEP
837
- // macros. When the operation completes, call FLOW_END. An async operation can
838
- // span threads and processes, but all events in that operation must use the
839
- // same |name| and |id|. Each event can have its own args.
840
- #define TRACE_EVENT_FLOW_BEGIN0(category_group, name, id) \
841
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \
842
- category_group, name, id, \
843
- TRACE_EVENT_FLAG_NONE)
844
- #define TRACE_EVENT_FLOW_BEGIN1(category_group, name, id, arg1_name, arg1_val) \
845
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \
846
- category_group, name, id, \
847
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val)
848
- #define TRACE_EVENT_FLOW_BEGIN2(category_group, name, id, arg1_name, arg1_val, \
849
- arg2_name, arg2_val) \
850
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
851
- TRACE_EVENT_PHASE_FLOW_BEGIN, category_group, name, id, \
852
- TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val)
853
- #define TRACE_EVENT_COPY_FLOW_BEGIN0(category_group, name, id) \
854
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \
855
- category_group, name, id, \
856
- TRACE_EVENT_FLAG_COPY)
857
- #define TRACE_EVENT_COPY_FLOW_BEGIN1(category_group, name, id, arg1_name, \
858
- arg1_val) \
859
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \
860
- category_group, name, id, \
861
- TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val)
862
- #define TRACE_EVENT_COPY_FLOW_BEGIN2(category_group, name, id, arg1_name, \
863
- arg1_val, arg2_name, arg2_val) \
864
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
865
- TRACE_EVENT_PHASE_FLOW_BEGIN, category_group, name, id, \
866
- TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val)
867
-
868
- // Records a single FLOW_STEP event for |step| immediately. If the category
869
- // is not enabled, then this does nothing. The |name| and |id| must match the
870
- // FLOW_BEGIN event above. The |step| param identifies this step within the
871
- // async event. This should be called at the beginning of the next phase of an
872
- // asynchronous operation.
873
- #define TRACE_EVENT_FLOW_STEP0(category_group, name, id, step) \
874
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \
875
- category_group, name, id, \
876
- TRACE_EVENT_FLAG_NONE, "step", step)
877
- #define TRACE_EVENT_FLOW_STEP1(category_group, name, id, step, arg1_name, \
878
- arg1_val) \
879
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
880
- TRACE_EVENT_PHASE_FLOW_STEP, category_group, name, id, \
881
- TRACE_EVENT_FLAG_NONE, "step", step, arg1_name, arg1_val)
882
- #define TRACE_EVENT_COPY_FLOW_STEP0(category_group, name, id, step) \
883
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \
884
- category_group, name, id, \
885
- TRACE_EVENT_FLAG_COPY, "step", step)
886
- #define TRACE_EVENT_COPY_FLOW_STEP1(category_group, name, id, step, arg1_name, \
887
- arg1_val) \
888
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
889
- TRACE_EVENT_PHASE_FLOW_STEP, category_group, name, id, \
890
- TRACE_EVENT_FLAG_COPY, "step", step, arg1_name, arg1_val)
891
-
892
- // Records a single FLOW_END event for "name" immediately. If the category
893
- // is not enabled, then this does nothing.
894
- #define TRACE_EVENT_FLOW_END0(category_group, name, id) \
895
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \
896
- name, id, TRACE_EVENT_FLAG_NONE)
897
- #define TRACE_EVENT_FLOW_END_BIND_TO_ENCLOSING0(category_group, name, id) \
898
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \
899
- name, id, \
900
- TRACE_EVENT_FLAG_BIND_TO_ENCLOSING)
901
- #define TRACE_EVENT_FLOW_END1(category_group, name, id, arg1_name, arg1_val) \
902
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \
903
- name, id, TRACE_EVENT_FLAG_NONE, arg1_name, \
904
- arg1_val)
905
- #define TRACE_EVENT_FLOW_END2(category_group, name, id, arg1_name, arg1_val, \
906
- arg2_name, arg2_val) \
907
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \
908
- name, id, TRACE_EVENT_FLAG_NONE, arg1_name, \
909
- arg1_val, arg2_name, arg2_val)
910
- #define TRACE_EVENT_COPY_FLOW_END0(category_group, name, id) \
911
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \
912
- name, id, TRACE_EVENT_FLAG_COPY)
913
- #define TRACE_EVENT_COPY_FLOW_END1(category_group, name, id, arg1_name, \
914
- arg1_val) \
915
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \
916
- name, id, TRACE_EVENT_FLAG_COPY, arg1_name, \
917
- arg1_val)
918
- #define TRACE_EVENT_COPY_FLOW_END2(category_group, name, id, arg1_name, \
919
- arg1_val, arg2_name, arg2_val) \
920
- INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \
921
- name, id, TRACE_EVENT_FLAG_COPY, arg1_name, \
922
- arg1_val, arg2_name, arg2_val)
923
-
924
- // Special trace event macro to trace task execution with the location where it
925
- // was posted from.
926
- #define TRACE_TASK_EXECUTION(run_function, task) \
927
- INTERNAL_TRACE_TASK_EXECUTION(run_function, task)
928
-
929
- // TRACE_EVENT_METADATA* events are information related to other
930
- // injected events, not events in their own right.
931
- #define TRACE_EVENT_METADATA1(category_group, name, arg1_name, arg1_val) \
932
- INTERNAL_TRACE_EVENT_METADATA_ADD(category_group, name, arg1_name, arg1_val)
933
-
934
- // Records a clock sync event.
935
- #define TRACE_EVENT_CLOCK_SYNC_RECEIVER(sync_id) \
936
- INTERNAL_TRACE_EVENT_ADD( \
937
- TRACE_EVENT_PHASE_CLOCK_SYNC, "__metadata", "clock_sync", \
938
- TRACE_EVENT_FLAG_NONE, "sync_id", sync_id)
939
- #define TRACE_EVENT_CLOCK_SYNC_ISSUER(sync_id, issue_ts, issue_end_ts) \
940
- INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \
941
- TRACE_EVENT_PHASE_CLOCK_SYNC, "__metadata", "clock_sync", \
942
- issue_end_ts, TRACE_EVENT_FLAG_NONE, \
943
- "sync_id", sync_id, "issue_ts", issue_ts)
944
-
945
- // Macros to track the life time and value of arbitrary client objects.
946
- // See also TraceTrackableObject.
947
- #define TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group, name, id) \
948
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
949
- TRACE_EVENT_PHASE_CREATE_OBJECT, category_group, name, id, \
950
- TRACE_EVENT_FLAG_NONE)
951
-
952
- #define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group, name, id, \
953
- snapshot) \
954
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
955
- TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, category_group, name, \
956
- id, TRACE_EVENT_FLAG_NONE, "snapshot", snapshot)
957
-
958
- #define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID_AND_TIMESTAMP( \
959
- category_group, name, id, timestamp, snapshot) \
960
- INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \
961
- TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, category_group, name, \
962
- id, TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \
963
- "snapshot", snapshot)
964
-
965
- #define TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group, name, id) \
966
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
967
- TRACE_EVENT_PHASE_DELETE_OBJECT, category_group, name, id, \
968
- TRACE_EVENT_FLAG_NONE)
969
-
970
- // Records entering and leaving trace event contexts. |category_group| and
971
- // |name| specify the context category and type. |context| is a
972
- // snapshotted context object id.
973
- #define TRACE_EVENT_ENTER_CONTEXT(category_group, name, context) \
974
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
975
- TRACE_EVENT_PHASE_ENTER_CONTEXT, category_group, name, context, \
976
- TRACE_EVENT_FLAG_NONE)
977
- #define TRACE_EVENT_LEAVE_CONTEXT(category_group, name, context) \
978
- INTERNAL_TRACE_EVENT_ADD_WITH_ID( \
979
- TRACE_EVENT_PHASE_LEAVE_CONTEXT, category_group, name, context, \
980
- TRACE_EVENT_FLAG_NONE)
981
- #define TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) \
982
- INTERNAL_TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context)
983
-
984
- // Macro to specify that two trace IDs are identical. For example,
985
- // TRACE_LINK_IDS(
986
- // "category", "name",
987
- // TRACE_ID_WITH_SCOPE("net::URLRequest", 0x1000),
988
- // TRACE_ID_WITH_SCOPE("blink::ResourceFetcher::FetchRequest", 0x2000))
989
- // tells the trace consumer that events with ID ("net::URLRequest", 0x1000) from
990
- // the current process have the same ID as events with ID
991
- // ("blink::ResourceFetcher::FetchRequest", 0x2000).
992
- #define TRACE_LINK_IDS(category_group, name, id, linked_id) \
993
- INTERNAL_TRACE_EVENT_ADD_LINK_IDS(category_group, name, id, linked_id);
994
-
995
- // Macro to efficiently determine if a given category group is enabled.
996
- #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \
997
- do { \
998
- INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
999
- if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \
1000
- *ret = true; \
1001
- } else { \
1002
- *ret = false; \
1003
- } \
1004
- } while (0)
1005
-
1006
- // Macro to explicitly warm up a given category group. This could be useful in
1007
- // cases where we want to initialize a category group before any trace events
1008
- // for that category group is reported. For example, to have a category group
1009
- // always show up in the "record categories" list for manually selecting
1010
- // settings in about://tracing.
1011
- #define TRACE_EVENT_WARMUP_CATEGORY(category_group) \
1012
- INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group)
1013
-
1014
- // Macro to efficiently determine, through polling, if a new trace has begun.
1015
- #define TRACE_EVENT_IS_NEW_TRACE(ret) \
1016
- do { \
1017
- static int INTERNAL_TRACE_EVENT_UID(lastRecordingNumber) = 0; \
1018
- int num_traces_recorded = TRACE_EVENT_API_GET_NUM_TRACES_RECORDED(); \
1019
- if (num_traces_recorded != -1 && \
1020
- num_traces_recorded != \
1021
- INTERNAL_TRACE_EVENT_UID(lastRecordingNumber)) { \
1022
- INTERNAL_TRACE_EVENT_UID(lastRecordingNumber) = num_traces_recorded; \
1023
- *ret = true; \
1024
- } else { \
1025
- *ret = false; \
1026
- } \
1027
- } while (0)
1028
-
1029
- // Notes regarding the following definitions:
1030
- // New values can be added and propagated to third party libraries, but existing
1031
- // definitions must never be changed, because third party libraries may use old
1032
- // definitions.
1033
-
1034
- // Phase indicates the nature of an event entry. E.g. part of a begin/end pair.
1035
- #define TRACE_EVENT_PHASE_BEGIN ('B')
1036
- #define TRACE_EVENT_PHASE_END ('E')
1037
- #define TRACE_EVENT_PHASE_COMPLETE ('X')
1038
- #define TRACE_EVENT_PHASE_INSTANT ('I')
1039
- #define TRACE_EVENT_PHASE_ASYNC_BEGIN ('S')
1040
- #define TRACE_EVENT_PHASE_ASYNC_STEP_INTO ('T')
1041
- #define TRACE_EVENT_PHASE_ASYNC_STEP_PAST ('p')
1042
- #define TRACE_EVENT_PHASE_ASYNC_END ('F')
1043
- #define TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN ('b')
1044
- #define TRACE_EVENT_PHASE_NESTABLE_ASYNC_END ('e')
1045
- #define TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT ('n')
1046
- #define TRACE_EVENT_PHASE_FLOW_BEGIN ('s')
1047
- #define TRACE_EVENT_PHASE_FLOW_STEP ('t')
1048
- #define TRACE_EVENT_PHASE_FLOW_END ('f')
1049
- #define TRACE_EVENT_PHASE_METADATA ('M')
1050
- #define TRACE_EVENT_PHASE_COUNTER ('C')
1051
- #define TRACE_EVENT_PHASE_SAMPLE ('P')
1052
- #define TRACE_EVENT_PHASE_CREATE_OBJECT ('N')
1053
- #define TRACE_EVENT_PHASE_SNAPSHOT_OBJECT ('O')
1054
- #define TRACE_EVENT_PHASE_DELETE_OBJECT ('D')
1055
- #define TRACE_EVENT_PHASE_MEMORY_DUMP ('v')
1056
- #define TRACE_EVENT_PHASE_MARK ('R')
1057
- #define TRACE_EVENT_PHASE_CLOCK_SYNC ('c')
1058
- #define TRACE_EVENT_PHASE_ENTER_CONTEXT ('(')
1059
- #define TRACE_EVENT_PHASE_LEAVE_CONTEXT (')')
1060
- #define TRACE_EVENT_PHASE_LINK_IDS ('=')
1061
-
1062
- // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT.
1063
- #define TRACE_EVENT_FLAG_NONE (static_cast<unsigned int>(0))
1064
- #define TRACE_EVENT_FLAG_COPY (static_cast<unsigned int>(1 << 0))
1065
- #define TRACE_EVENT_FLAG_HAS_ID (static_cast<unsigned int>(1 << 1))
1066
- // TODO(crbug.com/639003): Free this bit after ID mangling is deprecated.
1067
- #define TRACE_EVENT_FLAG_MANGLE_ID (static_cast<unsigned int>(1 << 2))
1068
- #define TRACE_EVENT_FLAG_SCOPE_OFFSET (static_cast<unsigned int>(1 << 3))
1069
- #define TRACE_EVENT_FLAG_SCOPE_EXTRA (static_cast<unsigned int>(1 << 4))
1070
- #define TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP (static_cast<unsigned int>(1 << 5))
1071
- #define TRACE_EVENT_FLAG_ASYNC_TTS (static_cast<unsigned int>(1 << 6))
1072
- #define TRACE_EVENT_FLAG_BIND_TO_ENCLOSING (static_cast<unsigned int>(1 << 7))
1073
- #define TRACE_EVENT_FLAG_FLOW_IN (static_cast<unsigned int>(1 << 8))
1074
- #define TRACE_EVENT_FLAG_FLOW_OUT (static_cast<unsigned int>(1 << 9))
1075
- #define TRACE_EVENT_FLAG_HAS_CONTEXT_ID (static_cast<unsigned int>(1 << 10))
1076
- #define TRACE_EVENT_FLAG_HAS_PROCESS_ID (static_cast<unsigned int>(1 << 11))
1077
- #define TRACE_EVENT_FLAG_HAS_LOCAL_ID (static_cast<unsigned int>(1 << 12))
1078
- #define TRACE_EVENT_FLAG_HAS_GLOBAL_ID (static_cast<unsigned int>(1 << 13))
1079
-
1080
- #define TRACE_EVENT_FLAG_SCOPE_MASK \
1081
- (static_cast<unsigned int>(TRACE_EVENT_FLAG_SCOPE_OFFSET | \
1082
- TRACE_EVENT_FLAG_SCOPE_EXTRA))
1083
-
1084
- // Type values for identifying types in the TraceValue union.
1085
- #define TRACE_VALUE_TYPE_BOOL (static_cast<unsigned char>(1))
1086
- #define TRACE_VALUE_TYPE_UINT (static_cast<unsigned char>(2))
1087
- #define TRACE_VALUE_TYPE_INT (static_cast<unsigned char>(3))
1088
- #define TRACE_VALUE_TYPE_DOUBLE (static_cast<unsigned char>(4))
1089
- #define TRACE_VALUE_TYPE_POINTER (static_cast<unsigned char>(5))
1090
- #define TRACE_VALUE_TYPE_STRING (static_cast<unsigned char>(6))
1091
- #define TRACE_VALUE_TYPE_COPY_STRING (static_cast<unsigned char>(7))
1092
- #define TRACE_VALUE_TYPE_CONVERTABLE (static_cast<unsigned char>(8))
1093
-
1094
- // Enum reflecting the scope of an INSTANT event. Must fit within
1095
- // TRACE_EVENT_FLAG_SCOPE_MASK.
1096
- #define TRACE_EVENT_SCOPE_GLOBAL (static_cast<unsigned char>(0 << 3))
1097
- #define TRACE_EVENT_SCOPE_PROCESS (static_cast<unsigned char>(1 << 3))
1098
- #define TRACE_EVENT_SCOPE_THREAD (static_cast<unsigned char>(2 << 3))
1099
-
1100
- #define TRACE_EVENT_SCOPE_NAME_GLOBAL ('g')
1101
- #define TRACE_EVENT_SCOPE_NAME_PROCESS ('p')
1102
- #define TRACE_EVENT_SCOPE_NAME_THREAD ('t')