summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.base')
-rw-r--r--testsuite/systemtap.base/declaration.exp20
-rw-r--r--testsuite/systemtap.base/maxmemory.exp86
-rw-r--r--testsuite/systemtap.base/sdt.exp4
-rw-r--r--testsuite/systemtap.base/sdt_misc.exp4
4 files changed, 90 insertions, 24 deletions
diff --git a/testsuite/systemtap.base/declaration.exp b/testsuite/systemtap.base/declaration.exp
deleted file mode 100644
index f7452a14..00000000
--- a/testsuite/systemtap.base/declaration.exp
+++ /dev/null
@@ -1,20 +0,0 @@
-# Declaration tests. Specifically looking for resolution of
-# DW_AT_declaration from another module
-
-set TEST_NAME "empty-struct resolve-fail"
-
-# this test just makes sure $device is still stubbed with DW_AT_declaration
-set failscript {
- probe\ module(\"libata\").function(\"ata_qc_issue\")\ \{\ print(\$qc->\$scsicmd->\$device->\$host->\$host_no)\ \};
-}
-
-stap_compile $TEST_NAME 0 $failscript
-
-set TEST_NAME "empty-struct resolve-pass"
-
-set passscript {
- probe\ module(\"scsi_mod\").function(\"scsi_request_fn\")\ \{print(\$q)\}
-}
-
-setup_xfail 10732 "*-*-*"
-stap_compile $TEST_NAME 1 [concat $passscript $failscript ]
diff --git a/testsuite/systemtap.base/maxmemory.exp b/testsuite/systemtap.base/maxmemory.exp
new file mode 100644
index 00000000..20827edf
--- /dev/null
+++ b/testsuite/systemtap.base/maxmemory.exp
@@ -0,0 +1,86 @@
+if {![installtest_p]} {untested "MAXMEMORY"; return}
+
+set script {
+ global k
+
+ probe begin {
+ print("systemtap starting probe\n")
+ k["foo"] = 0
+ }
+
+ probe kernel.function("vfs_read"), kernel.function("vfs_write") {
+ k["foo"]++
+ }
+ probe end {
+ print("systemtap ending probe\n")
+ }
+}
+
+# stap_run_maxmemory TEST_NAME EXPECT_ERROR
+# TEST_NAME is the name of the current test
+# EXPECT_ERROR lets us know to expect an error or not
+#
+# Additional arguments are passed to stap as-is.
+proc stap_run_maxmemory { TEST_NAME EXPECT_ERROR args } {
+
+ set cmd [concat {stap -v} $args]
+ eval spawn $cmd
+ expect {
+ -timeout 150
+ -re {^Pass\ [1234]: [^\r]+real\ ms\.\r\n} {exp_continue}
+ -re {^Pass\ ([34]): using cached [^\r]+\r\n} {exp_continue}
+ -re {^Pass 5: starting run.\r\n} {exp_continue}
+ -re {^Error inserting module[^\r]+\r\n} {
+ if {$EXPECT_ERROR} {
+ pass "$TEST_NAME received expected insert module error"
+ } else {
+ fail "$TEST_NAME unexpected insert module error"
+ }
+ }
+ -re {ERROR: [^\r]+ allocation failed\r\n} {
+ if {$EXPECT_ERROR} {
+ pass "$TEST_NAME received expected allocation error"
+ } else {
+ fail "$TEST_NAME unexpected allocation error"
+ }
+ }
+ -re "^systemtap starting probe\r\n" {
+ exec kill -INT -[exp_pid]
+
+ expect {
+ -timeout 10
+ -re {^systemtap ending probe\r\n} {
+ if {$EXPECT_ERROR} {
+ fail "$TEST_NAME didn't receive expected allocation error"
+ } else {
+ pass "$TEST_NAME didn't receive allocation error"
+ }
+ }
+ -re {ERROR: .+ allocation failed\r\n} {
+ if {$EXPECT_ERROR} {
+ pass "$TEST_NAME received expected allocation error"
+ } else {
+ fail "$TEST_NAME received an unexpected allocation error"
+ }
+ }
+ }
+ }
+ -re "semantic error:" { fail "$TEST_NAME compilation" }
+ timeout { fail "$TEST_NAME startup (timeout)";
+ exec kill -INT -[exp_pid] }
+ eof { fail "$TEST_NAME startup (eof)" }
+ }
+ catch close
+ wait
+}
+
+# MAXMEMORY1 tests to make sure normal operation doesn't receive a
+# max memory error
+set test "MAXMEMORY1"
+stap_run_maxmemory $test 0 -u -e $script
+
+# MAXMEMORY2 is the same script, but we're adjusting STP_MAXMEMORY to
+# a low value so that we *will* get an allocation error or an insert
+# module error.
+set test "MAXMEMORY2"
+stap_run_maxmemory $test 1 -u -DSTP_MAXMEMORY=200 -e $script
diff --git a/testsuite/systemtap.base/sdt.exp b/testsuite/systemtap.base/sdt.exp
index ea025391..8a77cc06 100644
--- a/testsuite/systemtap.base/sdt.exp
+++ b/testsuite/systemtap.base/sdt.exp
@@ -12,8 +12,8 @@ set ::result_string {1
set extra_flags {{""} {additional_flags=-std=gnu89} {additional_flags=-ansi} {additional_flags=-pedantic} {additional_flags=-ansi additional_flags=-pedantic} {additional_flags=-O2} {additional_flags="-O3"}}
-set pbtype_flags {{""} {additional_flags=-DEXPERIMENTAL_UTRACE_SDT} {additional_flags=-DEXPERIMENTAL_KPROBE_SDT}}
-set pbtype_mssgs {{uprobe} {utrace} {kprobe}}
+set pbtype_flags {{""} {additional_flags=-DEXPERIMENTAL_KPROBE_SDT}}
+set pbtype_mssgs {{uprobe} {kprobe}}
# Iterate pbtype_flags
for {set p 0} {$p < [llength $pbtype_flags]} {incr p} {
diff --git a/testsuite/systemtap.base/sdt_misc.exp b/testsuite/systemtap.base/sdt_misc.exp
index 062181a5..8a0cdea2 100644
--- a/testsuite/systemtap.base/sdt_misc.exp
+++ b/testsuite/systemtap.base/sdt_misc.exp
@@ -136,8 +136,8 @@ if {[installtest_p]} {
set sdtdir $srcdir/../includes
}
-set pbtype_flags {{""} {additional_flags=-O additional_flags=-DEXPERIMENTAL_UTRACE_SDT} {additional_flags=-O additional_flags=-DEXPERIMENTAL_KPROBE_SDT}}
-set pbtype_mssgs {{uprobe} {utrace} {kprobe}}
+set pbtype_flags {{""} {additional_flags=-O additional_flags=-DEXPERIMENTAL_KPROBE_SDT}}
+set pbtype_mssgs {{uprobe} {kprobe}}
# Iterate pbtype_flags
for {set i 0} {$i < [llength $pbtype_flags]} {incr i} {