Bug 281137 Add profiling column for functions excluding other functions running

Venkman part
patch by silver@warwickcompsoc.co.uk r=rginda sr=dmose a=bsmedberg
This commit is contained in:
timeless%mozdev.org 2005-08-02 15:55:56 +00:00
parent d2b31f1255
commit 10cef0ef3e
5 changed files with 23 additions and 4 deletions

View File

@ -97,6 +97,10 @@ function pro_sumscript (scriptWrapper, key)
var min_ms = roundTo(jsdScript.minExecutionTime, 2); var min_ms = roundTo(jsdScript.minExecutionTime, 2);
var max_ms = roundTo(jsdScript.maxExecutionTime, 2); var max_ms = roundTo(jsdScript.maxExecutionTime, 2);
var avg_ms = roundTo(jsdScript.totalExecutionTime / ccount, 2); var avg_ms = roundTo(jsdScript.totalExecutionTime / ccount, 2);
var own_tot_ms = roundTo(jsdScript.totalOwnExecutionTime, 2);
var own_min_ms = roundTo(jsdScript.minOwnExecutionTime, 2);
var own_max_ms = roundTo(jsdScript.maxOwnExecutionTime, 2);
var own_avg_ms = roundTo(jsdScript.totalOwnExecutionTime / ccount, 2);
var recurse = jsdScript.maxRecurseDepth; var recurse = jsdScript.maxRecurseDepth;
var summary = new Object(); var summary = new Object();
@ -105,17 +109,23 @@ function pro_sumscript (scriptWrapper, key)
summary.avg = avg_ms; summary.avg = avg_ms;
summary.min = min_ms; summary.min = min_ms;
summary.max = max_ms; summary.max = max_ms;
summary.own_avg = own_avg_ms;
summary.own_min = own_min_ms;
summary.own_max = own_max_ms;
summary.own_total = own_tot_ms;
summary.recurse = recurse; summary.recurse = recurse;
summary.url = jsdScript.fileName; summary.url = jsdScript.fileName;
summary.file = getFileFromPath(summary.url); summary.file = getFileFromPath(summary.url);
summary.base = jsdScript.baseLineNumber; summary.base = jsdScript.baseLineNumber;
summary.end = summary.base + jsdScript.lineExtent; summary.end = summary.base + jsdScript.lineExtent;
summary.fun = scriptWrapper.functionName; summary.fun = scriptWrapper.functionName;
var own_str = getMsg(MSN_FMT_PROFILE_STR2, [own_tot_ms, own_min_ms,
own_max_ms, own_avg_ms]);
summary.str = getMsg(MSN_FMT_PROFILE_STR, summary.str = getMsg(MSN_FMT_PROFILE_STR,
[summary.fun, summary.base, summary.end, ccount, [summary.fun, summary.base, summary.end, ccount,
(summary.recurse ? (summary.recurse ?
getMsg(MSN_FMT_PROFILE_RECURSE, recurse) : ""), getMsg(MSN_FMT_PROFILE_RECURSE, recurse) : ""),
tot_ms, min_ms, max_ms, avg_ms]); tot_ms, min_ms, max_ms, avg_ms, own_str]);
summary.key = summary[key]; summary.key = summary[key];
return summary; return summary;
} }
@ -266,6 +276,10 @@ function pro_rptinst (profileReport, scriptInstance, sectionData)
"\\$min-time" : summary.min, "\\$min-time" : summary.min,
"\\$avg-time" : summary.avg, "\\$avg-time" : summary.avg,
"\\$total-time" : summary.total, "\\$total-time" : summary.total,
"\\$own-max-time" : summary.own_max,
"\\$own-min-time" : summary.own_min,
"\\$own-avg-time" : summary.own_avg,
"\\$own-total-time" : summary.own_total,
"\\$call-count" : summary.ccount, "\\$call-count" : summary.ccount,
"\\$recurse-depth" : summary.recurse, "\\$recurse-depth" : summary.recurse,
"\\$function-name" : fromUnicode(summary.fun, MSG_REPORT_CHARSET), "\\$function-name" : fromUnicode(summary.fun, MSG_REPORT_CHARSET),

View File

@ -1,4 +1,4 @@
# full-url, file-name, function-name, start-line, end-line, call-count, recurse-depth, total-time, min-time, max-time, avg-time # full-url, file-name, function-name, start-line, end-line, call-count, recurse-depth, total-time, min-time, max-time, avg-time, own-total-time, own-min-time, own-max-time, own-avg-time
@-item-start @-item-start
$full-url, $file-name, $function-name, $start-line, $end-line, $call-count, $recurse-depth, $total-time, $min-time, $max-time, $avg-time $full-url, $file-name, $function-name, $start-line, $end-line, $call-count, $recurse-depth, $total-time, $min-time, $max-time, $avg-time, $own-total-time, $own-min-time, $own-max-time, $own-avg-time
@-item-end @-item-end

View File

@ -16,6 +16,7 @@ $section-number <$full-url>
Function Name: $function-name (Lines $start-line - $end-line) Function Name: $function-name (Lines $start-line - $end-line)
Total Calls: $call-count (max recurse $recurse-depth) Total Calls: $call-count (max recurse $recurse-depth)
Total Time: $total-time (min/max/avg $min-time/$max-time/$avg-time) Total Time: $total-time (min/max/avg $min-time/$max-time/$avg-time)
Time (ex. calls): $own-total-time (min/max/avg $own-min-time/$own-max-time/$own-avg-time)
@-item-end @-item-end
------------------------------------------------------------------------------- -------------------------------------------------------------------------------

View File

@ -29,6 +29,9 @@
mintime="$min-time" mintime="$min-time"
maxtime="$max-time" maxtime="$max-time"
totaltime="$total-time" totaltime="$total-time"
ownmintime="$own-min-time"
ownmaxtime="$own-max-time"
owntotaltime="$own-total-time"
callcount="$call-count" callcount="$call-count"
function="$function-name" function="$function-name"
filename="$file-name" filename="$file-name"

View File

@ -296,7 +296,8 @@ msn.fmt.frame.line = #%1$S: %2$S"
msn.fmt.frame.location = %1$S, line %2$S, pc %3$S msn.fmt.frame.location = %1$S, line %2$S, pc %3$S
# 1: function name, 2: start line, 3: end line, 4: call count, 5: recurse, # 1: function name, 2: start line, 3: end line, 4: call count, 5: recurse,
# 6: total, 7: min, 8: max, 9: avg # 6: total, 7: min, 8: max, 9: avg
msn.fmt.profile.str = %1$S: %2$S-%3$S, %4$S call(s)%5$S, %6$Sms total, %7$Sms min, %8$Sms max, %9$Sms avg msn.fmt.profile.str = %1$S: %2$S-%3$S, %4$S call(s)%5$S, %6$Sms total, %7$Sms min, %8$Sms max, %9$Sms avg, excluding calls: %10$S
msn.fmt.profile.str2 = %1$Sms total, %2$Sms min, %3$Sms max, %4$Sms avg
# 1: max recurse depth # 1: max recurse depth
msn.fmt.profile.recurse = " (max depth %1$S) msn.fmt.profile.recurse = " (max depth %1$S)