Reviewers: Yang,

Message:
Patch supplied by Ben Noordhuis <[email protected]>.

LGTM.

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


BUG=v8:1937


Please review this at http://codereview.chromium.org/9386007/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M tools/tickprocessor-driver.js
  M tools/tickprocessor.js


Index: tools/tickprocessor-driver.js
diff --git a/tools/tickprocessor-driver.js b/tools/tickprocessor-driver.js
index 4201e43d3f6fe697acb662baf2b821dd023ac7d2..9af5ab6c797dffb64685934396b21febad6d1302 100644
--- a/tools/tickprocessor-driver.js
+++ b/tools/tickprocessor-driver.js
@@ -52,6 +52,7 @@ if (params.snapshotLogFileName) {
 var tickProcessor = new TickProcessor(
   new (entriesProviders[params.platform])(params.nm),
   params.separateIc,
+  params.callGraphSize,
   params.ignoreUnknown,
   params.stateFilter,
   snapshotLogProcessor);
Index: tools/tickprocessor.js
diff --git a/tools/tickprocessor.js b/tools/tickprocessor.js
index 5f57835524465066f9ba2e8d431485674e8a4020..05a3369255e4c14c0827a505023be13a618408da 100644
--- a/tools/tickprocessor.js
+++ b/tools/tickprocessor.js
@@ -146,7 +146,12 @@ SnapshotLogProcessor.prototype.getSerializedEntryName = function(pos) {


 function TickProcessor(
- cppEntriesProvider, separateIc, ignoreUnknown, stateFilter, snapshotLogProcessor) {
+    cppEntriesProvider,
+    separateIc,
+    callGraphSize,
+    ignoreUnknown,
+    stateFilter,
+    snapshotLogProcessor) {
   LogReader.call(this, {
       'shared-library': { parsers: [null, parseInt, parseInt],
           processor: this.processSharedLibrary },
@@ -181,6 +186,7 @@ function TickProcessor(
       'end-code-region': null });

   this.cppEntriesProvider_ = cppEntriesProvider;
+  this.callGraphSize_ = callGraphSize;
   this.ignoreUnknown_ = ignoreUnknown;
   this.stateFilter_ = stateFilter;
   this.snapshotLogProcessor_ = snapshotLogProcessor;
@@ -240,6 +246,7 @@ TickProcessor.CodeTypes = {

 TickProcessor.CALL_PROFILE_CUTOFF_PCT = 2.0;

+TickProcessor.CALL_GRAPH_SIZE = 5;

 /**
  * @override
@@ -535,7 +542,7 @@ TickProcessor.prototype.printHeavyProfile = function(profile, opt_indent) {
           padLeft(rec.parentTotalPercent.toFixed(1), 5) + '%  ' +
           indentStr + rec.internalFuncName);
     // Limit backtrace depth.
-    if (indent < 10) {
+    if (indent < 2 * self.callGraphSize_) {
       self.printHeavyProfile(rec.children, indent + 2);
     }
     // Delimit top-level functions.
@@ -764,6 +771,8 @@ function ArgumentsProcessor(args) {
         'Show only ticks from OTHER VM state'],
     '-e': ['stateFilter', TickProcessor.VmStates.EXTERNAL,
         'Show only ticks from EXTERNAL VM state'],
+    '--call-graph-size': ['callGraphSize', TickProcessor.CALL_GRAPH_SIZE,
+        'Set the call graph size'],
     '--ignore-unknown': ['ignoreUnknown', true,
         'Exclude ticks of unknown code entries from processing'],
     '--separate-ic': ['separateIc', true,
@@ -792,6 +801,7 @@ ArgumentsProcessor.DEFAULTS = {
   snapshotLogFileName: null,
   platform: 'unix',
   stateFilter: null,
+  callGraphSize: 5,
   ignoreUnknown: false,
   separateIc: false,
   nm: 'nm'


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to