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

Side by Side Diff: runtime/observatory/lib/src/cpu_profile/cpu_profile.dart

Issue 1288853002: Fix cpu profile table (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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/cpu_profile.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 25 matching lines...) Expand all
36 node._percentage = parentPercentage * (node.count / parentCount); 36 node._percentage = parentPercentage * (node.count / parentCount);
37 } else { 37 } else {
38 node._percentage = (node.count / parentCount); 38 node._percentage = (node.count / parentCount);
39 } 39 }
40 for (var child in node.children) { 40 for (var child in node.children) {
41 _setCodePercentage(node, child); 41 _setCodePercentage(node, child);
42 } 42 }
43 } 43 }
44 44
45 _recordCallerAndCalleesInner(CodeCallTreeNode caller, 45 _recordCallerAndCalleesInner(CodeCallTreeNode caller,
46 CodeCallTreeNode callee) { 46 CodeCallTreeNode callee) {
47 if (caller != null) { 47 if (caller != null) {
48 caller.profileCode._recordCallee(callee.profileCode, callee.count); 48 caller.profileCode._recordCallee(callee.profileCode, callee.count);
49 callee.profileCode._recordCaller(caller.profileCode, callee.count); 49 callee.profileCode._recordCaller(caller.profileCode, caller.count);
50 } 50 }
51 51
52 for (var child in callee.children) { 52 for (var child in callee.children) {
53 _recordCallerAndCalleesInner(callee, child); 53 _recordCallerAndCalleesInner(callee, child);
54 } 54 }
55 } 55 }
56 56
57 _recordCallerAndCallees() { 57 _recordCallerAndCallees() {
58 for (var child in root.children) { 58 for (var child in root.children) {
59 _recordCallerAndCalleesInner(null, child); 59 _recordCallerAndCalleesInner(null, child);
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 node._percentage = parentPercentage * (node.count / parentCount); 283 node._percentage = parentPercentage * (node.count / parentCount);
284 } else { 284 } else {
285 node._percentage = (node.count / parentCount); 285 node._percentage = (node.count / parentCount);
286 } 286 }
287 for (var child in node.children) { 287 for (var child in node.children) {
288 _setFunctionPercentage(node, child); 288 _setFunctionPercentage(node, child);
289 } 289 }
290 } 290 }
291 291
292 _markFunctionCallsInner(FunctionCallTreeNode caller, 292 _markFunctionCallsInner(FunctionCallTreeNode caller,
293 FunctionCallTreeNode callee) { 293 FunctionCallTreeNode callee) {
294 if (caller != null) { 294 if (caller != null) {
295 caller.profileFunction._recordCallee(callee.profileFunction, callee.count) ; 295 caller.profileFunction._recordCallee(callee.profileFunction, callee.count) ;
296 callee.profileFunction._recordCaller(caller.profileFunction, callee.count) ; 296 callee.profileFunction._recordCaller(caller.profileFunction, caller.count) ;
297 } 297 }
298 for (var child in callee.children) { 298 for (var child in callee.children) {
299 _markFunctionCallsInner(callee, child); 299 _markFunctionCallsInner(callee, child);
300 } 300 }
301 } 301 }
302 302
303 _markFunctionCalls() { 303 _markFunctionCalls() {
304 for (var child in root.children) { 304 for (var child in root.children) {
305 _markFunctionCallsInner(null, child); 305 _markFunctionCallsInner(null, child);
306 } 306 }
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 int approximateMillisecondsForCount(count) { 860 int approximateMillisecondsForCount(count) {
861 var MICROSECONDS_PER_MILLISECOND = 1000.0; 861 var MICROSECONDS_PER_MILLISECOND = 1000.0;
862 return (count * samplePeriod) ~/ MICROSECONDS_PER_MILLISECOND; 862 return (count * samplePeriod) ~/ MICROSECONDS_PER_MILLISECOND;
863 } 863 }
864 864
865 double approximateSecondsForCount(count) { 865 double approximateSecondsForCount(count) {
866 var MICROSECONDS_PER_SECOND = 1000000.0; 866 var MICROSECONDS_PER_SECOND = 1000000.0;
867 return (count * samplePeriod) / MICROSECONDS_PER_SECOND; 867 return (count * samplePeriod) / MICROSECONDS_PER_SECOND;
868 } 868 }
869 } 869 }
OLDNEW
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/cpu_profile.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698