| 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 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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 } | 537 } |
| 538 | 538 |
| 539 ProfileFunction.fromMap(this.profile, this.function, Map data) { | 539 ProfileFunction.fromMap(this.profile, this.function, Map data) { |
| 540 function.profile = this; | 540 function.profile = this; |
| 541 for (var codeIndex in data['codes']) { | 541 for (var codeIndex in data['codes']) { |
| 542 var profileCode = profile.codes[codeIndex]; | 542 var profileCode = profile.codes[codeIndex]; |
| 543 profileCodes.add(profileCode); | 543 profileCodes.add(profileCode); |
| 544 } | 544 } |
| 545 profileCodes.sort(_sortCodes); | 545 profileCodes.sort(_sortCodes); |
| 546 | 546 |
| 547 if (hasOptimizedCode()) { | |
| 548 attributes.add('optimized'); | |
| 549 } | |
| 550 if (hasUnoptimizedCode()) { | |
| 551 attributes.add('unoptimized'); | |
| 552 } | |
| 553 if (isInlined()) { | |
| 554 attributes.add('inlined'); | |
| 555 } | |
| 556 _addKindBasedAttributes(attributes); | 547 _addKindBasedAttributes(attributes); |
| 557 exclusiveTicks = int.parse(data['exclusiveTicks']); | 548 exclusiveTicks = int.parse(data['exclusiveTicks']); |
| 558 inclusiveTicks = int.parse(data['inclusiveTicks']); | 549 inclusiveTicks = int.parse(data['inclusiveTicks']); |
| 559 | 550 |
| 560 normalizedExclusiveTicks = exclusiveTicks / profile.sampleCount; | 551 normalizedExclusiveTicks = exclusiveTicks / profile.sampleCount; |
| 561 normalizedInclusiveTicks = inclusiveTicks / profile.sampleCount; | 552 normalizedInclusiveTicks = inclusiveTicks / profile.sampleCount; |
| 562 | 553 |
| 563 formattedExclusivePercent = | 554 formattedExclusivePercent = |
| 564 Utils.formatPercent(exclusiveTicks, profile.sampleCount); | 555 Utils.formatPercent(exclusiveTicks, profile.sampleCount); |
| 565 | 556 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 int approximateMillisecondsForCount(count) { | 869 int approximateMillisecondsForCount(count) { |
| 879 var MICROSECONDS_PER_MILLISECOND = 1000.0; | 870 var MICROSECONDS_PER_MILLISECOND = 1000.0; |
| 880 return (count * samplePeriod) ~/ MICROSECONDS_PER_MILLISECOND; | 871 return (count * samplePeriod) ~/ MICROSECONDS_PER_MILLISECOND; |
| 881 } | 872 } |
| 882 | 873 |
| 883 double approximateSecondsForCount(count) { | 874 double approximateSecondsForCount(count) { |
| 884 var MICROSECONDS_PER_SECOND = 1000000.0; | 875 var MICROSECONDS_PER_SECOND = 1000000.0; |
| 885 return (count * samplePeriod) / MICROSECONDS_PER_SECOND; | 876 return (count * samplePeriod) / MICROSECONDS_PER_SECOND; |
| 886 } | 877 } |
| 887 } | 878 } |
| OLD | NEW |