aboutsummaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2017-10-27 13:07:38 -0400
committerRuss Cox <rsc@golang.org>2017-10-31 13:20:12 +0000
commit6c8418f560f076da570b70ac645df7cdb01db188 (patch)
treef0d3fcfaa512c78711fbc760f0a186f0302da242 /src/make.bash
parent7dea509703eb5ad66a35628b12a678110fbb1f72 (diff)
downloadgo-6c8418f560f076da570b70ac645df7cdb01db188.tar.gz
go-6c8418f560f076da570b70ac645df7cdb01db188.zip
cmd/dist: log timing to $GOBUILDTIMELOGFILE
We can't make all.bash faster if we can't measure it. Measure it. Change-Id: Ia5da791d4cfbfa1fd9a8e905b3188f63819ade73 Reviewed-on: https://go-review.googlesource.com/73990 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/make.bash b/src/make.bash
index 4e1b7b6bd8..9827abd331 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -51,6 +51,10 @@
#
# GO_DISTFLAGS: extra flags to provide to "dist bootstrap".
# (Or just pass them to the make.bash command line.)
+#
+# GOBUILDTIMELOGFILE: If set, make.bash and all.bash write
+# timing information to this file. Useful for profiling where the
+# time goes when these scripts run.
set -e
@@ -61,6 +65,10 @@ if [ ! -f run.bash ]; then
exit 1
fi
+if [ "$GOBUILDTIMELOGFILE" != "" ]; then
+ echo $(date) start make.bash >"$GOBUILDTIMELOGFILE"
+fi
+
# Test for Windows.
case "$(uname)" in
*MINGW* | *WIN32* | *CYGWIN*)