Skip to content

Commit

Permalink
Support the chrome JSON trace format (allows viewing of hermes traces) (
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyfmarion authored Dec 26, 2023
1 parent dfd3a0d commit b214804
Show file tree
Hide file tree
Showing 11 changed files with 816 additions and 182 deletions.
150 changes: 150 additions & 0 deletions sample/profiles/trace-event/multi-thread-with-samples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"traceEvents": [
{
"name": "process_name",
"ph": "M",
"cat": "__metadata",
"pid": 7512,
"ts": "11550183666",
"tid": "-1",
"args": {
"name": "hermes"
}
},
{
"name": "thread_name",
"ph": "M",
"cat": "__metadata",
"pid": 7512,
"ts": "11550183666",
"tid": "1",
"args": {
"name": "mqt_js"
}
},
{
"name": "mqt_js",
"cat": "mqt_js",
"ph": "X",
"dur": 0,
"pid": 7512,
"ts": "11550183666",
"tid": "1",
"args": {}
},
{
"name": "mqt_js",
"cat": "mqt_js",
"ph": "X",
"dur": 0,
"pid": 7512,
"ts": "11550183666",
"tid": "2",
"args": {}
}
],
"samples": [
{
"cpu": "-1",
"name": "",
"ts": "11552125241",
"pid": 7512,
"tid": "1",
"weight": "1",
"sf": 1
},
{
"cpu": "-1",
"name": "",
"ts": "11552125241",
"pid": 7512,
"tid": "2",
"weight": "1",
"sf": 4
},
{
"cpu": "-1",
"name": "",
"ts": "11552146011",
"pid": 7512,
"tid": "1",
"weight": "1",
"sf": 2
},
{
"cpu": "-1",
"name": "",
"ts": "11552146011",
"pid": 7512,
"tid": "2",
"weight": "1",
"sf": 5
},
{
"cpu": "-1",
"name": "",
"ts": "11552159337",
"pid": 7512,
"tid": "1",
"weight": "1",
"sf": 3
},
{
"cpu": "-1",
"name": "",
"ts": "11552159337",
"pid": 7512,
"tid": "2",
"weight": "1",
"sf": 6
},
{
"cpu": "-1",
"name": "",
"ts": "11552169337",
"pid": 7512,
"tid": "2",
"weight": "1",
"sf": 4
},
{
"cpu": "-1",
"name": "",
"ts": "11552179337",
"pid": 7512,
"tid": "2",
"weight": "1",
"sf": 4
}
],
"stackFrames": {
"1": {
"name": "[root]",
"category": "root"
},
"2": {
"name": "function1",
"category": "JavaScript",
"parent": 1
},
"3": {
"name": "[GC Young Gen]",
"category": "Metadata",
"parent": 1
},
"4": {
"name": "[root thread 2]",
"category": "root"
},
"5": {
"name": "function3",
"category": "JavaScript",
"parent": 4
},
"6": {
"name": "function4",
"category": "Metadata",
"parent": 4
}
}
}
127 changes: 127 additions & 0 deletions sample/profiles/trace-event/simple-with-samples.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"traceEvents": [
{
"name": "process_name",
"ph": "M",
"cat": "__metadata",
"pid": 7512,
"ts": "11550183666",
"tid": "-1",
"args": {
"name": "hermes"
}
},
{
"name": "thread_name",
"ph": "M",
"cat": "__metadata",
"pid": 7512,
"ts": "11550183666",
"tid": "7695",
"args": {
"name": "mqt_js"
}
},
{
"name": "mqt_js",
"cat": "mqt_js",
"ph": "X",
"dur": 0,
"pid": 7512,
"ts": "11550183666",
"tid": "7695",
"args": {}
}
],
"samples": [
{
"cpu": "-1",
"name": "",
"ts": "11552125241",
"pid": 7512,
"tid": "7695",
"weight": "1",
"sf": 1
},
{
"cpu": "-1",
"name": "",
"ts": "11552129681",
"pid": 7512,
"tid": "7695",
"weight": "1",
"sf": 1
},
{
"cpu": "-1",
"name": "",
"ts": "11552146011",
"pid": 7512,
"tid": "7695",
"weight": "1",
"sf": 2
},
{
"cpu": "-1",
"name": "",
"ts": "11552159337",
"pid": 7512,
"tid": "7695",
"weight": "1",
"sf": 4
},
{
"cpu": "-1",
"name": "",
"ts": "11552169942",
"pid": 7512,
"tid": "7695",
"weight": "1",
"sf": 1
},
{
"cpu": "-1",
"name": "",
"ts": "11552179951",
"pid": 7512,
"tid": "7695",
"weight": "1",
"sf": 5
},
{
"cpu": "-1",
"name": "",
"ts": "11552189951",
"pid": 7512,
"tid": "7695",
"weight": "1",
"sf": 5
}
],
"stackFrames": {
"1": {
"name": "[root]",
"category": "root"
},
"2": {
"name": "function1(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:1:1)",
"category": "JavaScript",
"parent": 1
},
"3": {
"name": "function2(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:418874:4)",
"category": "JavaScript",
"parent": 1
},
"4": {
"name": "function3(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:17:3)",
"category": "JavaScript",
"parent": 3
},
"5": {
"name": "[GC Young Gen]",
"category": "Metadata",
"parent": 1
}
}
}
Loading

0 comments on commit b214804

Please sign in to comment.