public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Support 'make check-parallel' in gdb's build dir
@ 2016-02-11 16:18 Pedro Alves
  2016-02-11 16:44 ` Simon Marchi
  0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2016-02-11 16:18 UTC (permalink / raw)
  To: gdb-patches

Currently, you can cd to the gdb/testsuite/ dir and use
make check-parallel, instead of using FORCE_PARALLEL:

 $ make -j8 check-parallel RUNTESTFLAGS="--target_board=native-gdbserver"
 $ make -j8 check RUNTESTFLAGS="--target_board=native-gdbserver" FORCE_PARALLEL=1

But you can't do that in the build/gdb/ dir:

 $ make check-parallel RUNTESTFLAGS="--target_board=native-gdbserver"
 make: *** No rule to make target `check-parallel'.  Stop.

I find check-parallel a bit more convenient, and more typo-proof, so
this patch makes it work from the gdb build dir too.

While documenting this in testsuite/README, I found that the parallel
testing mode would better be pulled out to its own section and
extended.

gdb/ChangeLog:
2016-02-11  Pedro Alves  <palves@redhat.com>

	* Makefile.in (check-parallel): New rule.

gdb/testsuite/ChangeLog:
2016-02-11  Pedro Alves  <palves@redhat.com>

	* README (Parallel testing): New section.
	(GDB_PARALLEL): Rewrite.
	(FORCE_PARALLEL): Document.
---
 gdb/Makefile.in      |  8 ++++++++
 gdb/testsuite/README | 50 +++++++++++++++++++++++++++++++++++++-------------
 2 files changed, 45 insertions(+), 13 deletions(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index ec2af52..602ef43 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1158,6 +1158,14 @@ check-read1: force
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS) check-read1; \
 	else true; fi
 
+check-parallel: force
+	@if [ -f testsuite/Makefile ]; then \
+	  rootme=`pwd`; export rootme; \
+	  rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
+	  cd testsuite; \
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS) check-parallel; \
+	else true; fi
+
 # The idea is to parallelize testing of multilibs, for example:
 #   make -j3 check//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
 # will run 3 concurrent sessions of check, eventually testing all 10
diff --git a/gdb/testsuite/README b/gdb/testsuite/README
index 77ac74e..1903e9e 100644
--- a/gdb/testsuite/README
+++ b/gdb/testsuite/README
@@ -25,6 +25,31 @@ The second is to cd to the testsuite directory and invoke the DejaGnu
 (The `site.exp' file contains a handful of useful variables like host
 and target triplets, and pathnames.)
 
+Parallel testing
+****************
+
+When testing natively (that is, not with a remote host), you can run
+the GDB test suite in a fully parallel mode.  In this mode, each .exp
+file runs separately and maybe simultaneously.  The test suite ensures
+that all the temporary files created by the test suite do not clash,
+by putting them into separate directories.  This mode is primarily
+intended for use by the Makefile.
+
+For GNU make, the Makefile tries to run the tests in parallel mode if
+any -j option is given.  For a non-GNU make, tests are not
+parallelized.
+
+If RUNTESTFLAGS is not empty, then by default the tests are
+serialized.  This can be overridden by either using the
+`check-parallel' target in the Makefile, or by setting FORCE_PARALLEL
+to any non-empty value:
+
+	make check-parallel RUNTESTFLAGS="--target_board=native-gdbserver
+	make check RUNTESTFLAGS="--target_board=native-gdbserver FORCE_PARALLEL=1
+
+If you want to use runtest directly instead of using the Makefile, see
+the description of GDB_PARALLEL below.
+
 Running the Performance Tests
 *****************************
 
@@ -125,19 +150,18 @@ a .gdbinit.  For example:
 
 GDB_PARALLEL
 
-When testing natively (that is, not with a remote host), you can run
-the GDB test suite in a fully parallel mode.  In this mode, each .exp
-file runs separately and maybe simultaneously.  The test suite will
-ensure that all the temporary files created by the test suite do not
-clash, by putting them into separate directories.  This mode is
-primarily intended for use by the Makefile.
-
-To use this mode, set the GDB_PARALLEL on the runtest command line.
-Before starting the tests, you must ensure that the directories cache,
-outputs, and temp in the test suite build directory are either empty
-or have been deleted.  cache in particular is used to share data
-across invocations of runtest, and files there may affect the test
-results.  Note that the Makefile automatically does these deletions.
+To use parallel testing mode without using the the Makefile, set
+GDB_PARALLEL on the runtest command line to "yes".  Before starting
+the tests, you must ensure that the directories cache, outputs, and
+temp in the test suite build directory are either empty or have been
+deleted.  cache in particular is used to share data across invocations
+of runtest, and files there may affect the test results.  The Makefile
+automatically does these deletions.
+
+FORCE_PARALLEL
+
+Setting FORCE_PARALLEL to any non-empty value forces parallel testing
+mode even if RUNTESTFLAGS is not empty.
 
 GDB_INOTIFY
 
-- 
1.9.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Support 'make check-parallel' in gdb's build dir
  2016-02-11 16:18 [PATCH] Support 'make check-parallel' in gdb's build dir Pedro Alves
@ 2016-02-11 16:44 ` Simon Marchi
  2016-02-11 17:07   ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Marchi @ 2016-02-11 16:44 UTC (permalink / raw)
  To: Pedro Alves, gdb-patches

On 16-02-11 11:18 AM, Pedro Alves wrote:
> +check-parallel: force
> +	@if [ -f testsuite/Makefile ]; then \
> +	  rootme=`pwd`; export rootme; \
> +	  rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
> +	  cd testsuite; \
> +	  $(MAKE) $(TARGET_FLAGS_TO_PASS) check-parallel; \
> +	else true; fi
> +

Thanks for making it a little bit more convenient.  I also use the check-parallel
target, it feels more natural than setting FORCE_PARALLEL.

> +Parallel testing
> +****************
> +
> +When testing natively (that is, not with a remote host), you can run

I know you just moved that text, but would you know by any chance what is
meant by "remote host" here?  Is it host in the Autoconf/Dejagnu,
terminology?

For example, if I'm building on Linux a GDB that will run on Windows to
debug some bare-metal ARM, we are in presence of a remote host which is
Windows?

I understand why you couldn't run parallel tests against a single, bare-metal
target, but I don't understand why having a remote host would limit that
(assuming you can connect multiple times simultaneously to that remote host).

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Support 'make check-parallel' in gdb's build dir
  2016-02-11 16:44 ` Simon Marchi
@ 2016-02-11 17:07   ` Pedro Alves
  2016-02-11 19:33     ` Simon Marchi
  0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2016-02-11 17:07 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 02/11/2016 04:44 PM, Simon Marchi wrote:
> On 16-02-11 11:18 AM, Pedro Alves wrote:
>> +check-parallel: force
>> +	@if [ -f testsuite/Makefile ]; then \
>> +	  rootme=`pwd`; export rootme; \
>> +	  rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
>> +	  cd testsuite; \
>> +	  $(MAKE) $(TARGET_FLAGS_TO_PASS) check-parallel; \
>> +	else true; fi
>> +
> 
> Thanks for making it a little bit more convenient.  I also use the check-parallel
> target, it feels more natural than setting FORCE_PARALLEL.
> 
>> +Parallel testing
>> +****************
>> +
>> +When testing natively (that is, not with a remote host), you can run
> 
> I know you just moved that text, but would you know by any chance what is
> meant by "remote host" here?  Is it host in the Autoconf/Dejagnu,
> terminology?

Host in the Dejagnu terminology, as in [is_remote host].

> 
> For example, if I'm building on Linux a GDB that will run on Windows to
> debug some bare-metal ARM, we are in presence of a remote host which is
> Windows?

Right.

> 
> I understand why you couldn't run parallel tests against a single, bare-metal
> target, but I don't understand why having a remote host would limit that
> (assuming you can connect multiple times simultaneously to that remote host).

I think that it's because with remote host testing, unless you assume
the build and host machines share the same file system, sources/binaries
of all tests end up downloaded to/produced in the same remote host dir, and
then thus tests clash if run in parallel.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Support 'make check-parallel' in gdb's build dir
  2016-02-11 17:07   ` Pedro Alves
@ 2016-02-11 19:33     ` Simon Marchi
  2016-02-11 19:54       ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Marchi @ 2016-02-11 19:33 UTC (permalink / raw)
  To: Pedro Alves, gdb-patches

On 16-02-11 12:07 PM, Pedro Alves wrote:
>> I understand why you couldn't run parallel tests against a single, bare-metal
>> target, but I don't understand why having a remote host would limit that
>> (assuming you can connect multiple times simultaneously to that remote host).
> 
> I think that it's because with remote host testing, unless you assume
> the build and host machines share the same file system, sources/binaries
> of all tests end up downloaded to/produced in the same remote host dir, and
> then thus tests clash if run in parallel.

Ahh it makes sense, the same thing happens with a remote target (the same procedures
in Dejagnu are used to upload the files).  So there could also be some clash when
testing with a remote target, if there are two tests with the same name, or tests that
use the same external files/libraries.  That's why I found that odd, why a remote host
in particular is dangerous, and not a remote target.

Otherwise, the README LGTM.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Support 'make check-parallel' in gdb's build dir
  2016-02-11 19:33     ` Simon Marchi
@ 2016-02-11 19:54       ` Pedro Alves
  2016-02-11 19:58         ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Pedro Alves @ 2016-02-11 19:54 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 02/11/2016 07:33 PM, Simon Marchi wrote:
> On 16-02-11 12:07 PM, Pedro Alves wrote:
>>> I understand why you couldn't run parallel tests against a single, bare-metal
>>> target, but I don't understand why having a remote host would limit that
>>> (assuming you can connect multiple times simultaneously to that remote host).
>>
>> I think that it's because with remote host testing, unless you assume
>> the build and host machines share the same file system, sources/binaries
>> of all tests end up downloaded to/produced in the same remote host dir, and
>> then thus tests clash if run in parallel.
> 
> Ahh it makes sense, the same thing happens with a remote target (the same procedures
> in Dejagnu are used to upload the files).  So there could also be some clash when
> testing with a remote target, if there are two tests with the same name, or tests that
> use the same external files/libraries.  That's why I found that odd, why a remote host
> in particular is dangerous, and not a remote target.
> 
> Otherwise, the README LGTM.

Alright, I tweaked that sentence to say instead:

 If not testing with a remote host (in DejaGnu's sense), you can run
 the GDB test suite in a fully parallel mode.  In this mode, each .exp
 ...

... and pushed it in.

From e352bf0a3c8430aeab9d6f3781c7b31b09c8b8b9 Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Thu, 11 Feb 2016 19:36:39 +0000
Subject: [PATCH] Support 'make check-parallel' in gdb's build dir

Currently, you can cd to the gdb/testsuite/ dir and use
make check-parallel, instead of using FORCE_PARALLEL:

 $ make -j8 check-parallel RUNTESTFLAGS="--target_board=native-gdbserver"
 $ make -j8 check RUNTESTFLAGS="--target_board=native-gdbserver" FORCE_PARALLEL=1

But you can't do that in the build/gdb/ dir:

 $ make check-parallel RUNTESTFLAGS="--target_board=native-gdbserver"
 make: *** No rule to make target `check-parallel'.  Stop.

I find check-parallel a bit more convenient, and more typo-proof, so
this patch makes it work from the gdb build dir too.

While documenting this in testsuite/README, I found that the parallel
testing mode would better be pulled out to its own section and
extended.

gdb/ChangeLog:
2016-02-11  Pedro Alves  <palves@redhat.com>

	* Makefile.in (check-parallel): New rule.

gdb/testsuite/ChangeLog:
2016-02-11  Pedro Alves  <palves@redhat.com>

	* README (Parallel testing): New section.
	(GDB_PARALLEL): Rewrite.
	(FORCE_PARALLEL): Document.
---
 gdb/ChangeLog           |  4 ++++
 gdb/testsuite/ChangeLog |  6 ++++++
 gdb/Makefile.in         |  8 ++++++++
 gdb/testsuite/README    | 50 ++++++++++++++++++++++++++++++++++++-------------
 4 files changed, 55 insertions(+), 13 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c506952..5edafdf 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2016-02-11  Pedro Alves  <palves@redhat.com>
+
+	* Makefile.in (check-parallel): New rule.
+
 2016-02-11  Simon Marchi  <simon.marchi@ericsson.com>

 	* arm-tdep.c (arm_skip_prologue): Remove unused variables.
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b35cfcb..1c18935 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2016-02-11  Pedro Alves  <palves@redhat.com>
+
+	* README (Parallel testing): New section.
+	(GDB_PARALLEL): Rewrite.
+	(FORCE_PARALLEL): Document.
+
 2016-02-11  Marcin Kościelnicki  <koriakin@0x04.net>

 	* gdb.trace/tfile-avx.c: New test.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index ec2af52..602ef43 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1158,6 +1158,14 @@ check-read1: force
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS) check-read1; \
 	else true; fi

+check-parallel: force
+	@if [ -f testsuite/Makefile ]; then \
+	  rootme=`pwd`; export rootme; \
+	  rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
+	  cd testsuite; \
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS) check-parallel; \
+	else true; fi
+
 # The idea is to parallelize testing of multilibs, for example:
 #   make -j3 check//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
 # will run 3 concurrent sessions of check, eventually testing all 10
diff --git a/gdb/testsuite/README b/gdb/testsuite/README
index 77ac74e..d58a452 100644
--- a/gdb/testsuite/README
+++ b/gdb/testsuite/README
@@ -25,6 +25,31 @@ The second is to cd to the testsuite directory and invoke the DejaGnu
 (The `site.exp' file contains a handful of useful variables like host
 and target triplets, and pathnames.)

+Parallel testing
+****************
+
+If not testing with a remote host (in DejaGnu's sense), you can run
+the GDB test suite in a fully parallel mode.  In this mode, each .exp
+file runs separately and maybe simultaneously.  The test suite ensures
+that all the temporary files created by the test suite do not clash,
+by putting them into separate directories.  This mode is primarily
+intended for use by the Makefile.
+
+For GNU make, the Makefile tries to run the tests in parallel mode if
+any -j option is given.  For a non-GNU make, tests are not
+parallelized.
+
+If RUNTESTFLAGS is not empty, then by default the tests are
+serialized.  This can be overridden by either using the
+`check-parallel' target in the Makefile, or by setting FORCE_PARALLEL
+to any non-empty value:
+
+	make check-parallel RUNTESTFLAGS="--target_board=native-gdbserver
+	make check RUNTESTFLAGS="--target_board=native-gdbserver FORCE_PARALLEL=1
+
+If you want to use runtest directly instead of using the Makefile, see
+the description of GDB_PARALLEL below.
+
 Running the Performance Tests
 *****************************

@@ -125,19 +150,18 @@ a .gdbinit.  For example:

 GDB_PARALLEL

-When testing natively (that is, not with a remote host), you can run
-the GDB test suite in a fully parallel mode.  In this mode, each .exp
-file runs separately and maybe simultaneously.  The test suite will
-ensure that all the temporary files created by the test suite do not
-clash, by putting them into separate directories.  This mode is
-primarily intended for use by the Makefile.
-
-To use this mode, set the GDB_PARALLEL on the runtest command line.
-Before starting the tests, you must ensure that the directories cache,
-outputs, and temp in the test suite build directory are either empty
-or have been deleted.  cache in particular is used to share data
-across invocations of runtest, and files there may affect the test
-results.  Note that the Makefile automatically does these deletions.
+To use parallel testing mode without using the the Makefile, set
+GDB_PARALLEL on the runtest command line to "yes".  Before starting
+the tests, you must ensure that the directories cache, outputs, and
+temp in the test suite build directory are either empty or have been
+deleted.  cache in particular is used to share data across invocations
+of runtest, and files there may affect the test results.  The Makefile
+automatically does these deletions.
+
+FORCE_PARALLEL
+
+Setting FORCE_PARALLEL to any non-empty value forces parallel testing
+mode even if RUNTESTFLAGS is not empty.

 GDB_INOTIFY

-- 
1.9.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Support 'make check-parallel' in gdb's build dir
  2016-02-11 19:54       ` Pedro Alves
@ 2016-02-11 19:58         ` Pedro Alves
  0 siblings, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2016-02-11 19:58 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 02/11/2016 07:53 PM, Pedro Alves wrote:

> ... and pushed it in.

And then this obvious follow up as well ...

From acc23c113ab9602707574e7df120f96170a9731c Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Thu, 11 Feb 2016 19:55:46 +0000
Subject: [PATCH] Add missing quotes to gdb/testsuite/README

gdb/testsuite/ChangeLog:
2016-02-11  Pedro Alves  <palves@redhat.com>

	* README (Parallel testing): Add missing double quotes.
---
 gdb/testsuite/ChangeLog | 4 ++++
 gdb/testsuite/README    | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 1c18935..0d61440 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
 2016-02-11  Pedro Alves  <palves@redhat.com>

+	* README (Parallel testing): Add missing double quotes.
+
+2016-02-11  Pedro Alves  <palves@redhat.com>
+
 	* README (Parallel testing): New section.
 	(GDB_PARALLEL): Rewrite.
 	(FORCE_PARALLEL): Document.
diff --git a/gdb/testsuite/README b/gdb/testsuite/README
index d58a452..6b59027 100644
--- a/gdb/testsuite/README
+++ b/gdb/testsuite/README
@@ -44,8 +44,8 @@ serialized.  This can be overridden by either using the
 `check-parallel' target in the Makefile, or by setting FORCE_PARALLEL
 to any non-empty value:

-	make check-parallel RUNTESTFLAGS="--target_board=native-gdbserver
-	make check RUNTESTFLAGS="--target_board=native-gdbserver FORCE_PARALLEL=1
+	make check-parallel RUNTESTFLAGS="--target_board=native-gdbserver"
+	make check RUNTESTFLAGS="--target_board=native-gdbserver" FORCE_PARALLEL=1

 If you want to use runtest directly instead of using the Makefile, see
 the description of GDB_PARALLEL below.
-- 
1.9.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-11 19:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-11 16:18 [PATCH] Support 'make check-parallel' in gdb's build dir Pedro Alves
2016-02-11 16:44 ` Simon Marchi
2016-02-11 17:07   ` Pedro Alves
2016-02-11 19:33     ` Simon Marchi
2016-02-11 19:54       ` Pedro Alves
2016-02-11 19:58         ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).