public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] GDB/testsuite: Correct gdb.base/watchpoint-solib.exp timeout tweak
@ 2014-07-29 12:18 Maciej W. Rozycki
  2014-07-29 12:59 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej W. Rozycki @ 2014-07-29 12:18 UTC (permalink / raw)
  To: gdb-patches

Hi,

 Similarly to the changes to gdb.reverse/sigall-reverse.exp and 
gdb.reverse/until-precsave.exp recently posted this corrects the timeout 
tweak in gdb.base/watchpoint-solib.exp.

 This test case executes a large amount of code with a software watchpoint 
enabled.  This means single-stepping all the way through and takes a lot 
of time, e.g. for an ARMv7 Panda board and a `-march=armv5te' multilib:

PASS: gdb.base/watchpoint-solib.exp: continue to foo again
elapsed: 714

for the same board and a `-mthumb -march=armv5te' multilib:

PASS: gdb.base/watchpoint-solib.exp: continue to foo again
elapsed: 1275

and for QEMU in the system emulation mode and a `-march=armv4t'
multilib:

PASS: gdb.base/watchpoint-solib.exp: continue to foo again
elapsed: 115

(values in seconds) -- all of which having the default timeout of 60s, set 
based on the requirement of the remaining test cases (other than 
gdb.reverse ones).

 Here again the timeout extension to have a meaning should be calculated 
by scaling rather than using an arbitrary constant, and a larger factor of 
30 will do, leaving some margin.  Hopefully for everyone or otherwise 
we'll probably have to come up with a smarter solution.

 OTOH the other test cases in this script do not require the extension so 
they can be moved outside its umbrella so as to avoid unnecessary delays 
if something goes wrong and a genuine timeout triggers.

 Tested on arm-linux-gnueabi.  OK to apply?

2014-07-29  Maciej W. Rozycki  <macro@codesourcery.com>

	gdb/testsuite/
	* gdb.base/watchpoint-solib.exp: Increase the timeout by a factor
	of 30 rather than hardcoding 120 for a slow test case.  Take the 
	`gdb,timeout' target setting into account for this calculation.
	Don't extend the timeout for the test cases that don't need it.

  Maciej

gdb-test-watchpoint-solib-timeout.diff
Index: gdb-fsf-trunk-quilt/gdb/testsuite/gdb.base/watchpoint-solib.exp
===================================================================
--- gdb-fsf-trunk-quilt.orig/gdb/testsuite/gdb.base/watchpoint-solib.exp	2014-07-12 14:22:22.848926536 +0100
+++ gdb-fsf-trunk-quilt/gdb/testsuite/gdb.base/watchpoint-solib.exp	2014-07-28 20:36:12.078936693 +0100
@@ -70,14 +70,22 @@ gdb_test_multiple "break foo" "set pendi
      }
 }
 
-set prev_timeout $timeout
-set timeout 120
-
 gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo"
 gdb_test "watch g" "atchpoint 3: g" "set watchpoint on g"
 gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit"
 rerun_to_main
+
+set savedtimeout $timeout
+if { [target_info exists gdb,timeout]
+     && $timeout < [target_info gdb,timeout] } {
+    set oldtimeout [target_info gdb,timeout]
+} else {
+    set oldtimeout $timeout
+}
+set timeout [expr $oldtimeout * 30]
+
 gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo again"
-gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit again"
 
-set timeout $prev_timeout
+set timeout $savedtimeout
+
+gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit again"

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

* Re: [PATCH] GDB/testsuite: Correct gdb.base/watchpoint-solib.exp timeout tweak
  2014-07-29 12:18 [PATCH] GDB/testsuite: Correct gdb.base/watchpoint-solib.exp timeout tweak Maciej W. Rozycki
@ 2014-07-29 12:59 ` Pedro Alves
  2014-09-09 16:47   ` Maciej W. Rozycki
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2014-07-29 12:59 UTC (permalink / raw)
  To: Maciej W. Rozycki, gdb-patches

On 07/29/2014 01:10 PM, Maciej W. Rozycki wrote:
> Hi,
> 
>  Similarly to the changes to gdb.reverse/sigall-reverse.exp and 
> gdb.reverse/until-precsave.exp recently posted this corrects the timeout 
> tweak in gdb.base/watchpoint-solib.exp.
> 
>  This test case executes a large amount of code with a software watchpoint 
> enabled.  This means single-stepping all the way through and takes a lot 
> of time, e.g. for an ARMv7 Panda board and a `-march=armv5te' multilib:
> 
> PASS: gdb.base/watchpoint-solib.exp: continue to foo again
> elapsed: 714
> 
> for the same board and a `-mthumb -march=armv5te' multilib:
> 
> PASS: gdb.base/watchpoint-solib.exp: continue to foo again
> elapsed: 1275
> 
> and for QEMU in the system emulation mode and a `-march=armv4t'
> multilib:
> 
> PASS: gdb.base/watchpoint-solib.exp: continue to foo again
> elapsed: 115
> 
> (values in seconds) -- all of which having the default timeout of 60s, set 
> based on the requirement of the remaining test cases (other than 
> gdb.reverse ones).
> 
>  Here again the timeout extension to have a meaning should be calculated 
> by scaling rather than using an arbitrary constant, and a larger factor of 
> 30 will do, leaving some margin.  Hopefully for everyone or otherwise 
> we'll probably have to come up with a smarter solution.
> 
>  OTOH the other test cases in this script do not require the extension so 
> they can be moved outside its umbrella so as to avoid unnecessary delays 
> if something goes wrong and a genuine timeout triggers.
> 
>  Tested on arm-linux-gnueabi.  OK to apply?

OK

> +
> +set savedtimeout $timeout
> +if { [target_info exists gdb,timeout]
> +     && $timeout < [target_info gdb,timeout] } {
> +    set oldtimeout [target_info gdb,timeout]
> +} else {
> +    set oldtimeout $timeout
> +}
> +set timeout [expr $oldtimeout * 30]

Clearly this pattern is going to be popping in more
places going forward.  Maybe we should even consider factoring
it out to a with_test_prefix-like procedure.  Something like:

 proc with_timeout_factor { factor } {
   ...
 }

 with_timeout_factor 30 {
    ...
    gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo again"
    ...
 }

Thanks,
Pedro Alves

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

* Re: [PATCH] GDB/testsuite: Correct gdb.base/watchpoint-solib.exp timeout tweak
  2014-07-29 12:59 ` Pedro Alves
@ 2014-09-09 16:47   ` Maciej W. Rozycki
  0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2014-09-09 16:47 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Tue, 29 Jul 2014, Pedro Alves wrote:

> >  Tested on arm-linux-gnueabi.  OK to apply?
> 
> OK

 Applied now, thanks.

> > +
> > +set savedtimeout $timeout
> > +if { [target_info exists gdb,timeout]
> > +     && $timeout < [target_info gdb,timeout] } {
> > +    set oldtimeout [target_info gdb,timeout]
> > +} else {
> > +    set oldtimeout $timeout
> > +}
> > +set timeout [expr $oldtimeout * 30]
> 
> Clearly this pattern is going to be popping in more
> places going forward.  Maybe we should even consider factoring
> it out to a with_test_prefix-like procedure.  Something like:
> 
>  proc with_timeout_factor { factor } {
>    ...
>  }
> 
>  with_timeout_factor 30 {
>     ...
>     gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo again"
>     ...
>  }

 Just as with the gdb.reverse change, I agree this is a good idea and I'll 
keep it in my mind as a future improvement (honestly I'd rather use my 
next available slot for GDB development though to get the outstanding 
microMIPS and MIPS FP stuff dusted off and resubmitted, so this stuff will 
only be for the second next slot or suchlike ;) ).

  Maciej

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

end of thread, other threads:[~2014-09-09 16:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-29 12:18 [PATCH] GDB/testsuite: Correct gdb.base/watchpoint-solib.exp timeout tweak Maciej W. Rozycki
2014-07-29 12:59 ` Pedro Alves
2014-09-09 16:47   ` Maciej W. Rozycki

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).