Revision: 22801
Author: [email protected]
Date: Mon Aug 4 08:31:49 2014 UTC
Log: Tick processor: improved [Summary] section
[email protected]
Review URL: https://codereview.chromium.org/433043003
http://code.google.com/p/v8/source/detail?r=22801
Modified:
/branches/bleeding_edge/tools/profile_view.js
/branches/bleeding_edge/tools/tickprocessor.js
=======================================
--- /branches/bleeding_edge/tools/profile_view.js Thu Feb 10 07:47:28 2011
UTC
+++ /branches/bleeding_edge/tools/profile_view.js Mon Aug 4 08:31:49 2014
UTC
@@ -168,24 +168,6 @@
};
-/**
- * Returns a share of the function's total time in application's total
time.
- */
-ProfileView.Node.prototype.__defineGetter__(
- 'totalPercent',
- function() { return this.totalTime /
- (this.head ? this.head.totalTime : this.totalTime) * 100.0; });
-
-
-/**
- * Returns a share of the function's self time in application's total time.
- */
-ProfileView.Node.prototype.__defineGetter__(
- 'selfPercent',
- function() { return this.selfTime /
- (this.head ? this.head.totalTime : this.totalTime) * 100.0; });
-
-
/**
* Returns a share of the function's total time in its parent's total time.
*/
=======================================
--- /branches/bleeding_edge/tools/tickprocessor.js Fri Nov 22 13:50:39 2013
UTC
+++ /branches/bleeding_edge/tools/tickprocessor.js Mon Aug 4 08:31:49 2014
UTC
@@ -440,12 +440,6 @@
this.ticks_.excluded + ' excluded).');
if (this.ticks_.total == 0) return;
-
- // Print the unknown ticks percentage if they are not ignored.
- if (!this.ignoreUnknown_ && this.ticks_.unaccounted > 0) {
- this.printHeader('Unknown');
- this.printCounter(this.ticks_.unaccounted, this.ticks_.total);
- }
var flatProfile = this.profile_.getFlatProfile();
var flatView = this.viewBuilder_.buildView(flatProfile);
@@ -457,33 +451,39 @@
if (this.ignoreUnknown_) {
totalTicks -= this.ticks_.unaccounted;
}
- // Our total time contains all the ticks encountered,
- // while profile only knows about the filtered ticks.
- flatView.head.totalTime = totalTicks;
// Count library ticks
var flatViewNodes = flatView.head.children;
var self = this;
+
var libraryTicks = 0;
- this.processProfile(flatViewNodes,
+ this.printHeader('Shared libraries');
+ this.printEntries(flatViewNodes, totalTicks, null,
function(name) { return self.isSharedLibrary(name); },
function(rec) { libraryTicks += rec.selfTime; });
var nonLibraryTicks = totalTicks - libraryTicks;
- this.printHeader('Shared libraries');
- this.printEntries(flatViewNodes, null,
- function(name) { return self.isSharedLibrary(name); });
-
+ var jsTicks = 0;
this.printHeader('JavaScript');
- this.printEntries(flatViewNodes, nonLibraryTicks,
- function(name) { return self.isJsCode(name); });
+ this.printEntries(flatViewNodes, totalTicks, nonLibraryTicks,
+ function(name) { return self.isJsCode(name); },
+ function(rec) { jsTicks += rec.selfTime; });
+ var cppTicks = 0;
this.printHeader('C++');
- this.printEntries(flatViewNodes, nonLibraryTicks,
- function(name) { return self.isCppCode(name); });
+ this.printEntries(flatViewNodes, totalTicks, nonLibraryTicks,
+ function(name) { return self.isCppCode(name); },
+ function(rec) { cppTicks += rec.selfTime; });
- this.printHeader('GC');
- this.printCounter(this.ticks_.gc, totalTicks);
+ this.printHeader('Summary');
+ this.printLine('JavaScript', jsTicks, totalTicks, nonLibraryTicks);
+ this.printLine('C++', cppTicks, totalTicks, nonLibraryTicks);
+ this.printLine('GC', this.ticks_.gc, totalTicks, nonLibraryTicks);
+ this.printLine('Shared libraries', libraryTicks, totalTicks, null);
+ if (!this.ignoreUnknown_ && this.ticks_.unaccounted > 0) {
+ this.printLine('Unaccounted', this.ticks_.unaccounted,
+ this.ticks_.total, null);
+ }
this.printHeavyProfHeader();
var heavyProfile = this.profile_.getBottomUpProfile();
@@ -516,6 +516,18 @@
print(' ticks total nonlib name');
};
+
+TickProcessor.prototype.printLine = function(
+ entry, ticks, totalTicks, nonLibTicks) {
+ var pct = ticks * 100 / totalTicks;
+ var nonLibPct = nonLibTicks != null
+ ? padLeft((ticks * 100 / nonLibTicks).toFixed(1), 5) + '% '
+ : ' ';
+ print(' ' + padLeft(ticks, 5) + ' ' +
+ padLeft(pct.toFixed(1), 5) + '% ' +
+ nonLibPct +
+ entry);
+}
TickProcessor.prototype.printHeavyProfHeader = function() {
print('\n [Bottom up (heavy) profile]:');
@@ -529,12 +541,6 @@
};
-TickProcessor.prototype.printCounter = function(ticksCount,
totalTicksCount) {
- var pct = ticksCount * 100.0 / totalTicksCount;
- print(' ' + padLeft(ticksCount, 5) + ' ' + padLeft(pct.toFixed(1), 5)
+ '%');
-};
-
-
TickProcessor.prototype.processProfile = function(
profile, filterP, func) {
for (var i = 0, n = profile.length; i < n; ++i) {
@@ -580,18 +586,13 @@
};
TickProcessor.prototype.printEntries = function(
- profile, nonLibTicks, filterP) {
+ profile, totalTicks, nonLibTicks, filterP, callback) {
var that = this;
this.processProfile(profile, filterP, function (rec) {
if (rec.selfTime == 0) return;
- var nonLibPct = nonLibTicks != null ?
- rec.selfTime * 100.0 / nonLibTicks : 0.0;
+ callback(rec);
var funcName = that.formatFunctionName(rec.internalFuncName);
-
- print(' ' + padLeft(rec.selfTime, 5) + ' ' +
- padLeft(rec.selfPercent.toFixed(1), 5) + '% ' +
- padLeft(nonLibPct.toFixed(1), 5) + '% ' +
- funcName);
+ that.printLine(funcName, rec.selfTime, totalTicks, nonLibTicks);
});
};
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.