OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 obj_index++; | 490 obj_index++; |
491 } | 491 } |
492 | 492 |
493 if (execution_pauses.length == 0) { | 493 if (execution_pauses.length == 0) { |
494 // Force plot and return without plotting execution pause impulses. | 494 // Force plot and return without plotting execution pause impulses. |
495 output("plot 1/0"); | 495 output("plot 1/0"); |
496 return; | 496 return; |
497 } | 497 } |
498 | 498 |
499 // Label the longest pauses. | 499 // Label the longest pauses. |
| 500 execution_pauses = |
| 501 RestrictRangesTo(execution_pauses, range_start, range_end); |
500 execution_pauses.sort( | 502 execution_pauses.sort( |
501 function(a, b) { return b.duration() - a.duration(); }); | 503 function(a, b) { return b.duration() - a.duration(); }); |
502 | 504 |
503 var max_pause_time = execution_pauses[0].duration(); | 505 var max_pause_time = execution_pauses[0].duration(); |
504 padding = kPauseLabelPadding * (range_end - range_start) / kResX; | 506 padding = kPauseLabelPadding * (range_end - range_start) / kResX; |
505 var y_scale = kY1Offset / max_pause_time / 2; | 507 var y_scale = kY1Offset / max_pause_time / 2; |
506 for (var i = 0; i < execution_pauses.length && i < kNumPauseLabels; i++) { | 508 for (var i = 0; i < execution_pauses.length && i < kNumPauseLabels; i++) { |
507 var pause = execution_pauses[i]; | 509 var pause = execution_pauses[i]; |
508 var label_content = (pause.duration() | 0) + " ms"; | 510 var label_content = (pause.duration() | 0) + " ms"; |
509 var label_x = pause.end + padding; | 511 var label_x = pause.end + padding; |
(...skipping 10 matching lines...) Expand all Loading... |
520 output("plot '-' using 1:2 axes x1y2 with impulses ls 1"); | 522 output("plot '-' using 1:2 axes x1y2 with impulses ls 1"); |
521 for (var i = 0; i < execution_pauses.length; i++) { | 523 for (var i = 0; i < execution_pauses.length; i++) { |
522 var pause = execution_pauses[i]; | 524 var pause = execution_pauses[i]; |
523 output(pause.end + " " + pause.duration()); | 525 output(pause.end + " " + pause.duration()); |
524 obj_index++; | 526 obj_index++; |
525 } | 527 } |
526 output("e"); | 528 output("e"); |
527 return obj_index; | 529 return obj_index; |
528 }; | 530 }; |
529 } | 531 } |
OLD | NEW |