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

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

Issue 1231603008: Expose allocation tracing over service protocol (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months 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 e6825786f50c19d78f6a89c78e46cec34b9a391f..c25d7dbad205f0674c76eb6250952885aee8fb49 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -1896,7 +1896,7 @@ class Class extends ServiceObject with Coverage {
final AllocationCount promotedByLastNewGC = new AllocationCount();
@observable bool get hasNoAllocations => newSpace.empty && oldSpace.empty;
-
+ @observable bool traceAllocations = false;
@reflectable final fields = new ObservableList<Field>();
@reflectable final functions = new ObservableList<ServiceFunction>();
@@ -1963,6 +1963,9 @@ class Class extends ServiceObject with Coverage {
}
error = map['error'];
+ traceAllocations =
+ (map['_traceAllocations'] != null) ? map['_traceAllocations'] : false;
+
var allocationStats = map['_allocationStats'];
if (allocationStats != null) {
newSpace.update(allocationStats['new']);
@@ -1985,6 +1988,19 @@ class Class extends ServiceObject with Coverage {
return isolate._eval(this, expression);
}
+ Future<ServiceObject> setTraceAllocations(bool enable) {
+ return isolate.invokeRpc('_setTraceClassAllocation', {
+ 'enable': enable,
+ 'classId': id,
+ });
+ }
+
+ Future<ServiceObject> getAllocationSamples([String tags = 'None']) {
+ var params = { 'tags': tags,
+ 'classId': id };
+ return isolate.invokeRpc('_getAllocationSamples', params);
+ }
+
String toString() => 'Class($vmName)';
}

Powered by Google App Engine
This is Rietveld 408576698