[RFA] Add more parallelization to gdb.base testing

Doug Evans
2012-06-18T16:33:26Z

Hi.

This patch speeds up gdb testing at -j6 on my machine from 7mins to 4mins.
I didn't want to get too carried away here, this felt like a good compromise.
I split the range into four roughly equal partitions alphabet wise,
then noticed that [a-g] has far more files than the others so made the split
more refined. I'm happy to use whatever partitioning folks want, I just
want the 4mins (or better).

Ok to check in?

btw, it's possible to do better.
The ideal is (effectively) to be able to run all the .exp's at once.
But that's a more work and this is trivial with a reasonable win.

2012-06-15 Doug Evans <dje@google.com>

* Makefile.in (TEST_DIRS): Add gdb.base3, gdb.base4.
(BASE1_FILES, BASE2_FILES): Change to handle a-e and f-m respectively.
(BASE3_FILES, BASE4_FILES): New, handles n-s and t-z respectively.

diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
index fab124e..ca5ca55 100644
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -158,7 +158,7 @@ check-single: all $(abs_builddir)/site.exp
# A list of all directories named "gdb.*" which also hold a .exp file.
# We filter out gdb.base and add fake entries, because that directory
# takes the longest to process, and so we split it in half.
-TEST_DIRS = gdb.base1 gdb.base2 $(filter-out gdb.base,$(sort $(notdir $(patsubst %/,%,$(dir $(wildcard $(srcdir)/gdb.*/*.exp))))))
+TEST_DIRS = gdb.base1 gdb.base2 gdb.base3 gdb.base4 $(filter-out gdb.base,$(sort $(notdir $(patsubst %/,%,$(dir $(wildcard $(srcdir)/gdb.*/*.exp))))))

TEST_TARGETS = $(addprefix check-,$(TEST_DIRS))

@@ -179,11 +179,15 @@ check-parallel:
@GMAKE_TRUE@ @if test ! -d gdb.$*; then mkdir gdb.$*; fi
@GMAKE_TRUE@ $(DO_RUNTEST) --directory=gdb.$* --outdir=gdb.$* $(RUNTESTFLAGS)

-# Each half (roughly) of the .exp files from gdb.base.
-BASE1_FILES = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/gdb.base/[a-m]*.exp))
-BASE2_FILES = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/gdb.base/[n-z]*.exp))
+# A simple partitioning of the .exp files from gdb.base.
+# The partitioning here is a modest attempt at having four equal sized pieces,
+# without trying to be too clever.
+BASE1_FILES = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/gdb.base/[a-d]*.exp))
+BASE2_FILES = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/gdb.base/[e-k]*.exp))
+BASE3_FILES = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/gdb.base/[l-r]*.exp))
+BASE4_FILES = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/gdb.base/[s-z]*.exp))

-# Handle each half of gdb.base.
+# Handle each partition of gdb.base.
check-gdb.base%: all $(abs_builddir)/site.exp
@if test ! -d gdb.base$*; then mkdir gdb.base$*; fi
$(DO_RUNTEST) $(BASE$*_FILES) --outdir gdb.base$* $(RUNTESTFLAGS)