Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

format: Chrome Trace with instant samples #402

Open
javierhonduco opened this issue Aug 3, 2022 · 3 comments
Open

format: Chrome Trace with instant samples #402

javierhonduco opened this issue Aug 3, 2022 · 3 comments

Comments

@javierhonduco
Copy link

javierhonduco commented Aug 3, 2022

馃憢馃徎 Hi!

I was trying to visualise the following Chrome Trace in speedscope, but unfortunately, I get an error.

{
  "traceEvents": [
    {"name": "hi", "cat": "none", "ph": "i", "pid": 22630, "tid": 22630, "ts": 829, "stack": ["a", "b", "c"]},
  ],
  "displayTimeUnit": "ns",
  "otherData": {
    "version": "none"
  },
  "samples": []
}

I have it stored under test.json, and either dragging it or selecting it in the file browser results in this alert:

Unrecognized format! See documentation about supported formats.

Perhaps I have misunderstood something about the Chrome Trace format, or I have made some mistake. I have tried on Perfetto and it worked (almost) right. Notice the missing stacks. But perhaps I don't know how to use its UI 馃槄 .

@javierhonduco
Copy link
Author

Just saw this in the docs:

speedscope supports importing a subset of these events. Namely, it supports B, E, and X events, as well as the M events used to specify the names of processes and threads.

Would be amazing if Speedscope could support "instant" events.

I remembered I had tried with "BEGIN" / "END" events, and this failed, too, with the same error message:

{
  "traceEvents": [
    {"name": "hi", "cat": "none", "ph": "B", "pid": 22630, "tid": 22630, "ts": 829, "stack": ["a", "b", "c"]},
    {"name": "hi", "cat": "none", "ph": "E", "pid": 22630, "tid": 22630, "ts": 849, "stack": ["a", "b", "c"]},
  ],
  "displayTimeUnit": "ns",
  "otherData": {
    "version": "none"
  },
  "samples": []
}

@zacharyfmarion
Copy link
Contributor

@javierhonduco I might be missing something but neither of those look like valid formats according to the spec. Trace events do not have a stack property - if you want to specify stackFrames at a timestamp, you can use the json object format - I'm adding support for it here.

Screenshot 2023-12-21 at 11 03 34 PM

@javierhonduco
Copy link
Author

@zacharyfmarion this is great news, thanks so much! 馃帀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants