diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/lib/stap_run2.exp | 2 | ||||
-rw-r--r-- | testsuite/systemtap.base/sdt.exp | 20 | ||||
-rw-r--r-- | testsuite/systemtap.base/sdt.stp | 20 | ||||
-rw-r--r-- | testsuite/systemtap.base/static_uprobes.exp | 12 | ||||
-rw-r--r-- | testsuite/systemtap.examples/network/tcp.stp | 11 |
5 files changed, 45 insertions, 20 deletions
diff --git a/testsuite/lib/stap_run2.exp b/testsuite/lib/stap_run2.exp index b734a1e7..d1f02c83 100644 --- a/testsuite/lib/stap_run2.exp +++ b/testsuite/lib/stap_run2.exp @@ -29,7 +29,7 @@ proc stap_run2 { TEST_NAME args } { proc stap_run3 { TEST_NAME TEST_FILE args } { if {[info procs installtest_p] != "" && ![installtest_p]} { untested $TEST_NAME; return } - set cmd [concat stap $args $TEST_FILE] + set cmd [concat stap $TEST_FILE $args] send_log "executing: $cmd\n" catch {eval exec $cmd} res diff --git a/testsuite/systemtap.base/sdt.exp b/testsuite/systemtap.base/sdt.exp index 21b94810..46fa5a28 100644 --- a/testsuite/systemtap.base/sdt.exp +++ b/testsuite/systemtap.base/sdt.exp @@ -15,6 +15,7 @@ set extra_flags {{""} {additional_flags=-std=gnu89} {additional_flags=-ansi} {ad # Iterate extra_flags, trying each with C and C++ for {set i 0} {$i < [llength $extra_flags]} {incr i} { set extra_flag [lindex $extra_flags $i] +set testprog "sdt.c.exe.$i" # C set test_flags "additional_flags=-g" @@ -23,42 +24,47 @@ set test_flags "$test_flags additional_flags=-Wall" set test_flags "$test_flags additional_flags=-Wextra" set test_flags "$test_flags additional_flags=-Werror" -set res [target_compile $srcdir/$subdir/$test.c $test.prog executable "$test_flags $extra_flag"] +set saveidx 0 + +set res [target_compile $srcdir/$subdir/$test.c $testprog executable "$test_flags $extra_flag"] if { $res != "" } { verbose "target_compile failed: $res" 2 fail "compiling $test.c $extra_flag" - return + untested "$test $extra_flag" + continue } else { pass "compiling $test.c $extra_flag" } if {[installtest_p]} { - stap_run3 "$test $extra_flag" $srcdir/$subdir/$test.stp -c ./$test.prog + stap_run3 "$test $extra_flag" $srcdir/$subdir/$test.stp $testprog -c ./$testprog } else { untested "$test $extra_flag" } # C++ +set testprog "sdt.cxx.exe.$i" + set test_flags "additional_flags=-g" set test_flags "$test_flags additional_flags=-I$srcdir/../includes/sys" set test_flags "$test_flags additional_flags=-Wall" set test_flags "$test_flags additional_flags=-Werror" set test_flags "$test_flags additional_flags=-x additional_flags=c++" -set res [target_compile $srcdir/$subdir/$test.c $test.prog executable "$test_flags $extra_flag"] +set res [target_compile $srcdir/$subdir/$test.c $testprog executable "$test_flags $extra_flag"] if { $res != "" } { verbose "target_compile failed: $res" 2 fail "compiling $test.c c++ $extra_flag" - return + untested "$test $extra_flag" + continue } else { pass "compiling $test.c c++ $extra_flag" } if {[installtest_p]} { - stap_run3 "$test c++ $extra_flag" $srcdir/$subdir/$test.stp -c ./$test.prog + stap_run3 "$test c++ $extra_flag" $srcdir/$subdir/$test.stp $testprog -c ./$testprog } else { untested "$test c++ $extra_flag" } } -catch {exec rm -f $test.prog} diff --git a/testsuite/systemtap.base/sdt.stp b/testsuite/systemtap.base/sdt.stp index 1f075bca..5df1fdc9 100644 --- a/testsuite/systemtap.base/sdt.stp +++ b/testsuite/systemtap.base/sdt.stp @@ -1,49 +1,49 @@ -probe process("sdt.prog").mark("mark_a") +probe process(@1).mark("mark_a") { printf("%d\n", $arg1); } -probe process("sdt.prog").mark("mark_b") +probe process(@1).mark("mark_b") { printf("%d %d\n", $arg1, $arg2); } -probe process("sdt.prog").mark("mark_c") +probe process(@1).mark("mark_c") { printf("%d %d %d\n", $arg1, $arg2, $arg3); } -probe process("sdt.prog").mark("mark_d") +probe process(@1).mark("mark_d") { printf("%d %d %d %d\n", $arg1, $arg2, $arg3, $arg4); } -probe process("sdt.prog").mark("mark_e") +probe process(@1).mark("mark_e") { printf("%d %d %d %d %d\n", $arg1, $arg2, $arg3, $arg4, $arg5); } -probe process("sdt.prog").mark("mark_f") +probe process(@1).mark("mark_f") { printf("%d %d %d %d %d %d\n", $arg1, $arg2, $arg3, $arg4, $arg5, $arg6); } -probe process("sdt.prog").mark("mark_g") +probe process(@1).mark("mark_g") { printf("%d %d %d %d %d %d %d\n", $arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7); } -probe process("sdt.prog").mark("mark_h") +probe process(@1).mark("mark_h") { printf("%d %d %d %d %d %d %d %d\n", $arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7, $arg8); } -probe process("sdt.prog").mark("mark_i") +probe process(@1).mark("mark_i") { printf("%d %d %d %d %d %d %d %d %d\n", $arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7, $arg8, $arg9); } -probe process("sdt.prog").mark("mark_j") +probe process(@1).mark("mark_j") { printf("%d %d %d %d %d %d %d %d %d %d\n", $arg1, $arg2, $arg3, $arg4, $arg5, $arg6, $arg7, $arg8, $arg9, $arg10); } diff --git a/testsuite/systemtap.base/static_uprobes.exp b/testsuite/systemtap.base/static_uprobes.exp index b4214436..e407440e 100644 --- a/testsuite/systemtap.base/static_uprobes.exp +++ b/testsuite/systemtap.base/static_uprobes.exp @@ -103,7 +103,11 @@ if {[installtest_p]} { set sdtdir $srcdir/../includes } -set sup_flags "additional_flags=-I$sdtdir additional_flags=-g additional_flags=-O additional_flags=-I." +set sup_flags "additional_flags=-I$srcdir/../includes/sys" +set sup_flags "$sup_flags additional_flags=-I$sdtdir" +set sup_flags "$sup_flags additional_flags=-g" +set sup_flags "$sup_flags additional_flags=-O" +set sup_flags "$sup_flags additional_flags=-I." set res [target_compile $sup_srcpath $sup_exepath executable $sup_flags] if { $res != "" } { verbose "target_compile failed: $res" 2 @@ -177,6 +181,10 @@ expect { wait -if {$ok == 5} { pass "$test C++" } { fail "$test C++ ($ok)" } +# we now generate the probes via asm so there is no label debug info +if {$ok == 5} { pass "$test C++" } { xfail "$test C++ ($ok)" } +if { $verbose == 0 } { catch {exec rm -f $sup_srcpath $sup_exepath $supcplus_exepath $sup_dpath $sup_hpath $sup_stppath} +} + diff --git a/testsuite/systemtap.examples/network/tcp.stp b/testsuite/systemtap.examples/network/tcp.stp new file mode 100644 index 00000000..ebe72a1c --- /dev/null +++ b/testsuite/systemtap.examples/network/tcp.stp @@ -0,0 +1,11 @@ +//A simple TCP tapset example + +probe begin { + printf("Expected IP 7.91.205.21 .... %s\n", ip_ntop(123456789)) + printf("Expected IP 58.222.104.177 .... %s\n", ip_ntop(987654321)) + printf("Expected IP 9.3.191.111 ... %s\n", ip_ntop(151240559)) +} + +probe tcp.recvmsg { + printf("received a message from %s on port %d from port %d\n", saddr, dport, sport) +} |