Re: [PATCH 2/2] Add test for fast tracepoint enable/disable

Yao Qi
2016-03-31T10:58:46Z

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 (齐尧)