This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Better/more user space testing [all_compile_flags]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]