Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Don't need fast tracepoint in tstatus.exp
@ 2013-03-04 15:47 Yao Qi
  2013-03-04 16:47 ` Pedro Alves
  2013-03-06  0:11 ` Stan Shebs
  0 siblings, 2 replies; 5+ messages in thread
From: Yao Qi @ 2013-03-04 15:47 UTC (permalink / raw)
  To: gdb-patches

tstatus.exp is used to test the output of 'tstatus' but there are some
tests on fast tracepoint in it, which is not related to tstatus.  This
patch is to remove these fast tracepoint related stuff from tstatus.exp.

gdb/testsuite:

2013-03-04  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/tstatus.exp: Use prepare_for_testing.
	(test_tracepoints): Don't set fast tracepoint.
	(top level): Don't check agent library is loaded or not.
---
 gdb/testsuite/gdb.trace/tstatus.exp |   41 +++-------------------------------
 1 files changed, 4 insertions(+), 37 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/tstatus.exp b/gdb/testsuite/gdb.trace/tstatus.exp
index 8a0bbdf..483bb20 100644
--- a/gdb/testsuite/gdb.trace/tstatus.exp
+++ b/gdb/testsuite/gdb.trace/tstatus.exp
@@ -34,22 +34,14 @@ if ![gdb_target_supports_trace] {
     return -1
 }
 
-set libipa [get_in_proc_agent]
-gdb_load_shlibs $libipa
-
-# Can't use prepare_for_testing, because that splits compiling into
-# building objects and then linking, and we'd fail with "linker input
-# file unused because linking not done" when building the object.
-
-if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
-	  executable [list debug shlib=$libipa] ] != "" } {
-    untested "failed to compile ftrace tests"
+if [prepare_for_testing $expfile $executable $srcfile \
+	{debug nowarnings} ] {
+    untested "failed to compile tracepoint tests"
     return -1
 }
-clean_restart ${executable}
 
 if ![runto_main] {
-    fail "Can't run to main for ftrace tests"
+    fail "Can't run to main for tracepoint tests"
     return 0
 }
 
@@ -141,34 +133,9 @@ proc test_tracepoints {} {
     gdb_trace_setactions "collect at set_point: define actions" \
 	"" \
 	"collect parm" "^$"
-    set fastgood 0
-
-    gdb_test_multiple "ftrace gdb_recursion_test" "set fast tracepoint" {
-	-re "May not have a fast tracepoint at .*\r\n$gdb_prompt $" {
-	    pass "4-byte fast tracepoint could not be set"
-	}
-	-re "Fast tracepoint .*\r\n$gdb_prompt $" {
-	    pass "4-byte fast tracepoint is set"
-	    set fastgood 1
-	}
-    }
-
-    if { $fastgood } {
-
-	gdb_trace_setactions "collect at four_byter: define actions" \
-	    "" \
-	    "collect globvar, anarg" "^$"
-    }
 
     run_trace_experiment
 
 }
 
-gdb_reinitialize_dir $srcdir/$subdir
-
-if { [gdb_test "info sharedlibrary" ".*${libipa}.*" "IPA loaded"] != 0 } {
-    untested "Could not find IPA lib loaded"
-    return 1
-}
-
 test_tracepoints
-- 
1.7.7.6


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

* Re: [PATCH] Don't need fast tracepoint in tstatus.exp
  2013-03-04 15:47 [PATCH] Don't need fast tracepoint in tstatus.exp Yao Qi
@ 2013-03-04 16:47 ` Pedro Alves
  2013-03-05  4:52   ` Yao Qi
  2013-03-06  0:11 ` Stan Shebs
  1 sibling, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2013-03-04 16:47 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On 03/04/2013 03:46 PM, Yao Qi wrote:
> tstatus.exp is used to test the output of 'tstatus' but there are some
> tests on fast tracepoint in it, which is not related to tstatus.  This
> patch is to remove these fast tracepoint related stuff from tstatus.exp.

Can we assume

> 
> gdb/testsuite:
> 
> 2013-03-04  Yao Qi  <yao@codesourcery.com>
> 
> 	* gdb.trace/tstatus.exp: Use prepare_for_testing.
> 	(test_tracepoints): Don't set fast tracepoint.
> 	(top level): Don't check agent library is loaded or not.
> ---
>  gdb/testsuite/gdb.trace/tstatus.exp |   41 +++-------------------------------
>  1 files changed, 4 insertions(+), 37 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.trace/tstatus.exp b/gdb/testsuite/gdb.trace/tstatus.exp
> index 8a0bbdf..483bb20 100644
> --- a/gdb/testsuite/gdb.trace/tstatus.exp
> +++ b/gdb/testsuite/gdb.trace/tstatus.exp
> @@ -34,22 +34,14 @@ if ![gdb_target_supports_trace] {
>      return -1
>  }
>  
> -set libipa [get_in_proc_agent]
> -gdb_load_shlibs $libipa
> -
> -# Can't use prepare_for_testing, because that splits compiling into
> -# building objects and then linking, and we'd fail with "linker input
> -# file unused because linking not done" when building the object.
> -
> -if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
> -	  executable [list debug shlib=$libipa] ] != "" } {
> -    untested "failed to compile ftrace tests"
> +if [prepare_for_testing $expfile $executable $srcfile \
> +	{debug nowarnings} ] {
> +    untested "failed to compile tracepoint tests"
>      return -1
>  }
> -clean_restart ${executable}
>  
>  if ![runto_main] {
> -    fail "Can't run to main for ftrace tests"
> +    fail "Can't run to main for tracepoint tests"
>      return 0
>  }

If we aren't doing any fast tracepoint tests, then is
there a reason to keep this prepare_for_testing and
runto_main instead of removing them altogether?

-- 
Pedro Alves


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

* Re: [PATCH] Don't need fast tracepoint in tstatus.exp
  2013-03-04 16:47 ` Pedro Alves
@ 2013-03-05  4:52   ` Yao Qi
  2013-03-05 13:08     ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Yao Qi @ 2013-03-05  4:52 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On 03/05/2013 12:46 AM, Pedro Alves wrote:
>> tstatus.exp is used to test the output of 'tstatus' but there are some
>> >tests on fast tracepoint in it, which is not related to tstatus.  This
>> >patch is to remove these fast tracepoint related stuff from tstatus.exp.
> Can we assume
> 

The reason why fast tracepoint stuff was added into tstatus.exp is
unclear to me.  It was not mentioned in the mail posting this patch.
  However, I can't see how fast tracepoint affects the output of 
'tstatus', so I propose this patch to remove them.

> If we aren't doing any fast tracepoint tests, then is
> there a reason to keep this prepare_for_testing and
> runto_main instead of removing them altogether?

OK, the prepare_for_testing and runto_main are removed.

-- 
Yao (齐尧)

gdb/testsuite:

2013-03-05  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/tstatus.exp: Remove the invocation to
	gdb_load_shlibs, gdb_compile, clean_restart and runto_main.
	(test_tracepoints): Don't set fast tracepoint.
	(top level): Don't check agent library is loaded or not.
---
 gdb/testsuite/gdb.trace/tstatus.exp |   44 -----------------------------------
 1 files changed, 0 insertions(+), 44 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/tstatus.exp b/gdb/testsuite/gdb.trace/tstatus.exp
index 8a0bbdf..3be3b86 100644
--- a/gdb/testsuite/gdb.trace/tstatus.exp
+++ b/gdb/testsuite/gdb.trace/tstatus.exp
@@ -34,25 +34,6 @@ if ![gdb_target_supports_trace] {
     return -1
 }
 
-set libipa [get_in_proc_agent]
-gdb_load_shlibs $libipa
-
-# Can't use prepare_for_testing, because that splits compiling into
-# building objects and then linking, and we'd fail with "linker input
-# file unused because linking not done" when building the object.
-
-if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
-	  executable [list debug shlib=$libipa] ] != "" } {
-    untested "failed to compile ftrace tests"
-    return -1
-}
-clean_restart ${executable}
-
-if ![runto_main] {
-    fail "Can't run to main for ftrace tests"
-    return 0
-}
-
 proc run_trace_experiment {} {
     global gdb_prompt
     global decimal
@@ -141,34 +122,9 @@ proc test_tracepoints {} {
     gdb_trace_setactions "collect at set_point: define actions" \
 	"" \
 	"collect parm" "^$"
-    set fastgood 0
-
-    gdb_test_multiple "ftrace gdb_recursion_test" "set fast tracepoint" {
-	-re "May not have a fast tracepoint at .*\r\n$gdb_prompt $" {
-	    pass "4-byte fast tracepoint could not be set"
-	}
-	-re "Fast tracepoint .*\r\n$gdb_prompt $" {
-	    pass "4-byte fast tracepoint is set"
-	    set fastgood 1
-	}
-    }
-
-    if { $fastgood } {
-
-	gdb_trace_setactions "collect at four_byter: define actions" \
-	    "" \
-	    "collect globvar, anarg" "^$"
-    }
 
     run_trace_experiment
 
 }
 
-gdb_reinitialize_dir $srcdir/$subdir
-
-if { [gdb_test "info sharedlibrary" ".*${libipa}.*" "IPA loaded"] != 0 } {
-    untested "Could not find IPA lib loaded"
-    return 1
-}
-
 test_tracepoints
-- 
1.7.7.6


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

* Re: [PATCH] Don't need fast tracepoint in tstatus.exp
  2013-03-05  4:52   ` Yao Qi
@ 2013-03-05 13:08     ` Pedro Alves
  0 siblings, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2013-03-05 13:08 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On 03/05/2013 04:51 AM, Yao Qi wrote:
> On 03/05/2013 12:46 AM, Pedro Alves wrote:
>>> tstatus.exp is used to test the output of 'tstatus' but there are some
>>>> tests on fast tracepoint in it, which is not related to tstatus.  This
>>>> patch is to remove these fast tracepoint related stuff from tstatus.exp.
>> Can we assume
>>
> 

I actually meant to delete that, sorry.

> The reason why fast tracepoint stuff was added into tstatus.exp is
> unclear to me.  It was not mentioned in the mail posting this patch.

Did you ask Stan?

>   However, I can't see how fast tracepoint affects the output of 
> 'tstatus', so I propose this patch to remove them.
> 
>> If we aren't doing any fast tracepoint tests, then is
>> there a reason to keep this prepare_for_testing and
>> runto_main instead of removing them altogether?
> 
> OK, the prepare_for_testing and runto_main are removed.

> 2013-03-05  Yao Qi  <yao@codesourcery.com>
>
> 	* gdb.trace/tstatus.exp: Remove the invocation to
> 	gdb_load_shlibs, gdb_compile, clean_restart and runto_main.

"invocation of"

> 	(test_tracepoints): Don't set fast tracepoint.
> 	(top level): Don't check agent library is loaded or not.

OK.

-- 
Pedro Alves


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

* Re: [PATCH] Don't need fast tracepoint in tstatus.exp
  2013-03-04 15:47 [PATCH] Don't need fast tracepoint in tstatus.exp Yao Qi
  2013-03-04 16:47 ` Pedro Alves
@ 2013-03-06  0:11 ` Stan Shebs
  1 sibling, 0 replies; 5+ messages in thread
From: Stan Shebs @ 2013-03-06  0:11 UTC (permalink / raw)
  To: gdb-patches

On 3/4/13 7:46 AM, Yao Qi wrote:
> tstatus.exp is used to test the output of 'tstatus' but there are some
> tests on fast tracepoint in it, which is not related to tstatus.  This
> patch is to remove these fast tracepoint related stuff from tstatus.exp.

Even going back through old mail and notes, I simply cannot remember why
using fast tracepoints here seemed like a good idea.  It doesn't even
look like a cut-n-paste from elsewhere, since there are small
differences from other uses.  About the only thing I can think of is
that sometimes I want to mix up features a little in the testsuite, so
as to do double duty as unit test and integration test (which sounds a
little foolish now that I see it written down :-) ).

In any case, fast tracepoints do look like a distraction from the
business of tstatus testing, so I'm OK with this change.

Stan
stan@codesourcery.com


> 
> gdb/testsuite:
> 
> 2013-03-04  Yao Qi  <yao@codesourcery.com>
> 
> 	* gdb.trace/tstatus.exp: Use prepare_for_testing.
> 	(test_tracepoints): Don't set fast tracepoint.
> 	(top level): Don't check agent library is loaded or not.
> ---
>  gdb/testsuite/gdb.trace/tstatus.exp |   41 +++-------------------------------
>  1 files changed, 4 insertions(+), 37 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.trace/tstatus.exp b/gdb/testsuite/gdb.trace/tstatus.exp
> index 8a0bbdf..483bb20 100644
> --- a/gdb/testsuite/gdb.trace/tstatus.exp
> +++ b/gdb/testsuite/gdb.trace/tstatus.exp
> @@ -34,22 +34,14 @@ if ![gdb_target_supports_trace] {
>      return -1
>  }
>  
> -set libipa [get_in_proc_agent]
> -gdb_load_shlibs $libipa
> -
> -# Can't use prepare_for_testing, because that splits compiling into
> -# building objects and then linking, and we'd fail with "linker input
> -# file unused because linking not done" when building the object.
> -
> -if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
> -	  executable [list debug shlib=$libipa] ] != "" } {
> -    untested "failed to compile ftrace tests"
> +if [prepare_for_testing $expfile $executable $srcfile \
> +	{debug nowarnings} ] {
> +    untested "failed to compile tracepoint tests"
>      return -1
>  }
> -clean_restart ${executable}
>  
>  if ![runto_main] {
> -    fail "Can't run to main for ftrace tests"
> +    fail "Can't run to main for tracepoint tests"
>      return 0
>  }
>  
> @@ -141,34 +133,9 @@ proc test_tracepoints {} {
>      gdb_trace_setactions "collect at set_point: define actions" \
>  	"" \
>  	"collect parm" "^$"
> -    set fastgood 0
> -
> -    gdb_test_multiple "ftrace gdb_recursion_test" "set fast tracepoint" {
> -	-re "May not have a fast tracepoint at .*\r\n$gdb_prompt $" {
> -	    pass "4-byte fast tracepoint could not be set"
> -	}
> -	-re "Fast tracepoint .*\r\n$gdb_prompt $" {
> -	    pass "4-byte fast tracepoint is set"
> -	    set fastgood 1
> -	}
> -    }
> -
> -    if { $fastgood } {
> -
> -	gdb_trace_setactions "collect at four_byter: define actions" \
> -	    "" \
> -	    "collect globvar, anarg" "^$"
> -    }
>  
>      run_trace_experiment
>  
>  }
>  
> -gdb_reinitialize_dir $srcdir/$subdir
> -
> -if { [gdb_test "info sharedlibrary" ".*${libipa}.*" "IPA loaded"] != 0 } {
> -    untested "Could not find IPA lib loaded"
> -    return 1
> -}
> -
>  test_tracepoints
> 


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

end of thread, other threads:[~2013-03-06  0:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-04 15:47 [PATCH] Don't need fast tracepoint in tstatus.exp Yao Qi
2013-03-04 16:47 ` Pedro Alves
2013-03-05  4:52   ` Yao Qi
2013-03-05 13:08     ` Pedro Alves
2013-03-06  0:11 ` Stan Shebs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox