summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/buildok/tcp_test.stp14
-rwxr-xr-xtestsuite/parseko/cmdline17.stp8
-rwxr-xr-xtestsuite/parseko/cmdline18.stp10
-rwxr-xr-xtestsuite/parseko/cmdline19.stp10
-rwxr-xr-xtestsuite/parseko/cmdline20.stp9
-rwxr-xr-xtestsuite/parseko/cmdline21.stp15
-rw-r--r--testsuite/systemtap.base/alternatives.exp5
-rw-r--r--testsuite/systemtap.base/flightrec3.exp79
-rw-r--r--testsuite/systemtap.base/flightrec3.stp5
-rw-r--r--testsuite/systemtap.base/skipped.exp6
10 files changed, 149 insertions, 12 deletions
diff --git a/testsuite/buildok/tcp_test.stp b/testsuite/buildok/tcp_test.stp
index a262ab29..a5e3bafb 100755
--- a/testsuite/buildok/tcp_test.stp
+++ b/testsuite/buildok/tcp_test.stp
@@ -8,16 +8,16 @@ function print_report()
}
probe tcp.sendmsg {
- ports = inet_get_local_port(sk)
- src_ips = inet_get_ip_source(sk)
- rtos = tcp_get_info_rto(sk)
+ ports = inet_get_local_port(sock)
+ src_ips = inet_get_ip_source(sock)
+ rtos = tcp_get_info_rto(sock)
}
probe tcp.recvmsg {
- cwnd = tcp_get_info_snd_cwnd(sk)
- mss = tcp_ts_get_info_rcv_mss(sk)
- ssthresh = tcp_ts_get_info_snd_ssthresh(sk)
- state = tcp_ts_get_info_state(sk)
+ cwnd = tcp_get_info_snd_cwnd(sock)
+ mss = tcp_ts_get_info_rcv_mss(sock)
+ ssthresh = tcp_ts_get_info_snd_ssthresh(sock)
+ state = tcp_ts_get_info_state(sock)
}
probe tcp.sendmsg.return {
diff --git a/testsuite/parseko/cmdline17.stp b/testsuite/parseko/cmdline17.stp
new file mode 100755
index 00000000..a9baf2d4
--- /dev/null
+++ b/testsuite/parseko/cmdline17.stp
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# options '-D' and '-L' are mutually exclusive
+#
+#-D Run in background. This requires '-o' option.
+#-L Load module and start probes, then detach.
+
+staprun -L -D fake_module
diff --git a/testsuite/parseko/cmdline18.stp b/testsuite/parseko/cmdline18.stp
new file mode 100755
index 00000000..bbdfbcc5
--- /dev/null
+++ b/testsuite/parseko/cmdline18.stp
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# options '-D' and '-d' are mutually exclusive
+#
+#-D Run in background. This requires '-o' option.
+#-d Delete a module. Only detached or unused modules
+# the user has permission to access will be deleted. Use "*"
+# (quoted) to delete all unused modules.
+
+staprun -d -D fake_module
diff --git a/testsuite/parseko/cmdline19.stp b/testsuite/parseko/cmdline19.stp
new file mode 100755
index 00000000..fbcef351
--- /dev/null
+++ b/testsuite/parseko/cmdline19.stp
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# options '-D' and '-c cmd' are mutually exclusive
+#
+#-D Run in background. This requires '-o' option.
+#-c cmd Command 'cmd' will be run and staprun will
+# exit when it does. The '_stp_target' variable
+# will contain the pid for the command.
+
+staprun -c /bin/ls -D fake_module
diff --git a/testsuite/parseko/cmdline20.stp b/testsuite/parseko/cmdline20.stp
new file mode 100755
index 00000000..625cf20d
--- /dev/null
+++ b/testsuite/parseko/cmdline20.stp
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# You have to specify ouput FILE with '-D' option
+#
+#-D Run in background. This requires '-o' option.
+#-o FILE Send output to FILE. This supports strftime(3)
+# formats for FILE.
+
+staprun -D fake_module
diff --git a/testsuite/parseko/cmdline21.stp b/testsuite/parseko/cmdline21.stp
new file mode 100755
index 00000000..d7496c8c
--- /dev/null
+++ b/testsuite/parseko/cmdline21.stp
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# You have to specify ouput FILE with '-S' option
+#
+#-S size[,N] Switches output file to next file when the size
+# of file reaches the specified size. The value
+# should be an integer greater than 1 which is
+# assumed to be the maximum file size in MB.
+# When the number of output files reaches N, it
+# switches to the first output file. You can omit
+# the second argument.
+#-o FILE Send output to FILE. This supports strftime(3)
+# formats for FILE.
+
+staprun -S 1,1 fake_module
diff --git a/testsuite/systemtap.base/alternatives.exp b/testsuite/systemtap.base/alternatives.exp
index 6cbc1e10..f5dc4513 100644
--- a/testsuite/systemtap.base/alternatives.exp
+++ b/testsuite/systemtap.base/alternatives.exp
@@ -26,10 +26,11 @@ proc stap_run_alternatives {args} {
verbose -log "starting $args"
eval spawn $args
expect {
+ -timeout 60
-re {semantic error: .+ \(alternatives: [a-zA-Z_]} {incr alternatives_found; exp_continue}
-re {[^\r]*\r} { verbose -log $expect_out(0,string); exp_continue }
- eof { }
- timeout { }
+ eof { verbose -log "EOF" }
+ timeout { verbose -log "TIMEOUT" }
}
set results [wait]
verbose -log "wait results: $results"
diff --git a/testsuite/systemtap.base/flightrec3.exp b/testsuite/systemtap.base/flightrec3.exp
new file mode 100644
index 00000000..5b9d8253
--- /dev/null
+++ b/testsuite/systemtap.base/flightrec3.exp
@@ -0,0 +1,79 @@
+set test "flightrec3"
+if {![installtest_p]} { untested $test; return }
+
+# cleanup
+system "rm -f flightlog.out*"
+
+set pid 0
+# check -S option with bulk(percpu file) mode
+spawn stap -F -o flightlog.out -S 1,3 -b $srcdir/$subdir/$test.stp
+expect {
+ -timeout 240
+ -re {([0-9]+)\r\n} {
+ pass "$test (-S option with bulk mode)"
+ set pid $expect_out(1,string)
+ exp_continue}
+ timeout { fail "$test (timeout)"}
+ eof { }
+}
+wait
+if {$pid == 0} {
+ fail "$test (no pid)"
+ return -1
+}
+
+exec sleep 4
+array set cpus {}
+set scnt 0
+# wait for log files
+exec kill -STOP $pid
+exec sleep 1
+eval spawn stat -c \"%n %s\" [glob flightlog.out_cpu*]
+expect {
+ -timeout 100
+ -re {flightlog.out_cpu([0-9]+).[0-9]+ ([0-9]+)\r\n} {
+ set cpuid $expect_out(1,string)
+ set size $expect_out(2,string)
+ if {[array get cpus $cpuid] == ""} {set cpus($cpuid) 0}
+ incr cpus($cpuid);
+ if {$size <= 1048576 } {incr scnt}
+ exp_continue}
+ timeout { fail "$test (logfile timeout)"}
+}
+wait
+exec kill -CONT $pid
+exec sleep 3
+exec kill -STOP $pid
+eval spawn stat -c \"%n %s\" [glob flightlog.out_cpu*]
+expect {
+ -timeout 100
+ -re {flightlog.out_cpu([0-9]+).[0-9]+ ([0-9]+)\r\n} {
+ set cpuid $expect_out(1,string)
+ set size $expect_out(2,string)
+ if {[array get cpus $cpuid] == ""} {set cpus($cpuid) 0}
+ incr cpus($cpuid);
+ if {$size <= 1048576 } {incr scnt}
+ exp_continue}
+ timeout { fail "$test (logfile timeout)"}
+}
+wait
+exec kill -CONT $pid
+# check logfile number
+set cnt 0
+foreach e [array names cpus] {
+ if {$cpus($e) != 6} {
+ fail "$test (log file numbers cpu:$e, cnt:$cpus($e)))"
+ }
+ set cnt [expr $cnt + $cpus($e)]
+}
+# check logfile size
+if {$scnt == $cnt} {
+ pass "$test (log file size limitation with bulk mode)"
+} else {
+ fail "$test (log file size ($scnt != $cnt))"
+}
+exec kill -TERM $pid
+# wait for exiting...
+exec sleep 1
+system "rm -f flightlog.out*"
+
diff --git a/testsuite/systemtap.base/flightrec3.stp b/testsuite/systemtap.base/flightrec3.stp
new file mode 100644
index 00000000..d660793f
--- /dev/null
+++ b/testsuite/systemtap.base/flightrec3.stp
@@ -0,0 +1,5 @@
+probe kernel.function("update_process_times")
+{
+ for (j = 0; j < 100; j++)
+ printf("1234567890\n")
+}
diff --git a/testsuite/systemtap.base/skipped.exp b/testsuite/systemtap.base/skipped.exp
index 8c491037..f3048c8a 100644
--- a/testsuite/systemtap.base/skipped.exp
+++ b/testsuite/systemtap.base/skipped.exp
@@ -2,8 +2,8 @@ set test "skip tracking"
if {! [installtest_p]} { untested $test; return }
-set cpus [exec sh -c "grep ^processor /proc/cpuinfo | wc -l"]
-if {$cpus < 2} { unsupported $test; return }
+set nr_cpus [exec sh -c "grep ^processor /proc/cpuinfo | wc -l"]
+if {$nr_cpus < 2} { unsupported $test; return }
set ok 0
spawn stap -e "probe timer.s(5) {exit()} probe timer.profile,syscall.* {f++} global f" -DMAXTRYLOCK=0 -tu
@@ -18,4 +18,4 @@ expect {
catch {close}
catch {wait}
-if {$ok >= 3} { pass "$test ($cpus $ok)" } else { fail "$test ($cpus $ok)" }
+if {$ok >= 3} { pass "$test ($nr_cpus $ok)" } else { fail "$test ($nr_cpus $ok)" }