public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Better/more user space testing [all_compile_flags]
@ 2011-11-23 16:26 Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2011-11-23 16:26 UTC (permalink / raw)
  To: systemtap

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-11-23 16:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-23 16:26 Better/more user space testing [all_compile_flags] Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).