This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] Add test for fast tracepoint enable/disable
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Thu, 31 Mar 2016 11:58:27 +0100
- Subject: Re: [PATCH 2/2] Add test for fast tracepoint enable/disable
- Authentication-results: sourceware.org; auth=none
- References: <1459351018-23718-1-git-send-email-simon dot marchi at ericsson dot com> <1459351018-23718-2-git-send-email-simon dot marchi at ericsson dot com>
Simon Marchi <simon.marchi@ericsson.com> writes:
> +# Check that the target supports trace.
> +if { [gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
> + untested "Couldn't compile test program"
> + return -1
> +}
Why do you compile program with pthread?
> +
> +clean_restart ${testfile}
> +
> +if ![runto_main] {
> + fail "Can't run to main to check for trace support"
> + return -1
> +}
> +
> +if ![gdb_target_supports_trace] {
> + unsupported "target does not support trace"
> + return -1
> +}
> +
> +# Compile the test case with the in-process agent library.
> +set libipa [get_in_proc_agent]
> +gdb_load_shlibs $libipa
> +
> +lappend options shlib=$libipa
> +
> +if { [gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
> + untested "Couldn't compile test program with in-process agent library"
> + return -1
> +}
Likewise.
> +
> +# This test makes sure that disabling and enabling fast tracepoints works
> +# correctly.
> +
> +proc test_ftrace_enable_disable { } {
Can you extend the test to cover normal tracepoint as well? It
shouldn't be hard. You can just pass argument "type" to "proc
test_trace_enable_disable" like,
proc test_trace_enable_disable { type } {
and the type can be "trace" and "ftrace".
--
Yao (éå)