summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/tracepoints.exp
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2009-09-13 23:37:28 +0200
committerMark Wielaard <mjw@redhat.com>2009-09-13 23:37:28 +0200
commit6ff3e5250db10f8e6a875bc1ddecf19f8181739c (patch)
treee3975612a4dcb8e8c1c2cc9eb630ba445f008689 /testsuite/systemtap.base/tracepoints.exp
parentbfc99f57e8a6bc2f217a14f01a1bb4ff4620881b (diff)
downloadsystemtap-steved-6ff3e5250db10f8e6a875bc1ddecf19f8181739c.tar.gz
systemtap-steved-6ff3e5250db10f8e6a875bc1ddecf19f8181739c.tar.xz
systemtap-steved-6ff3e5250db10f8e6a875bc1ddecf19f8181739c.zip
Make tracepoints.exp test more efficient by running as one giant script.
When there are lots of tracepoints in the kernel running a script for each one individually can take several minutes. So run them all in one giant script at the same time. Also increase timeout for the stap -l collection step since with an empty cache that might take more than the default 10 seconds. * testsuite/systemtap.base/tracepoints.exp: Increase default timeout. Collect all script fragments and run them as one.
Diffstat (limited to 'testsuite/systemtap.base/tracepoints.exp')
-rw-r--r--testsuite/systemtap.base/tracepoints.exp26
1 files changed, 20 insertions, 6 deletions
diff --git a/testsuite/systemtap.base/tracepoints.exp b/testsuite/systemtap.base/tracepoints.exp
index a4e38c05..b9014208 100644
--- a/testsuite/systemtap.base/tracepoints.exp
+++ b/testsuite/systemtap.base/tracepoints.exp
@@ -2,6 +2,7 @@
set tracepoints {}
spawn stap -l {kernel.trace("*")}
expect {
+ -timeout 60
-re {^kernel.trace[^\r\n]*\r\n} {
append tracepoints $expect_out(0,string)
exp_continue
@@ -11,13 +12,26 @@ expect {
}
catch {close}; catch { wait }
+# Use this to test each tracepoint individually.
+#foreach tp $tracepoints {
+# set test "tracepoint $tp -p4"
+# if {[catch {exec stap -w -p4 -e "probe $tp { println($\$name, $\$vars) }"} res]} {
+# fail "$test $res"
+# } else {
+# pass "$test"
+# }
+#}
+
+# This tests all tracepoints all at once (much faster than the above)
+set script "probe begin {}"
foreach tp $tracepoints {
- set test "tracepoint $tp -p4"
- if {[catch {exec stap -w -p4 -e "probe $tp { println($\$name, $\$vars) }"} res]} {
- fail "$test $res"
- } else {
- pass "$test"
- }
+ set script "$script probe $tp { println($\$name, $\$vars) }"
+}
+send_log "Trying stap -w -p4 -e $script\n"
+if {[catch {exec stap -w -p4 -e "$script"} res]} {
+ fail "tracepoints $res"
+} else {
+ pass "tracepoints"
}
set test "tracepoints"