Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

Systrace parser should support async flow events  #4643

@nslingerland

Description

@nslingerland

Flow events are super-useful for visualizing the connections between asynchronous events.

Catapult is able to show these for JSON Trace Event Format data:

flow.json

{
  "traceEvents": [
    {
      "cat": "",
      "pid": 15903,
      "tid": 15904,
      "ts": 2000.000000,
      "ph": "B",
      "name": "SenderB"
    },
    {
      "cat": "",
      "pid": 15903,
      "tid": 15904,
      "ts": 2000.201000,
      "ph": "s",
      "name": "IPC",
      "id":"8780d403"
    },
    {
      "cat": "",
      "pid": 15903,
      "tid": 15904,
      "ts": 2000.900000,
      "ph": "E"
    },
    {
      "cat": "",
      "pid": 15875,
      "tid": 15895,
      "ts": 2001.400000,
      "ph": "f",
      "name": "IPC",
      "id": "8780d403"
    },
    {
      "cat": "",
      "pid": 15875,
      "tid": 15895,
      "ts": 2001.400000,
      "ph": "B",
      "name": "Blergh"
    },
    {
      "cat": "",
      "pid": 15875,
      "tid": 15895,
      "ts": 2001.800000,
      "ph": "E"
    }
  ]
}

Screen Shot 2019-07-22 at 10 58 28 AM

flow.systrace

Here is an equivalent systrace:

# tracer: nop
      thread1-15904   [000] ...1  2000.000000: tracing_mark_write: B|15903|SenderB
      thread1-15904   [000] ...1  2000.201000: tracing_mark_write: s|15903|IPC|8780d403
      thread1-15904   [000] ...1  2000.900000: tracing_mark_write: E
      thread2-15895   [000] ...1  2001.400000: tracing_mark_write: f|15875|IPC|8780d403
      thread2-15895   [000] ...1  2001.400000: tracing_mark_write: B|15875|Blergh
      thread2-15895   [000] ...1  2001.800000: tracing_mark_write: E

Screen Shot 2019-07-22 at 10 58 00 AM

-> the flow arrows are not shown

Looking at the Catapult source code for parsing the reason for this is clear:

Android systrace

https://github.com/catapult-project/catapult/blob/master/tracing/tracing/extras/importer/linux_perf/android_parser.html#L103

Chrome trace

https://github.com/catapult-project/catapult/blob/master/tracing/tracing/extras/importer/trace_event_importer.html#L1292

Flow events are {s,f,t} Note that the Android systrace importer only handles {B,E,C,S,F} events. It ignores anything else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions