Add a small hand-crafted Trace Event file for checking how Chrome displays it

(See https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview#heading=h.jh64i9l3vwa1 )

Sadly, Chrome's chrome://tracing tool does not display the nestable
non-deprecated async b(egin) and e(nd) events at all. It does display
the non-nestable deprecated S(tart) and F(inish) events, though. Most
likely we can drop the support for the nestable async events in core
and here.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I7c3a05b265a83cef56e80a575df69d1b53c62278
pull/2673/head
Tor Lillqvist 2021-06-23 11:48:07 +03:00
parent 959129ad00
commit 4a95af2ac7
1 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,37 @@
[
{"name":"comment", "comment":"Let's give some pids and tids names"},
{"name":"process_name", "ph":"M", "args":{"name":"Hey"},"pid":1000, "tid":1},
{"name":"thread_name", "ph":"M", "args":{"name":"Foo"},"pid":1000, "tid":1},
{"name":"thread_name", "ph":"M", "args":{"name":"Bar"},"pid":1000, "tid":2},
{"name":"process_name", "ph":"M", "args":{"name":"Zap"},"pid":1001, "tid":1},
{"name":"thread_name", "ph":"M", "args":{"name":"Mbl"},"pid":1001, "tid":1},
{"comment":" Two pairs of async b(egin) and e(nd) events, nested (with the same id). Don't show up at all in Chrome!?"},
{"name":"async1", "ph":"b", "id":1, "ts":1623142954400200, "pid":1001, "tid":1},
{"name":"async12", "ph":"b", "id":1, "ts":1623142954400250, "pid":1001, "tid":1},
{"name":"async12", "ph":"e", "id":1, "ts":1623142954400350, "pid":1001, "tid":1},
{"name":"async1", "ph":"e", "id":1, "ts":1623142954400700, "pid":1001, "tid":1},
{"comment":" A single pair of async b and e events. These doesn't show up in Chrome either, sigh."},
{"name":"async2", "ph":"b", "id":1, "ts":1623142954401000, "pid":1001, "tid":1},
{"name":"async2", "ph":"e", "id":1, "ts":1623142954401200, "pid":1001, "tid":1},
{"comment":" Two pairs of async S(tart) and F(inish) events, nested (with the same id). "},
{"comment":" These are said to be deprecated but do show up in Chrome. Yay for documentation and implementation being in sync. "},
{"name":"async3", "ph":"S", "id":1, "ts":1623142954401200, "pid":1001, "tid":1},
{"name":"async32", "ph":"S", "id":1, "ts":1623142954401250, "pid":1001, "tid":1},
{"name":"async32", "ph":"F", "id":1, "ts":1623142954401350, "pid":1001, "tid":1},
{"name":"async3", "ph":"F", "id":1, "ts":1623142954401700, "pid":1001, "tid":1},
{"comment":" Some complete events. If complete events for the same thread are not nested properly "},
{"comment":" (as the first two aren't, they overlap) Chrome mashes them together on the same line. "},
{"name":"complete1","ph":"X", "ts":1623142954400220,"pid":1001,"tid":1,"dur":500},
{"name":"complete2","ph":"X", "ts":1623142954400300,"pid":1001,"tid":1,"dur":500},
{"name":"complete3","ph":"X", "ts":1623142954400305,"pid":1001,"tid":2,"dur":500},
{"name":"complete4","ph":"X", "ts":1623142954400900,"pid":1001,"tid":2,"dur":200}
]