OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
423 heavyView.head.totalTime = totalTicks; | 423 heavyView.head.totalTime = totalTicks; |
424 // Sort by total time, desc, then by name, desc. | 424 // Sort by total time, desc, then by name, desc. |
425 heavyView.sort(function(rec1, rec2) { | 425 heavyView.sort(function(rec1, rec2) { |
426 return rec2.totalTime - rec1.totalTime || | 426 return rec2.totalTime - rec1.totalTime || |
427 (rec2.internalFuncName < rec1.internalFuncName ? -1 : 1); }); | 427 (rec2.internalFuncName < rec1.internalFuncName ? -1 : 1); }); |
428 this.printHeavyProfile(heavyView.head.children); | 428 this.printHeavyProfile(heavyView.head.children); |
429 } | 429 } |
430 }; | 430 }; |
431 | 431 |
432 | 432 |
433 TickProcessor.prototype.dumpCppEntries = function() { | |
434 var staticEntries = this.profile_.getAllStaticEntries(); | |
435 var total = staticEntries.length; | |
436 for (var i = 0; i < total; ++i) { | |
437 var entry = staticEntries[i]; | |
438 var printValues = ['cpp', '0x' + entry[0].toString(16), entry[1].size, | |
439 '"' + entry[1].name + '"']; | |
440 print(printValues.join(',')); | |
441 } | |
442 }; | |
443 | |
444 | |
433 function padLeft(s, len) { | 445 function padLeft(s, len) { |
434 s = s.toString(); | 446 s = s.toString(); |
435 if (s.length < len) { | 447 if (s.length < len) { |
436 var padLength = len - s.length; | 448 var padLength = len - s.length; |
437 if (!(padLength in padLeft)) { | 449 if (!(padLength in padLeft)) { |
438 padLeft[padLength] = new Array(padLength + 1).join(' '); | 450 padLeft[padLength] = new Array(padLength + 1).join(' '); |
439 } | 451 } |
440 s = padLeft[padLength] + s; | 452 s = padLeft[padLength] + s; |
441 } | 453 } |
442 return s; | 454 return s; |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
772 '-g': ['stateFilter', TickProcessor.VmStates.GC, | 784 '-g': ['stateFilter', TickProcessor.VmStates.GC, |
773 'Show only ticks from GC VM state'], | 785 'Show only ticks from GC VM state'], |
774 '-c': ['stateFilter', TickProcessor.VmStates.COMPILER, | 786 '-c': ['stateFilter', TickProcessor.VmStates.COMPILER, |
775 'Show only ticks from COMPILER VM state'], | 787 'Show only ticks from COMPILER VM state'], |
776 '-o': ['stateFilter', TickProcessor.VmStates.OTHER, | 788 '-o': ['stateFilter', TickProcessor.VmStates.OTHER, |
777 'Show only ticks from OTHER VM state'], | 789 'Show only ticks from OTHER VM state'], |
778 '-e': ['stateFilter', TickProcessor.VmStates.EXTERNAL, | 790 '-e': ['stateFilter', TickProcessor.VmStates.EXTERNAL, |
779 'Show only ticks from EXTERNAL VM state'], | 791 'Show only ticks from EXTERNAL VM state'], |
780 '--call-graph-size': ['callGraphSize', TickProcessor.CALL_GRAPH_SIZE, | 792 '--call-graph-size': ['callGraphSize', TickProcessor.CALL_GRAPH_SIZE, |
781 'Set the call graph size'], | 793 'Set the call graph size'], |
794 '--dump-cpp': ['dumpCppEntries', true, | |
fmeawad
2016/04/14 11:42:50
I think it should be dump-cpp-symbols and the desc
| |
795 'Dump C++ Entries'], | |
782 '--ignore-unknown': ['ignoreUnknown', true, | 796 '--ignore-unknown': ['ignoreUnknown', true, |
783 'Exclude ticks of unknown code entries from processing'], | 797 'Exclude ticks of unknown code entries from processing'], |
784 '--separate-ic': ['separateIc', true, | 798 '--separate-ic': ['separateIc', true, |
785 'Separate IC entries'], | 799 'Separate IC entries'], |
786 '--unix': ['platform', 'unix', | 800 '--unix': ['platform', 'unix', |
787 'Specify that we are running on *nix platform'], | 801 'Specify that we are running on *nix platform'], |
788 '--windows': ['platform', 'windows', | 802 '--windows': ['platform', 'windows', |
789 'Specify that we are running on Windows platform'], | 803 'Specify that we are running on Windows platform'], |
790 '--mac': ['platform', 'mac', | 804 '--mac': ['platform', 'mac', |
791 'Specify that we are running on Mac OS X platform'], | 805 'Specify that we are running on Mac OS X platform'], |
(...skipping 21 matching lines...) Expand all Loading... | |
813 this.argsDispatch_['--external'] = this.argsDispatch_['-e']; | 827 this.argsDispatch_['--external'] = this.argsDispatch_['-e']; |
814 this.argsDispatch_['--ptr'] = this.argsDispatch_['--pairwise-timed-range']; | 828 this.argsDispatch_['--ptr'] = this.argsDispatch_['--pairwise-timed-range']; |
815 }; | 829 }; |
816 | 830 |
817 | 831 |
818 ArgumentsProcessor.DEFAULTS = { | 832 ArgumentsProcessor.DEFAULTS = { |
819 logFileName: 'v8.log', | 833 logFileName: 'v8.log', |
820 platform: 'unix', | 834 platform: 'unix', |
821 stateFilter: null, | 835 stateFilter: null, |
822 callGraphSize: 5, | 836 callGraphSize: 5, |
837 dumpCppEntries: false, | |
823 ignoreUnknown: false, | 838 ignoreUnknown: false, |
824 separateIc: false, | 839 separateIc: false, |
825 targetRootFS: '', | 840 targetRootFS: '', |
826 nm: 'nm', | 841 nm: 'nm', |
827 range: 'auto,auto', | 842 range: 'auto,auto', |
828 distortion: 0, | 843 distortion: 0, |
829 timedRange: false, | 844 timedRange: false, |
830 pairwiseTimedRange: false, | 845 pairwiseTimedRange: false, |
831 onlySummary: false | 846 onlySummary: false |
832 }; | 847 }; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
881 for (var synArg in this.argsDispatch_) { | 896 for (var synArg in this.argsDispatch_) { |
882 if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) { | 897 if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) { |
883 synonyms.push(synArg); | 898 synonyms.push(synArg); |
884 delete this.argsDispatch_[synArg]; | 899 delete this.argsDispatch_[synArg]; |
885 } | 900 } |
886 } | 901 } |
887 print(' ' + padRight(synonyms.join(', '), 20) + " " + dispatch[2]); | 902 print(' ' + padRight(synonyms.join(', '), 20) + " " + dispatch[2]); |
888 } | 903 } |
889 quit(2); | 904 quit(2); |
890 }; | 905 }; |
OLD | NEW |