OLD | NEW |
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 abstract class CallTreeNode { | 7 abstract class CallTreeNode { |
8 final List<CallTreeNode> children; | 8 final List<CallTreeNode> children; |
9 final int count; | 9 final int count; |
10 double get percentage => _percentage; | 10 double get percentage => _percentage; |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 } | 293 } |
294 | 294 |
295 class _FilteredCodeCallTreeBuilder extends _FilteredCallTreeBuilder { | 295 class _FilteredCodeCallTreeBuilder extends _FilteredCallTreeBuilder { |
296 _FilteredCodeCallTreeBuilder(CallTreeNodeFilter filter, | 296 _FilteredCodeCallTreeBuilder(CallTreeNodeFilter filter, |
297 CodeCallTree tree) | 297 CodeCallTree tree) |
298 : super(filter, tree, | 298 : super(filter, tree, |
299 new CodeCallTree(tree.inclusive, | 299 new CodeCallTree(tree.inclusive, |
300 new CodeCallTreeNode(tree.root.profileData, | 300 new CodeCallTreeNode(tree.root.profileData, |
301 tree.root.count))); | 301 tree.root.count))); |
302 | 302 |
303 _copyNode(FunctionCallTreeNode node) { | 303 _copyNode(CodeCallTreeNode node) { |
304 return new FunctionCallTreeNode(node.profileData, node.count); | 304 return new CodeCallTreeNode(node.profileData, node.count); |
305 } | 305 } |
306 } | 306 } |
307 | 307 |
308 class FunctionCallTree extends CallTree { | 308 class FunctionCallTree extends CallTree { |
309 FunctionCallTree(bool inclusive, FunctionCallTreeNode root) | 309 FunctionCallTree(bool inclusive, FunctionCallTreeNode root) |
310 : super(inclusive, root) { | 310 : super(inclusive, root) { |
311 _setFunctionPercentage(null, root); | 311 _setFunctionPercentage(null, root); |
312 } | 312 } |
313 | 313 |
314 FunctionCallTree filtered(CallTreeNodeFilter filter) { | 314 FunctionCallTree filtered(CallTreeNodeFilter filter) { |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 int approximateMillisecondsForCount(count) { | 920 int approximateMillisecondsForCount(count) { |
921 var MICROSECONDS_PER_MILLISECOND = 1000.0; | 921 var MICROSECONDS_PER_MILLISECOND = 1000.0; |
922 return (count * samplePeriod) ~/ MICROSECONDS_PER_MILLISECOND; | 922 return (count * samplePeriod) ~/ MICROSECONDS_PER_MILLISECOND; |
923 } | 923 } |
924 | 924 |
925 double approximateSecondsForCount(count) { | 925 double approximateSecondsForCount(count) { |
926 var MICROSECONDS_PER_SECOND = 1000000.0; | 926 var MICROSECONDS_PER_SECOND = 1000000.0; |
927 return (count * samplePeriod) / MICROSECONDS_PER_SECOND; | 927 return (count * samplePeriod) / MICROSECONDS_PER_SECOND; |
928 } | 928 } |
929 } | 929 } |
OLD | NEW |