Skip to content

Commit

Permalink
Working test
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Marion committed Dec 27, 2023
1 parent d8ba718 commit cd0167b
Show file tree
Hide file tree
Showing 2 changed files with 191 additions and 156 deletions.
308 changes: 154 additions & 154 deletions sample/profiles/trace-event/hermes-multiple-frames.json
Original file line number Diff line number Diff line change
@@ -1,156 +1,156 @@
[
{
"pid": 0,
"tid": 0,
"ph": "B",
"name": "[root]",
"ts": 0,
"args": {
"name": "[root]",
"category": "root",
"url": null,
"line": null,
"column": null,
"params": null,
"allocatedCategory": "root",
"allocatedName": "[root]"
}
},
{
"pid": 0,
"tid": 0,
"ph": "B",
"name": "beta",
"ts": 1,
"args": {
"line": 54,
"column": 12,
"funcLine": "1",
"funcColumn": "1",
"name": "beta",
"category": "JavaScript",
"parent": 1,
"url": "/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params": null,
"allocatedCategory": "JavaScript",
"allocatedName": "beta"
}
},
{
"pid": 0,
"tid": 0,
"ph": "E",
"name": "beta",
"ts": 2,
"args": {
"line": 54,
"column": 12,
"funcLine": "1",
"funcColumn": "1",
"name": "beta",
"category": "JavaScript",
"parent": 1,
"url": "/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params": null,
"allocatedCategory": "JavaScript",
"allocatedName": "beta"
}
},
{
"pid": 0,
"tid": 0,
"ph": "B",
"name": "gamma",
"ts": 4,
"args": {
"line": 54,
"column": 12,
"funcLine": "1",
"funcColumn": "1",
"name": "beta",
"category": "blah",
"parent": 1,
"url": "/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params": null,
"allocatedCategory": "JavaScript",
"allocatedName": "beta"
}
},
{
"pid": 0,
"tid": 0,
"ph": "E",
"name": "gamma",
"ts": 13,
"args": {
"line": 54,
"column": 12,
"funcLine": "1",
"funcColumn": "1",
"name": "beta",
"category": "blah",
"parent": 1,
"url": "/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params": null,
"allocatedCategory": "JavaScript",
"allocatedName": "beta"
}
},
{
"pid": 0,
"tid": 0,
"ph": "B",
"name": "beta",
"ts": 4,
"args": {
"line": 54,
"column": 12,
"funcLine": "1",
"funcColumn": "1",
"name": "beta",
"category": "blah",
"parent": 1,
"url": "/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params": null,
"allocatedCategory": "JavaScript",
"allocatedName": "beta"
}
},
{
"pid": 0,
"tid": 0,
"ph": "E",
"name": "beta",
"ts": 10,
"args": {
"line": 54,
"column": 12,
"funcLine": "1",
"funcColumn": "1",
"name": "beta",
"category": "blah",
"parent": 1,
"url": "/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params": null,
"allocatedCategory": "JavaScript",
"allocatedName": "beta"
}
},
{
"pid": 0,
"tid": 0,
"ph": "E",
"name": "[root]",
"ts": 14,
"args": {
"name": "[root]",
"category": "root",
"url": null,
"line": null,
"column": null,
"params": null,
"allocatedCategory": "root",
"allocatedName": "[root]"
}
{
"pid":0,
"tid":0,
"ph":"B",
"name":"[root]",
"ts":0,
"args":{
"name":"[root]",
"category":"root",
"url":null,
"line":null,
"column":null,
"params":null,
"allocatedCategory":"root",
"allocatedName":"[root]"
}
]
},
{
"pid":0,
"tid":0,
"ph":"B",
"name":"beta",
"ts":1,
"args":{
"line":54,
"column":12,
"funcLine":"1",
"funcColumn":"1",
"name":"beta",
"category":"JavaScript",
"parent":1,
"url":"/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params":null,
"allocatedCategory":"JavaScript",
"allocatedName":"beta"
}
},
{
"pid":0,
"tid":0,
"ph":"E",
"name":"beta",
"ts":2,
"args":{
"line":54,
"column":12,
"funcLine":"1",
"funcColumn":"1",
"name":"beta",
"category":"JavaScript",
"parent":1,
"url":"/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params":null,
"allocatedCategory":"JavaScript",
"allocatedName":"beta"
}
},
{
"pid":0,
"tid":0,
"ph":"B",
"name":"gamma",
"ts":4,
"args":{
"line":54,
"column":12,
"funcLine":"1",
"funcColumn":"1",
"name":"beta",
"category":"blah",
"parent":1,
"url":"/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params":null,
"allocatedCategory":"JavaScript",
"allocatedName":"beta"
}
},
{
"pid":0,
"tid":0,
"ph":"E",
"name":"gamma",
"ts":13,
"args":{
"line":54,
"column":12,
"funcLine":"1",
"funcColumn":"1",
"name":"beta",
"category":"blah",
"parent":1,
"url":"/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params":null,
"allocatedCategory":"JavaScript",
"allocatedName":"beta"
}
},
{
"pid":0,
"tid":0,
"ph":"B",
"name":"beta",
"ts":4,
"args":{
"line":54,
"column":12,
"funcLine":"1",
"funcColumn":"1",
"name":"beta",
"category":"blah",
"parent":1,
"url":"/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params":null,
"allocatedCategory":"JavaScript",
"allocatedName":"beta"
}
},
{
"pid":0,
"tid":0,
"ph":"E",
"name":"beta",
"ts":10,
"args":{
"line":54,
"column":12,
"funcLine":"1",
"funcColumn":"1",
"name":"beta",
"category":"blah",
"parent":1,
"url":"/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params":null,
"allocatedCategory":"JavaScript",
"allocatedName":"beta"
}
},
{
"pid":0,
"tid":0,
"ph":"E",
"name":"[root]",
"ts":14,
"args":{
"name":"[root]",
"category":"root",
"url":null,
"line":null,
"column":null,
"params":null,
"allocatedCategory":"root",
"allocatedName":"[root]"
}
}
]
39 changes: 37 additions & 2 deletions src/import/__snapshots__/trace-event.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,41 @@ exports[`importTraceEvents event reordering name match: indexToView 1`] = `0`;

exports[`importTraceEvents event reordering name match: profileGroup.name 1`] = `"event-reordering-name-match.json"`;

exports[`importTraceEvents hermes profile with multiple frames 1`] = `
Object {
"frames": Array [
Frame {
"col": null,
"file": null,
"key": "[root]:null:null:null",
"line": null,
"name": "[root]",
"selfWeight": 2,
"totalWeight": 14,
},
Frame {
"col": 12,
"file": "/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"key": "beta:/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js:54:12",
"line": 54,
"name": "beta",
"selfWeight": 12,
"totalWeight": 12,
},
],
"name": "pid 0, tid 0",
"stacks": Array [
"[root] 1.00µs",
"[root];beta 12.00µs",
"[root] 1.00µs",
],
}
`;

exports[`importTraceEvents hermes profile with multiple frames: indexToView 1`] = `0`;

exports[`importTraceEvents hermes profile with multiple frames: profileGroup.name 1`] = `"simple-hermes.json"`;

exports[`importTraceEvents invalid x nesting 1`] = `
Object {
"frames": Array [
Expand Down Expand Up @@ -1321,7 +1356,7 @@ Object {
Frame {
"col": null,
"file": null,
"key": "[root] {\\"name\\":\\"[root]\\",\\"category\\":\\"root\\",\\"url\\":null,\\"line\\":null,\\"column\\":null,\\"params\\":null,\\"allocatedCategory\\":\\"root\\",\\"allocatedName\\":\\"[root]\\"}",
"key": "[root]:null:null:null",
"line": null,
"name": "[root]",
"selfWeight": 2,
Expand All @@ -1330,7 +1365,7 @@ Object {
Frame {
"col": 12,
"file": "/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"key": "beta {\\"line\\":54,\\"column\\":12,\\"funcLine\\":\\"1\\",\\"funcColumn\\":\\"1\\",\\"name\\":\\"beta\\",\\"category\\":\\"JavaScript\\",\\"parent\\":1,\\"url\\":\\"/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js\\",\\"params\\":null,\\"allocatedCategory\\":\\"JavaScript\\",\\"allocatedName\\":\\"beta\\"}",
"key": "beta:/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js:54:12",
"line": 54,
"name": "beta",
"selfWeight": 12,
Expand Down

0 comments on commit cd0167b

Please sign in to comment.