aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/Makefile.in
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2015-07-24 15:28:46 -0700
committerDoug Evans <dje@google.com>2015-07-24 15:28:46 -0700
commit35baa57fcfb50f7db24f7850ec9e34f4bc25b45c (patch)
tree39952a084573a578b8cacc79edf5b18b3cb98e0d /gdb/testsuite/Makefile.in
parent6ebea266fd0a7a56c90db3ab6237ff9f6c919747 (diff)
downloadgdb-35baa57fcfb50f7db24f7850ec9e34f4bc25b45c.zip
gdb-35baa57fcfb50f7db24f7850ec9e34f4bc25b45c.tar.gz
gdb-35baa57fcfb50f7db24f7850ec9e34f4bc25b45c.tar.bz2
Add parallel build support for perf tests.
gdb/testsuite/ChangeLog: * Makefile.in (check/%.exp): Pass directory for GDB_PARALLEL. (workers/%.worker, build-perf): New rule. (GDB_PERFTEST_MODE): New variable. (check-perf): Use it. (clean): Clean up gdb.perf parallel build subdirs. * lib/build-piece.exp: New file. * lib/cache.exp (gdb_do_cache): Include $GDB_PARALLEL in path name. * lib/gdb.exp (standard_output_file): Include $GDB_PARALLEL in path name. (standard_temp_file): Ditto. (GDB_PARALLEL handling): Make outputs,temp,cache directories as subdirs of $GDB_PARALLEL.
Diffstat (limited to 'gdb/testsuite/Makefile.in')
-rw-r--r--gdb/testsuite/Makefile.in37
1 files changed, 35 insertions, 2 deletions
diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
index c064f06..ffda7b9 100644
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -227,16 +227,48 @@ do-check-parallel: $(TEST_TARGETS)
@GMAKE_TRUE@check/%.exp:
@GMAKE_TRUE@ -mkdir -p outputs/$*
-@GMAKE_TRUE@ @$(DO_RUNTEST) GDB_PARALLEL=yes --outdir=outputs/$* $*.exp $(RUNTESTFLAGS)
+@GMAKE_TRUE@ @$(DO_RUNTEST) GDB_PARALLEL=. --outdir=outputs/$* $*.exp $(RUNTESTFLAGS)
check/no-matching-tests-found:
@echo ""
@echo "No matching tests found."
@echo ""
+# Utility rule invoked by step 2 of the build-perf rule.
+@GMAKE_TRUE@workers/%.worker:
+@GMAKE_TRUE@ mkdir -p gdb.perf/outputs/$*
+@GMAKE_TRUE@ $(DO_RUNTEST) --status --outdir=gdb.perf/outputs/$* lib/build-piece.exp WORKER=$* GDB_PARALLEL=gdb.perf $(RUNTESTFLAGS) GDB_PERFTEST_MODE=compile GDB_PERFTEST_SUBMODE=build-pieces
+
+# Utility rule to build tests that support it in parallel.
+# The build is broken into 3 steps distinguished by GDB_PERFTEST_SUBMODE:
+# gen-workers, build-pieces, final.
+#
+# GDB_PERFTEST_MODE appears *after* RUNTESTFLAGS here because we don't want
+# anything in RUNTESTFLAGS to override it.
+#
+# We don't delete the outputs directory here as these programs can take
+# awhile to build, and perftest.exp has support for deciding whether to
+# recompile them. If you want to remove these directories, make clean.
+#
+# The point of step 1 is to construct the set of worker tasks for step 2.
+# All of the information needed by build-piece.exp is contained in the name
+# of the generated .worker file.
+@GMAKE_TRUE@build-perf: $(abs_builddir)/site.exp
+@GMAKE_TRUE@ rm -rf gdb.perf/workers
+@GMAKE_TRUE@ mkdir -p gdb.perf/workers
+@GMAKE_TRUE@ @: Step 1: Generate the build .worker files.
+@GMAKE_TRUE@ $(DO_RUNTEST) --status --directory=gdb.perf --outdir gdb.perf/workers GDB_PARALLEL=gdb.perf $(RUNTESTFLAGS) GDB_PERFTEST_MODE=compile GDB_PERFTEST_SUBMODE=gen-workers
+@GMAKE_TRUE@ @: Step 2: Compile the pieces. Here is the build parallelism.
+@GMAKE_TRUE@ $(MAKE) $$(cd gdb.perf && echo workers/*/*.worker)
+@GMAKE_TRUE@ @: Step 3: Do the final link.
+@GMAKE_TRUE@ $(DO_RUNTEST) --status --directory=gdb.perf --outdir gdb.perf GDB_PARALLEL=gdb.perf $(RUNTESTFLAGS) GDB_PERFTEST_MODE=compile GDB_PERFTEST_SUBMODE=final
+
+# The default is to both compile and run the tests.
+GDB_PERFTEST_MODE = both
+
check-perf: all $(abs_builddir)/site.exp
@if test ! -d gdb.perf; then mkdir gdb.perf; fi
- $(DO_RUNTEST) --directory=gdb.perf --outdir gdb.perf GDB_PERFTEST_MODE=both $(RUNTESTFLAGS)
+ $(DO_RUNTEST) --directory=gdb.perf --outdir gdb.perf GDB_PERFTEST_MODE=$(GDB_PERFTEST_MODE) $(RUNTESTFLAGS)
force:;
@@ -245,6 +277,7 @@ clean mostlyclean:
-rm -f core.* *.tf *.cl tracecommandsscript copy1.txt zzz-gdbscript
-rm -f *.dwo *.dwp
-rm -rf outputs temp cache
+ -rm -rf gdb.perf/workers gdb.perf/outputs gdb.perf/temp gdb.perf/cache
-rm -f read1.so expect-read1
if [ x"${ALL_SUBDIRS}" != x ] ; then \
for dir in ${ALL_SUBDIRS}; \