Skip to content

Commit 040d789

Browse files
authored
Fix profiler: add TracingStartedInBrowser data (#652)
1 parent e4cad97 commit 040d789

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

other/profiler/ProfileGen.hx

+24-4
Original file line numberDiff line numberDiff line change
@@ -235,17 +235,37 @@ class ProfileGen {
235235
}
236236

237237
var mainTid = threads[0].tid;
238-
var json : Array<Dynamic> = [for( t in threads )
239-
{
238+
var json : Array<Dynamic> = [];
239+
for( t in threads ) {
240+
json.push({
240241
pid : 0,
241242
tid : t.tid,
242243
ts : 0,
243244
ph : "M",
244245
cat : "__metadata",
245246
name : "thread_name",
246247
args : { name : t.name }
247-
}
248-
];
248+
});
249+
json.push({
250+
args: {
251+
data: {
252+
frameTreeNodeId: 0,
253+
frames: [
254+
{
255+
processId: 0,
256+
url: "http://_"
257+
}
258+
],
259+
persistentIds: true
260+
}
261+
},
262+
cat: "disabled-by-default-devtools.timeline",
263+
name: "TracingStartedInBrowser",
264+
pid: 0,
265+
tid: t.tid,
266+
ts: 0
267+
});
268+
}
249269

250270
var count = 1;
251271
var f0 = threads[0].frames[0];

0 commit comments

Comments
 (0)