Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: tools/plot-timer-events

Issue 11348298: Take instrumentation overhead into account when plotting. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/log-utils.cc ('k') | tools/plot-timer-events.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/plot-timer-events
diff --git a/tools/plot-timer-events b/tools/plot-timer-events
index efa82bc5cda1bff133e1421f3a730165053d36bd..581e0ae333081dc421b976ca4b70d220f148980a 100755
--- a/tools/plot-timer-events
+++ b/tools/plot-timer-events
@@ -32,9 +32,40 @@ if [ ! -x "$d8_exec" ]; then
exit 1
fi
-# nm spits out 'no symbols found' messages to stderr.
-cat $log_file | $d8_exec $tools_path/csvparser.js \
+if [ -n "$DISTORTION" ]; then
+ distortion=$DISTORTION
+else
+ # Try to find out how much the instrumentation overhead is.
+ calibration_log=calibration.log
+ calibration_script="for (var i = 0; i < 1000000; i++) print();"
+
+ $d8_exec --nocrankshaft --prof --logfile $calibration_log \
+ --log-timer-events -e "$calibration_script" > /dev/null
+ t_1=`grep "V8.Execute" $calibration_log | tail -n1 | awk -F, '{print $4}'`
+ n_1=`grep "timer-event" $calibration_log | wc -l`
+
+ $d8_exec --nocrankshaft --prof --logfile $calibration_log \
+ --log-internal-timer-events -e "$calibration_script" > /dev/null
+ t_2=`grep "V8.Execute" $calibration_log | tail -n1 | awk -F, '{print $4}'`
+ n_2=`grep "timer-event" $calibration_log | wc -l`
+
+ rm $calibration_log
+
+ # Overhead in picoseconds.
+ distortion=`echo "1000*($t_1 - $t_2)/($n_1 - $n_2)" | bc`
+fi
+
+if [ -n "$PLOT_RANGE" ]; then
+ plot_range=$PLOT_RANGE
+else
+ plot_range=auto,auto
+fi
+
+echo "DISTORTION=$distortion"
+echo "PLOT_RANGE=$plot_range"
+
+echo -e "plot-range,$plot_range\ndistortion,$distortion" | cat - $log_file |
+ $d8_exec $tools_path/csvparser.js \
$tools_path/splaytree.js $tools_path/codemap.js \
$tools_path/logreader.js $tools_path/plot-timer-events.js \
2>/dev/null | gnuplot > timer-events.png
-
« no previous file with comments | « src/log-utils.cc ('k') | tools/plot-timer-events.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698