flutter / flutter/devtools

Embedded Perfetto trace viewer reports "failure parsing JSON" error for large traces

オープン
#6,674 コメント 1 件 リアクション 1 件 担当者 1 名 @kenzieschmoll が担当を希望しています GitHub で見る
P1 performance > perfetto screen: performance
主要言語
Dart
スター
1.7k
フォーク
404
平均マージ
6日 17時間
マージ済み PR(30日)
18

説明

It looks like there's something going wrong in the communcation between DevTools and the embedded trace viewer when sending large traces. This was originally reported in the Dart SDK repo as https://github.com/dart-lang/sdk/issues/53967, but I think it belongs here instead.

Reproduction steps:

1. Add the following code after https://github.com/flutter/devtools/blob/master/packages/devtools_app/lib/src/screens/performance/panes/timeline_events/perfetto/_perfetto_web.dart#L165.

```
final blob = html.Blob([encodedJson]);
final blobURL = html.Url.createObjectUrl(blob);

final link = html.document.createElement('a') as html.AnchorElement;
link.href = blobURL;
link.download = 'dart-trace.json';
link.click();
```

2.

```
import 'dart:isolate';

main() {
for (int i = 0; i < 20; i++) {
Isolate.spawn((msg) async {
print('${Isolate.current.debugName} started $msg');
for (int i = 0; i < 1000; i++) {
for (int j = 0; j < 100000; j++) {
if (j % 100000 == 0) {
print('${Isolate.current.debugName} $i $j');
//await Future.delayed(Duration(seconds: 0));
}
}
}
print('${Isolate.current.debugName} done');
}, 'Hi', debugName: 'worker $i');
}
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 100000; j++) {
if (j % 100000 == 0) {
print('main $i $j');
}
}
}
}
```

Run the above program with `dart --observe --timeline-streams=all --timeline-recorder=endless example.dart`.
3. Open the performance page in DevTools, and observe that it reports a "failure parsing JSON" error.
4. Observe that the saved `dart-trace.json` file can be succesfully loaded by ui.perfetto.dev.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。