Better/more user space testing [all_compile_flags]

Mark Wielaard mjw@redhat.com
Wed Nov 23 16:26:00 GMT 2011


Hi,

While poking at non-x86 architectures (arm and s390x) I found some user
space issues that weren't really specific to those arches. But they were
caused by different compiler output, different dwarf constructs or
inlining decisions. They could often be triggered on x86 too with the
right compiler flags. So I added testsuite/lib/compile_flags.exp with
some tcl functions you can use to run a user space test against a build
with various flags (-m32/-64 if the architecture supports it and
no-O[12] optimizations).

Please consider wrapping new tests that depend on compiled code in
something like the following loop:

for {set i 0} {$i < [all_compile_flags]} {incr i} {
  set extra_flag [all_compile_flag $i] # extra target_compile flags to use
  set extra_name [all_compile_flag_name $i] # extra name in test output
  set test_flags "compiler=g++ additional_flags=-g [sdt_includes] $extra_flag"
  set res [target_compile "$srcfile" $test-$extra_name.exe executable "$test_flags"]
[...]
  if {[installtest_p] && [uprobes_p]} {
    stap_run3 "$test-$extra_name" "$stpfile" -c ./$test-$extra_name.exe
  } else {
    untested "$test-$extra_name"
  }
}

See for example testsuite/systemtap.base/stmt_rel_user.exp or
testsuite/systemtap.base/cast-scope.exp. That way issues that might
depend on different compiler output may be caught earlier on all
architectures.

Thanks,

Mark



More information about the Systemtap mailing list