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

Side by Side Diff: runtime/observatory/lib/src/cpu_profile/cpu_profile.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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/observatory/lib/src/service/object.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of cpu_profiler; 5 part of cpu_profiler;
6 6
7 class CodeCallTreeNode { 7 class CodeCallTreeNode {
8 final ProfileCode profileCode; 8 final ProfileCode profileCode;
9 final int count; 9 final int count;
10 double get percentage => _percentage; 10 double get percentage => _percentage;
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 _recordCallee(ProfileFunction callee, int count) { 591 _recordCallee(ProfileFunction callee, int count) {
592 var r = callees[callee]; 592 var r = callees[callee];
593 if (r == null) { 593 if (r == null) {
594 r = 0; 594 r = 0;
595 } 595 }
596 callees[callee] = r + count; 596 callees[callee] = r + count;
597 } 597 }
598 } 598 }
599 599
600 600
601 // TODO(johnmccutchan): Rename to SampleProfile
601 class CpuProfile { 602 class CpuProfile {
602 final double MICROSECONDS_PER_SECOND = 1000000.0; 603 final double MICROSECONDS_PER_SECOND = 1000000.0;
603 final double displayThreshold = 0.0002; // 0.02%. 604 final double displayThreshold = 0.0002; // 0.02%.
604 605
605 Isolate isolate; 606 Isolate isolate;
606 607
607 int sampleCount = 0; 608 int sampleCount = 0;
608 int samplePeriod = 0; 609 int samplePeriod = 0;
609 double sampleRate = 0.0; 610 double sampleRate = 0.0;
610 611
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 int approximateMillisecondsForCount(count) { 878 int approximateMillisecondsForCount(count) {
878 var MICROSECONDS_PER_MILLISECOND = 1000.0; 879 var MICROSECONDS_PER_MILLISECOND = 1000.0;
879 return (count * samplePeriod) ~/ MICROSECONDS_PER_MILLISECOND; 880 return (count * samplePeriod) ~/ MICROSECONDS_PER_MILLISECOND;
880 } 881 }
881 882
882 double approximateSecondsForCount(count) { 883 double approximateSecondsForCount(count) {
883 var MICROSECONDS_PER_SECOND = 1000000.0; 884 var MICROSECONDS_PER_SECOND = 1000000.0;
884 return (count * samplePeriod) / MICROSECONDS_PER_SECOND; 885 return (count * samplePeriod) / MICROSECONDS_PER_SECOND;
885 } 886 }
886 } 887 }
OLDNEW
« no previous file with comments | « no previous file | runtime/observatory/lib/src/service/object.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698