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

Unified Diff: runtime/observatory/lib/src/elements/class_view.dart

Issue 1273323002: Make allocation profile configurable (tags, function v. code) (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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/elements/class_view.dart
diff --git a/runtime/observatory/lib/src/elements/class_view.dart b/runtime/observatory/lib/src/elements/class_view.dart
index 7ca6fb893215d4d9e2e747986ca1c58ecd3fd845..cfd535b1a2b47e8a057c6da34e7329a77790d7ef 100644
--- a/runtime/observatory/lib/src/elements/class_view.dart
+++ b/runtime/observatory/lib/src/elements/class_view.dart
@@ -17,6 +17,10 @@ class ClassViewElement extends ObservatoryElement {
@observable ServiceMap instances;
@observable int retainedBytes;
@observable ObservableList mostRetained;
+ SampleBufferControlElement sampleBufferControlElement;
+ StackTraceTreeConfigElement stackTraceTreeConfigElement;
+ CpuProfileTreeElement cpuProfileTreeElement;
+
ClassViewElement.created() : super.created();
Future<ServiceObject> evaluate(String expression) {
@@ -47,7 +51,22 @@ class ClassViewElement extends ObservatoryElement {
}
void attached() {
+ super.attached();
+ sampleBufferControlElement =
+ shadowRoot.querySelector('#sampleBufferControl');
+ assert(sampleBufferControlElement != null);
+ sampleBufferControlElement.onSampleBufferUpdate = onSampleBufferChange;
+ sampleBufferControlElement.state =
+ SampleBufferControlElement.kNotLoadedState;
+ stackTraceTreeConfigElement =
+ shadowRoot.querySelector('#stackTraceTreeConfig');
+ assert(stackTraceTreeConfigElement != null);
+ stackTraceTreeConfigElement.onTreeConfigChange = onTreeConfigChange;
+ cpuProfileTreeElement = shadowRoot.querySelector('#cpuProfileTree');
+ assert(cpuProfileTreeElement != null);
+ cpuProfileTreeElement.profile = sampleBufferControlElement.profile;
cls.fields.forEach((field) => field.reload());
+ sampleBufferControlElement.allocationProfileClass = cls;
}
Future refresh() {
@@ -64,19 +83,28 @@ class ClassViewElement extends ObservatoryElement {
return cls.refreshCoverage();
}
- final CpuProfile profile = new CpuProfile();
+ onSampleBufferChange(CpuProfile sampleBuffer) {
+ cpuProfileTreeElement.render();
+ }
- Future refreshAllocationProfile() async {
- var profileResponse = await cls.getAllocationSamples('UserVM');
- profile.load(profileResponse.isolate, profileResponse);
- CpuProfileTreeElement cpuProfileTreeElement =
- shadowRoot.querySelector('#cpuProfileTree');
- cpuProfileTreeElement.profile = profile;
- cpuProfileTreeElement.direction = ProfileTreeDirection.Exclusive;
- cpuProfileTreeElement.mode = ProfileTreeMode.Function;
+ onTreeConfigChange(String modeSelector, String directionSelector) {
+ ProfileTreeDirection direction = ProfileTreeDirection.Exclusive;
+ if (directionSelector != 'Up') {
+ direction = ProfileTreeDirection.Inclusive;
+ }
+ ProfileTreeMode mode = ProfileTreeMode.Function;
+ if (modeSelector == 'Code') {
+ mode = ProfileTreeMode.Code;
+ }
+ cpuProfileTreeElement.direction = direction;
+ cpuProfileTreeElement.mode = mode;
cpuProfileTreeElement.render();
}
+ Future refreshAllocationProfile() async {
+ return sampleBufferControlElement.reload(cls.isolate);
+ }
+
Future toggleAllocationTrace() {
if (cls == null) {
return new Future(refresh);
« no previous file with comments | « runtime/observatory/lib/src/cpu_profile/cpu_profile.dart ('k') | runtime/observatory/lib/src/elements/class_view.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698