From 10cef0ef3e2801e6fcbb5d524003413ca3b42223 Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Tue, 2 Aug 2005 15:55:56 +0000 Subject: [PATCH] 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 --- .../resources/content/venkman-profiler.js | 16 +++++++++++++++- .../resources/locale/en-US/profile.csv.tpl | 4 ++-- .../resources/locale/en-US/profile.txt.tpl | 1 + .../resources/locale/en-US/profile.xml.tpl | 3 +++ .../resources/locale/en-US/venkman.properties | 3 ++- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/extensions/venkman/resources/content/venkman-profiler.js b/extensions/venkman/resources/content/venkman-profiler.js index 8699a90b2908..8065fd6ed0a9 100644 --- a/extensions/venkman/resources/content/venkman-profiler.js +++ b/extensions/venkman/resources/content/venkman-profiler.js @@ -97,6 +97,10 @@ function pro_sumscript (scriptWrapper, key) var min_ms = roundTo(jsdScript.minExecutionTime, 2); var max_ms = roundTo(jsdScript.maxExecutionTime, 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 summary = new Object(); @@ -105,17 +109,23 @@ function pro_sumscript (scriptWrapper, key) summary.avg = avg_ms; summary.min = min_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.url = jsdScript.fileName; summary.file = getFileFromPath(summary.url); summary.base = jsdScript.baseLineNumber; summary.end = summary.base + jsdScript.lineExtent; 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.fun, summary.base, summary.end, ccount, (summary.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]; return summary; } @@ -266,6 +276,10 @@ function pro_rptinst (profileReport, scriptInstance, sectionData) "\\$min-time" : summary.min, "\\$avg-time" : summary.avg, "\\$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, "\\$recurse-depth" : summary.recurse, "\\$function-name" : fromUnicode(summary.fun, MSG_REPORT_CHARSET), diff --git a/extensions/venkman/resources/locale/en-US/profile.csv.tpl b/extensions/venkman/resources/locale/en-US/profile.csv.tpl index b21f081ff973..4c432bcc3265 100644 --- a/extensions/venkman/resources/locale/en-US/profile.csv.tpl +++ b/extensions/venkman/resources/locale/en-US/profile.csv.tpl @@ -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 -$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 diff --git a/extensions/venkman/resources/locale/en-US/profile.txt.tpl b/extensions/venkman/resources/locale/en-US/profile.txt.tpl index 3b9d1330fbb8..467bdf4c3f1b 100644 --- a/extensions/venkman/resources/locale/en-US/profile.txt.tpl +++ b/extensions/venkman/resources/locale/en-US/profile.txt.tpl @@ -16,6 +16,7 @@ $section-number <$full-url> Function Name: $function-name (Lines $start-line - $end-line) Total Calls: $call-count (max recurse $recurse-depth) 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 ------------------------------------------------------------------------------- diff --git a/extensions/venkman/resources/locale/en-US/profile.xml.tpl b/extensions/venkman/resources/locale/en-US/profile.xml.tpl index 8303db94fb59..5157f6038097 100644 --- a/extensions/venkman/resources/locale/en-US/profile.xml.tpl +++ b/extensions/venkman/resources/locale/en-US/profile.xml.tpl @@ -29,6 +29,9 @@ mintime="$min-time" maxtime="$max-time" totaltime="$total-time" + ownmintime="$own-min-time" + ownmaxtime="$own-max-time" + owntotaltime="$own-total-time" callcount="$call-count" function="$function-name" filename="$file-name" diff --git a/extensions/venkman/resources/locale/en-US/venkman.properties b/extensions/venkman/resources/locale/en-US/venkman.properties index 67c7a25f0fb3..1b8411bedb86 100644 --- a/extensions/venkman/resources/locale/en-US/venkman.properties +++ b/extensions/venkman/resources/locale/en-US/venkman.properties @@ -296,7 +296,8 @@ msn.fmt.frame.line = #%1$S: %2$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, # 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 msn.fmt.profile.recurse = " (max depth %1$S)