diff options
author | Dave Brolley <brolley@redhat.com> | 2009-03-31 12:21:26 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-03-31 12:21:26 -0400 |
commit | dff5b6a2d7a63b4554d1320c0603dc8757b9c8a7 (patch) | |
tree | cd139bae97c71558ccabdc3f69471d8e6a35049b /testsuite | |
parent | 8f2b14197e7db279434c5b063b755d1121c137de (diff) | |
parent | c5746f91b1ba8f374b4230e16cb33e1b9206ca2b (diff) | |
download | systemtap-steved-dff5b6a2d7a63b4554d1320c0603dc8757b9c8a7.tar.gz systemtap-steved-dff5b6a2d7a63b4554d1320c0603dc8757b9c8a7.tar.xz systemtap-steved-dff5b6a2d7a63b4554d1320c0603dc8757b9c8a7.zip |
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/systemtap.base/static_uprobes.exp | 38 | ||||
-rw-r--r-- | testsuite/systemtap.base/x86_gs.exp | 12 | ||||
-rw-r--r-- | testsuite/systemtap.base/x86_gs.stp | 10 |
3 files changed, 54 insertions, 6 deletions
diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp index 620d5576..820626b8 100644 --- a/testsuite/systemtap.base/static_uprobes.exp +++ b/testsuite/systemtap.base/static_uprobes.exp @@ -1,5 +1,7 @@ set test "static_uprobes" +# Test miscellaneous features of .mark probes + # Compile a C program to use as the user-space probing target set sup_srcpath "[pwd]/static_uprobes.c" set sup_exepath "[pwd]/static_uprobes.x" @@ -80,6 +82,9 @@ provider static_uprobes { }; " close $fp + +# Test dtrace + if {[installtest_p]} { set dtrace $env(SYSTEMTAP_PATH)/dtrace } else { @@ -90,9 +95,9 @@ if {[catch {exec $dtrace -h -s $sup_dpath} res]} { } catch {exec rm -f $sup_dpath} if {[file exists $sup_hpath]} then { - pass "$test generating header" + pass "$test dtrace" } else { - fail "$test generating header" + fail "$test dtrace" catch {exec rm -f $sup_srcpath $sup_hpath $sup_stppath} return } @@ -133,6 +138,8 @@ if {$utrace_support_found == 0} { return } +# Run stap on executable built with dtrace generated header file + set ok 0 verbose -log "spawn stap -c $sup_exepath $sup_stppath" @@ -151,14 +158,16 @@ wait if {$ok == 5} { pass "$test C" } { fail "$test C ($ok)" } +# Test passing various C types to .mark probes + set sup_flags "$sup_flags additional_flags=-O0" set res [target_compile $srcdir/$subdir/sdt_types.c sdt_types.x executable $sup_flags] if { $res != "" } { verbose "target_compile failed: $res" 2 - fail "$test compiling -g" + fail "$test compiling types -g" return } else { - pass "$test compiling -g" + pass "$test compiling types -g" } set ok 0 @@ -176,9 +185,26 @@ expect { wait if { $ok != 0 } { - fail $fail + fail "$test $fail" +} else { + pass "$test types" +} + +# Test .mark probe wildcard matching + +set ok 0 +spawn stap -l "process(\"./sdt_types.x\").mark(\"*\")" +expect { + -timeout 180 + -re {mark\(\".*\"\)} { incr ok; exp_continue } + timeout { fail "$test C (timeout)" } + eof { } +} + +if { $ok == 45 } { + pass "$test wildcard" } else { - pass types + fail "$test wildcard ($ok)" } if { $verbose == 0 } { diff --git a/testsuite/systemtap.base/x86_gs.exp b/testsuite/systemtap.base/x86_gs.exp new file mode 100644 index 00000000..98ab3051 --- /dev/null +++ b/testsuite/systemtap.base/x86_gs.exp @@ -0,0 +1,12 @@ +set test "x86_gs" +if {![installtest_p]} { untested $test; return } +set arch [exec uname -m] +if {$arch!="i686"} { untested $test; return } +spawn stap $srcdir/$subdir/x86_gs.stp +expect { + -timeout 60 + -re "0\r\n" { pass $test } + -re "140\r\n" { pass $test } + eof { fail $test } + timeout { fail "$test unexpected timeout" } +} diff --git a/testsuite/systemtap.base/x86_gs.stp b/testsuite/systemtap.base/x86_gs.stp new file mode 100644 index 00000000..68b58512 --- /dev/null +++ b/testsuite/systemtap.base/x86_gs.stp @@ -0,0 +1,10 @@ +#! stap + +# test x86 gs register + +probe begin { + if (!_stp_regs_registered) + _stp_register_regs() + printf("%d\n",test_x86_gs() * 100 + _reg_offsets["gs"]) /* 0 or 140 */ + exit() +} |