OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 'snapshot-pos': { parsers: [parseInt, parseInt], | 162 'snapshot-pos': { parsers: [parseInt, parseInt], |
163 processor: this.processSnapshotPosition }, | 163 processor: this.processSnapshotPosition }, |
164 'tick': { | 164 'tick': { |
165 parsers: [parseInt, parseInt, parseInt, | 165 parsers: [parseInt, parseInt, parseInt, |
166 parseInt, parseInt, 'var-args'], | 166 parseInt, parseInt, 'var-args'], |
167 processor: this.processTick }, | 167 processor: this.processTick }, |
168 'heap-sample-begin': { parsers: [null, null, parseInt], | 168 'heap-sample-begin': { parsers: [null, null, parseInt], |
169 processor: this.processHeapSampleBegin }, | 169 processor: this.processHeapSampleBegin }, |
170 'heap-sample-end': { parsers: [null, null], | 170 'heap-sample-end': { parsers: [null, null], |
171 processor: this.processHeapSampleEnd }, | 171 processor: this.processHeapSampleEnd }, |
172 'heap-js-prod-item': { parsers: [null, 'var-args'], | |
173 processor: this.processJSProducer }, | |
174 // Ignored events. | 172 // Ignored events. |
175 'profiler': null, | 173 'profiler': null, |
176 'function-creation': null, | 174 'function-creation': null, |
177 'function-move': null, | 175 'function-move': null, |
178 'function-delete': null, | 176 'function-delete': null, |
179 'heap-sample-stats': null, | |
180 'heap-sample-item': null, | 177 'heap-sample-item': null, |
181 'heap-js-cons-item': null, | |
182 'heap-js-ret-item': null, | |
183 // Obsolete row types. | 178 // Obsolete row types. |
184 'code-allocate': null, | 179 'code-allocate': null, |
185 'begin-code-region': null, | 180 'begin-code-region': null, |
186 'end-code-region': null }); | 181 'end-code-region': null }); |
187 | 182 |
188 this.cppEntriesProvider_ = cppEntriesProvider; | 183 this.cppEntriesProvider_ = cppEntriesProvider; |
189 this.ignoreUnknown_ = ignoreUnknown; | 184 this.ignoreUnknown_ = ignoreUnknown; |
190 this.stateFilter_ = stateFilter; | 185 this.stateFilter_ = stateFilter; |
191 this.snapshotLogProcessor_ = snapshotLogProcessor; | 186 this.snapshotLogProcessor_ = snapshotLogProcessor; |
192 this.deserializedEntriesNames_ = []; | 187 this.deserializedEntriesNames_ = []; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 producersView.sort(function(rec1, rec2) { | 389 producersView.sort(function(rec1, rec2) { |
395 return rec2.totalTime - rec1.totalTime || | 390 return rec2.totalTime - rec1.totalTime || |
396 (rec2.internalFuncName < rec1.internalFuncName ? -1 : 1); }); | 391 (rec2.internalFuncName < rec1.internalFuncName ? -1 : 1); }); |
397 this.printHeavyProfile(producersView.head.children); | 392 this.printHeavyProfile(producersView.head.children); |
398 | 393 |
399 this.currentProducerProfile_ = null; | 394 this.currentProducerProfile_ = null; |
400 this.generation_++; | 395 this.generation_++; |
401 }; | 396 }; |
402 | 397 |
403 | 398 |
404 TickProcessor.prototype.processJSProducer = function(constructor, stack) { | |
405 if (!this.currentProducerProfile_) return; | |
406 if (stack.length == 0) return; | |
407 var first = stack.shift(); | |
408 var processedStack = | |
409 this.profile_.resolveAndFilterFuncs_(this.processStack(first, 0, stack)); | |
410 processedStack.unshift(constructor); | |
411 this.currentProducerProfile_.addPath(processedStack); | |
412 }; | |
413 | |
414 | |
415 TickProcessor.prototype.printStatistics = function() { | 399 TickProcessor.prototype.printStatistics = function() { |
416 print('Statistical profiling result from ' + this.lastLogFileName_ + | 400 print('Statistical profiling result from ' + this.lastLogFileName_ + |
417 ', (' + this.ticks_.total + | 401 ', (' + this.ticks_.total + |
418 ' ticks, ' + this.ticks_.unaccounted + ' unaccounted, ' + | 402 ' ticks, ' + this.ticks_.unaccounted + ' unaccounted, ' + |
419 this.ticks_.excluded + ' excluded).'); | 403 this.ticks_.excluded + ' excluded).'); |
420 | 404 |
421 if (this.ticks_.total == 0) return; | 405 if (this.ticks_.total == 0) return; |
422 | 406 |
423 // Print the unknown ticks percentage if they are not ignored. | 407 // Print the unknown ticks percentage if they are not ignored. |
424 if (!this.ignoreUnknown_ && this.ticks_.unaccounted > 0) { | 408 if (!this.ignoreUnknown_ && this.ticks_.unaccounted > 0) { |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) { | 852 if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) { |
869 synonims.push(synArg); | 853 synonims.push(synArg); |
870 delete this.argsDispatch_[synArg]; | 854 delete this.argsDispatch_[synArg]; |
871 } | 855 } |
872 } | 856 } |
873 print(' ' + padRight(synonims.join(', '), 20) + dispatch[2]); | 857 print(' ' + padRight(synonims.join(', '), 20) + dispatch[2]); |
874 } | 858 } |
875 quit(2); | 859 quit(2); |
876 }; | 860 }; |
877 | 861 |
OLD | NEW |