Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(537)

Unified Diff: runtime/observatory/lib/src/service/object.dart

Issue 2502283003: Add a version of heap snapshots that use only fields and stack frames as roots and only include ins… (Closed)
Patch Set: . Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/observatory/lib/src/service/object.dart
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index c638dd90d9f4a0bf88b162f28d10e2337f86bc70..c3ea07da9b8a11363b32e3635a0f55ce5fb6ebc9 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -1531,12 +1531,21 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
}
}
- Stream fetchHeapSnapshot(collectGarbage) {
+ static String _rootsToString(M.HeapSnapshotRoots roots) {
+ switch (roots) {
+ case M.HeapSnapshotRoots.user: return "User";
+ case M.HeapSnapshotRoots.vm: return "VM";
+ }
+ return null;
+ }
+
+ Stream fetchHeapSnapshot(M.HeapSnapshotRoots roots, bool collectGarbage) {
if (_snapshotFetch == null || _snapshotFetch.isClosed) {
_snapshotFetch = new StreamController.broadcast();
// isolate.vm.streamListen('_Graph');
- isolate.invokeRpcNoUpgrade(
- '_requestHeapSnapshot', {'collectGarbage': collectGarbage});
+ isolate.invokeRpcNoUpgrade('_requestHeapSnapshot',
+ {'roots': _rootsToString(roots),
+ 'collectGarbage': collectGarbage});
}
return _snapshotFetch.stream;
}

Powered by Google App Engine
This is Rietveld 408576698