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<NodeT extends M.CallTreeNode> | 7 abstract class CallTreeNode<NodeT extends M.CallTreeNode> |
8 implements M.CallTreeNode { | 8 implements M.CallTreeNode { |
9 final List<NodeT> children; | 9 final List<NodeT> children; |
10 final int count; | 10 final int count; |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 final intervalTicks = new Map<int, InlineIntervalTick>(); | 466 final intervalTicks = new Map<int, InlineIntervalTick>(); |
467 String formattedInclusiveTicks = ''; | 467 String formattedInclusiveTicks = ''; |
468 String formattedExclusiveTicks = ''; | 468 String formattedExclusiveTicks = ''; |
469 String formattedExclusivePercent = ''; | 469 String formattedExclusivePercent = ''; |
470 String formattedCpuTime = ''; | 470 String formattedCpuTime = ''; |
471 String formattedOnStackTime = ''; | 471 String formattedOnStackTime = ''; |
472 final Set<String> attributes = new Set<String>(); | 472 final Set<String> attributes = new Set<String>(); |
473 final Map<ProfileCode, int> callers = new Map<ProfileCode, int>(); | 473 final Map<ProfileCode, int> callers = new Map<ProfileCode, int>(); |
474 final Map<ProfileCode, int> callees = new Map<ProfileCode, int>(); | 474 final Map<ProfileCode, int> callees = new Map<ProfileCode, int>(); |
475 | 475 |
476 void _processTicks(List<String> profileTicks) { | 476 void _processTicks(List<dynamic> profileTicks) { |
477 assert(profileTicks != null); | 477 assert(profileTicks != null); |
478 assert((profileTicks.length % 3) == 0); | 478 assert((profileTicks.length % 3) == 0); |
479 for (var i = 0; i < profileTicks.length; i += 3) { | 479 for (var i = 0; i < profileTicks.length; i += 3) { |
480 // TODO(observatory): Address is not necessarily representable as a JS | 480 // TODO(observatory): Address is not necessarily representable as a JS |
481 // integer. | 481 // integer. |
482 var address = int.parse(profileTicks[i], radix: 16); | 482 var address = int.parse(profileTicks[i] as String, radix: 16); |
483 var exclusive = profileTicks[i + 1]; | 483 var exclusive = profileTicks[i + 1] as int; |
484 var inclusive = profileTicks[i + 2]; | 484 var inclusive = profileTicks[i + 2] as int; |
485 var tick = new CodeTick(exclusive, inclusive); | 485 var tick = new CodeTick(exclusive, inclusive); |
486 addressTicks[address] = tick; | 486 addressTicks[address] = tick; |
487 | 487 |
488 var interval = code.findInterval(address); | 488 var interval = code.findInterval(address); |
489 if (interval != null) { | 489 if (interval != null) { |
490 var intervalTick = intervalTicks[interval.start]; | 490 var intervalTick = intervalTicks[interval.start]; |
491 if (intervalTick == null) { | 491 if (intervalTick == null) { |
492 // Insert into map. | 492 // Insert into map. |
493 intervalTick = new InlineIntervalTick(interval.start); | 493 intervalTick = new InlineIntervalTick(interval.start); |
494 intervalTicks[interval.start] = intervalTick; | 494 intervalTicks[interval.start] = intervalTick; |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 } | 1075 } |
1076 | 1076 |
1077 int approximateMillisecondsForCount(count) { | 1077 int approximateMillisecondsForCount(count) { |
1078 return (count * samplePeriod) ~/ Duration.MICROSECONDS_PER_MILLISECOND; | 1078 return (count * samplePeriod) ~/ Duration.MICROSECONDS_PER_MILLISECOND; |
1079 } | 1079 } |
1080 | 1080 |
1081 double approximateSecondsForCount(count) { | 1081 double approximateSecondsForCount(count) { |
1082 return (count * samplePeriod) / Duration.MICROSECONDS_PER_SECOND; | 1082 return (count * samplePeriod) / Duration.MICROSECONDS_PER_SECOND; |
1083 } | 1083 } |
1084 } | 1084 } |
OLD | NEW |