Commit 80326e08 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Add --call-graph-size option to tickprocessor.

BUG=v8:1937

Review URL: https://chromiumcodereview.appspot.com/9386007
Patch from Ben Noordhuis <info@bnoordhuis.nl>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10680 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 0801e4c3
...@@ -52,6 +52,7 @@ if (params.snapshotLogFileName) { ...@@ -52,6 +52,7 @@ if (params.snapshotLogFileName) {
var tickProcessor = new TickProcessor( var tickProcessor = new TickProcessor(
new (entriesProviders[params.platform])(params.nm), new (entriesProviders[params.platform])(params.nm),
params.separateIc, params.separateIc,
params.callGraphSize,
params.ignoreUnknown, params.ignoreUnknown,
params.stateFilter, params.stateFilter,
snapshotLogProcessor); snapshotLogProcessor);
......
...@@ -146,7 +146,12 @@ SnapshotLogProcessor.prototype.getSerializedEntryName = function(pos) { ...@@ -146,7 +146,12 @@ SnapshotLogProcessor.prototype.getSerializedEntryName = function(pos) {
function TickProcessor( function TickProcessor(
cppEntriesProvider, separateIc, ignoreUnknown, stateFilter, snapshotLogProcessor) { cppEntriesProvider,
separateIc,
callGraphSize,
ignoreUnknown,
stateFilter,
snapshotLogProcessor) {
LogReader.call(this, { LogReader.call(this, {
'shared-library': { parsers: [null, parseInt, parseInt], 'shared-library': { parsers: [null, parseInt, parseInt],
processor: this.processSharedLibrary }, processor: this.processSharedLibrary },
...@@ -181,6 +186,7 @@ function TickProcessor( ...@@ -181,6 +186,7 @@ function TickProcessor(
'end-code-region': null }); 'end-code-region': null });
this.cppEntriesProvider_ = cppEntriesProvider; this.cppEntriesProvider_ = cppEntriesProvider;
this.callGraphSize_ = callGraphSize;
this.ignoreUnknown_ = ignoreUnknown; this.ignoreUnknown_ = ignoreUnknown;
this.stateFilter_ = stateFilter; this.stateFilter_ = stateFilter;
this.snapshotLogProcessor_ = snapshotLogProcessor; this.snapshotLogProcessor_ = snapshotLogProcessor;
...@@ -240,6 +246,7 @@ TickProcessor.CodeTypes = { ...@@ -240,6 +246,7 @@ TickProcessor.CodeTypes = {
TickProcessor.CALL_PROFILE_CUTOFF_PCT = 2.0; TickProcessor.CALL_PROFILE_CUTOFF_PCT = 2.0;
TickProcessor.CALL_GRAPH_SIZE = 5;
/** /**
* @override * @override
...@@ -535,7 +542,7 @@ TickProcessor.prototype.printHeavyProfile = function(profile, opt_indent) { ...@@ -535,7 +542,7 @@ TickProcessor.prototype.printHeavyProfile = function(profile, opt_indent) {
padLeft(rec.parentTotalPercent.toFixed(1), 5) + '% ' + padLeft(rec.parentTotalPercent.toFixed(1), 5) + '% ' +
indentStr + rec.internalFuncName); indentStr + rec.internalFuncName);
// Limit backtrace depth. // Limit backtrace depth.
if (indent < 10) { if (indent < 2 * self.callGraphSize_) {
self.printHeavyProfile(rec.children, indent + 2); self.printHeavyProfile(rec.children, indent + 2);
} }
// Delimit top-level functions. // Delimit top-level functions.
...@@ -764,6 +771,8 @@ function ArgumentsProcessor(args) { ...@@ -764,6 +771,8 @@ function ArgumentsProcessor(args) {
'Show only ticks from OTHER VM state'], 'Show only ticks from OTHER VM state'],
'-e': ['stateFilter', TickProcessor.VmStates.EXTERNAL, '-e': ['stateFilter', TickProcessor.VmStates.EXTERNAL,
'Show only ticks from EXTERNAL VM state'], 'Show only ticks from EXTERNAL VM state'],
'--call-graph-size': ['callGraphSize', TickProcessor.CALL_GRAPH_SIZE,
'Set the call graph size'],
'--ignore-unknown': ['ignoreUnknown', true, '--ignore-unknown': ['ignoreUnknown', true,
'Exclude ticks of unknown code entries from processing'], 'Exclude ticks of unknown code entries from processing'],
'--separate-ic': ['separateIc', true, '--separate-ic': ['separateIc', true,
...@@ -792,6 +801,7 @@ ArgumentsProcessor.DEFAULTS = { ...@@ -792,6 +801,7 @@ ArgumentsProcessor.DEFAULTS = {
snapshotLogFileName: null, snapshotLogFileName: null,
platform: 'unix', platform: 'unix',
stateFilter: null, stateFilter: null,
callGraphSize: 5,
ignoreUnknown: false, ignoreUnknown: false,
separateIc: false, separateIc: false,
nm: 'nm' nm: 'nm'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment