Commit dab187b3 authored by Eric Seckler's avatar Eric Seckler Committed by Commit Bot

tracing: Improve deprecation notice on TRACE_EVENT_ASYNC macros

We weren't yet calling out explicitly that TRACE_EVENT_NESTABLE_ASYNC
should be preferred over TRACE_EVENT_ASYNC.

Bug: 1038710
Change-Id: Ib0e386d435a17ca0f21354e4ce5c955e0616fef5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037996
Auto-Submit: Eric Seckler <[email protected]>
Reviewed-by: default avatarSami Kyöstilä <[email protected]>
Commit-Queue: Eric Seckler <[email protected]>
Cr-Original-Commit-Position: refs/heads/[email protected]{#738666}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 736cd40f9eab2554ec53e29053b3cc839773249f
parent 9056fe7d
......@@ -61,28 +61,30 @@
// current process id, thread id, and a timestamp in microseconds.
//
// To trace an asynchronous procedure such as an IPC send/receive, use
// ASYNC_BEGIN and ASYNC_END:
// NESTABLE_ASYNC_BEGIN and NESTABLE_ASYNC_END:
// [single threaded sender code]
// static int send_count = 0;
// ++send_count;
// TRACE_EVENT_ASYNC_BEGIN0("ipc", "message", send_count);
// TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(
// "ipc", "message", TRACE_ID_LOCAL(send_count));
// Send(new MyMessage(send_count));
// [receive code]
// void OnMyMessage(send_count) {
// TRACE_EVENT_ASYNC_END0("ipc", "message", send_count);
// TRACE_NESTABLE_EVENT_ASYNC_END0(
// "ipc", "message", TRACE_ID_LOCAL(send_count));
// }
// The third parameter is a unique ID to match ASYNC_BEGIN/ASYNC_END pairs.
// ASYNC_BEGIN and ASYNC_END can occur on any thread of any traced process.
// Pointers can be used for the ID parameter, and they will be annotated
// internally so that the same pointer on two different processes will not
// match. For example:
// The third parameter is a unique ID to match NESTABLE_ASYNC_BEGIN/ASYNC_END
// pairs. NESTABLE_ASYNC_BEGIN and ASYNC_END can occur on any thread of any
// traced process. // Pointers can be used for the ID parameter, and they will
// be annotated internally so that the same pointer on two different processes
// will not match. For example:
// class MyTracedClass {
// public:
// MyTracedClass() {
// TRACE_EVENT_ASYNC_BEGIN0("category", "MyTracedClass", this);
// TRACE_EVENT_NESTABLE_ASYNC_BEGIN0("category", "MyTracedClass", this);
// }
// ~MyTracedClass() {
// TRACE_EVENT_ASYNC_END0("category", "MyTracedClass", this);
// TRACE_EVENT_NESTABLE_ASYNC_END0("category", "MyTracedClass", this);
// }
// }
//
......@@ -512,9 +514,11 @@
name, id, TRACE_EVENT_FLAG_NONE, arg1_name, \
arg1_val)
// ASYNC_STEP_* APIs should be only used by legacy code. New code should
// consider using NESTABLE_ASYNC_* APIs to describe substeps within an async
// event.
// -- TRACE_EVENT_ASYNC is DEPRECATED! --
//
// TRACE_EVENT_ASYNC_* APIs should be only used by legacy code. New code should
// use TRACE_EVENT_NESTABLE_ASYNC_* APIs instead.
//
// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2
// associated arguments. If the category is not enabled, then this
// does nothing.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment