summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-08-28 14:44:06 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-08-28 14:44:06 -0400
commit30f926f0b0a198dd416ea735353e852a7ee79d69 (patch)
tree7c924e8de6a9a38ee904d9793f0bafffc00b8d85 /testsuite/systemtap.base
parentfb84c077272764f8cb000e9b02572fb7c9cac24f (diff)
parent84f00e279d98edba986225386c7183db3c5968b0 (diff)
downloadsystemtap-steved-30f926f0b0a198dd416ea735353e852a7ee79d69.tar.gz
systemtap-steved-30f926f0b0a198dd416ea735353e852a7ee79d69.tar.xz
systemtap-steved-30f926f0b0a198dd416ea735353e852a7ee79d69.zip
Merge commit 'origin/master' into pr4225
* commit 'origin/master': PR5686: correct regression in semok/optimize.stp trailing whitespace removal, as approved by emacs fix global-var array index rendering fix NEWS to refer to simpler context.stp tapset functions in auto-printing blurb Document written but unread global variable automatic display. 2nd try initial Make _get_sock_addr return correct address in kernel before 2.6.16. Automatically print written but unread globals Make nodwf test passed when CONFIG_QUOTACTL unset Uses STAPCONF_DPATH_PATH instead of a kernel version check. Simplified "rpm" target a bit. Moved tar archive creation step from "rpm" target to "dist-gzip" target. remove support for "make dist" since git-archive does as well; Examples html files moved into subdir. 2008-08-25 David Smith <dsmith@redhat.com> ChangeLog Entries Robustness improvements for the stap client/server
Diffstat (limited to 'testsuite/systemtap.base')
-rw-r--r--testsuite/systemtap.base/bench.exp2
-rw-r--r--testsuite/systemtap.base/global_end.exp23
-rw-r--r--testsuite/systemtap.base/global_end.stp30
-rw-r--r--testsuite/systemtap.base/optim_arridx.exp40
-rw-r--r--testsuite/systemtap.base/optim_arridx.stp6
-rw-r--r--testsuite/systemtap.base/warnings.exp1
6 files changed, 89 insertions, 13 deletions
diff --git a/testsuite/systemtap.base/bench.exp b/testsuite/systemtap.base/bench.exp
index 4863a00c..72864292 100644
--- a/testsuite/systemtap.base/bench.exp
+++ b/testsuite/systemtap.base/bench.exp
@@ -11,4 +11,4 @@ expect {
eof { }
}
wait
-if {$ok == 15} { pass "$test ($ok)" } { fail "$test ($ok)" }
+if {$ok == 18} { pass "$test ($ok)" } { fail "$test ($ok)" }
diff --git a/testsuite/systemtap.base/global_end.exp b/testsuite/systemtap.base/global_end.exp
new file mode 100644
index 00000000..08cf0dea
--- /dev/null
+++ b/testsuite/systemtap.base/global_end.exp
@@ -0,0 +1,23 @@
+# test end probe creation and display of written and unread global variables
+
+set test "global_end"
+
+if {![installtest_p]} {untested $test; return}
+
+spawn stap $srcdir/$subdir/global_end.stp
+set ok 0
+expect {
+ -timeout 180
+ -re {one,0x1.*one,0x2.*two,0x1.*two,0x2} { incr ok; exp_continue }
+ -re {alpha."one".1.=0x1} { incr ok; exp_continue }
+ -re {alpha."one".2.=0x2} { incr ok; exp_continue }
+ -re {alpha."two".1.=0x3} { incr ok; exp_continue }
+ -re {alpha."two".2.=0x4} { incr ok; exp_continue }
+ -re {gamma="abcdefghijklmnopqrstuvwxyz"} { incr ok; exp_continue }
+ -re {iota."one".="eleven"} { incr ok; exp_continue }
+ -re {iota."two".="twelve"} { incr ok; exp_continue }
+ timeout { fail "$test (timeout)" }
+ eof { }
+}
+wait
+if {$ok == 8} { pass "$test ($ok)" } { fail "$test ($ok)" }
diff --git a/testsuite/systemtap.base/global_end.stp b/testsuite/systemtap.base/global_end.stp
new file mode 100644
index 00000000..e9a1eb8f
--- /dev/null
+++ b/testsuite/systemtap.base/global_end.stp
@@ -0,0 +1,30 @@
+global alpha, beta, gamma, iota
+
+probe begin {
+ gamma = "abcdefghijklmnopqrstuvwxyz"
+
+ iota["one"] = "eleven"
+ iota["two"] = "twelve"
+
+ alpha["one",1] = 1
+ alpha["one",2] = 2
+ alpha["two",1] = 3
+ alpha["two",2] = 4
+
+ beta["one",1] = 1
+ beta["one",2] = 2
+ beta["two",1] = 3
+ beta["two",2] = 4
+}
+
+probe timer.ms(2000) {
+ exit ()
+}
+
+probe end {
+foreach ([i,j] in beta)
+ printf("[%#s,%#x]=%#x ", i, j, beta[i,j])
+print("\n")
+exit()
+}
+
diff --git a/testsuite/systemtap.base/optim_arridx.exp b/testsuite/systemtap.base/optim_arridx.exp
index f4308db5..89282d1b 100644
--- a/testsuite/systemtap.base/optim_arridx.exp
+++ b/testsuite/systemtap.base/optim_arridx.exp
@@ -5,11 +5,14 @@ set ::result_string {# globals
arr1:long [long, long]
arr2:long [long]
arr3:long [long]
+elide_idx1:long
+elide_global_a:long
+elide_global_b:long
# functions
fna:long (a:long)
return a
fnb:long (a:long, b:long)
-return ((a) + (b)) + (printf(""))
+return (a) + (b)
exit:unknown ()
%{
atomic_set (&session_state, STAP_SESSION_STOPPING);
@@ -23,33 +26,52 @@ begin /* <- begin */
k:long
b:long
m:long
- arr1:long [long]
- arr2:long [long, long]
aa:long
bb:long
cc:long
dd:long
ee:long
{
+(arr2[(elide_idx1) = (1)]) = (10)
(arr2[(idx2) = (2)]) = (20)
+(arr2[3]) = (30)
(arr2[(j) = (4)]) = (40)
(arr1[fna((k) = (0)), k]) = (1)
(arr1[(b) = (1), b]) = (2)
-fnb((arr3[0]) = (4), arr3[0])
+(arr1[2, 2]) = (3)
+(arr3[0]) = (4)
(m) = (1)
-for (2; (m) <= (10); (m)++) ;
-printf("%d %d %d %d\\n", arr1[0], arr2[0, 0], idx2, j)
+for (2; (m) <= (10); (m)++) (arr2[m]) = ((m) * (10))
+printf("%d %d %d %d\\n", arr1[0, 0], arr2[0], idx2, j)
(aa) = (fna(1))
-(bb) = (fnb((cc) = (1), 2))
+(bb) = (fnb((cc) = (1), (elide_global_a) = (2)))
for (1; (bb) < (10); (bb)++) (cc) += (bb)
for ((dd) = (1); (dd) < (10); 1) (dd) += (1)
-if (1) (ee) = (1)
+if ((elide_global_b) = (1)) (ee) = (1)
(cc) = ((dd) = (5))
(cc) = ((4) + ((cc) = (1)))
-printf("%d %d %d %d %d", aa, bb, cc, dd, ee)
+printf("%d %d %d %d %d\\n", aa, bb, cc, dd, ee)
exit()
}
+end /* <- end */
+ # locals
+ idx0:long
+{
+foreach ([idx0] in arr3) printf("arr3[%#d]=%#x\\n", idx0, arr3[idx0])
+}
+end /* <- end */
+{
+printf("elide_idx1=%#x\\n", elide_idx1)
+}
+end /* <- end */
+{
+printf("elide_global_a=%#x\\n", elide_global_a)
+}
+end /* <- end */
+{
+printf("elide_global_b=%#x\\n", elide_global_b)
+}
}
proc optim_arridx_run { TEST_NAME args } {
diff --git a/testsuite/systemtap.base/optim_arridx.stp b/testsuite/systemtap.base/optim_arridx.stp
index 3e4f8fd2..5c9c1051 100644
--- a/testsuite/systemtap.base/optim_arridx.stp
+++ b/testsuite/systemtap.base/optim_arridx.stp
@@ -1,7 +1,7 @@
global arr1, arr2, arr3, elide_idx1, elide_global_a, elide_global_b
function fna(a:long) {return a}
-function fnb(a:long, b:long) {return a+b+printf("")}
+function fnb(a:long, b:long) {return a+b}
probe begin {
// array indices
@@ -16,7 +16,7 @@ probe begin {
m = 1
for (elide_n=2; m <= 10; m++)
arr2[m] = m * 10
- printf ("%d %d %d %d\n", arr1[0], arr2[0,0], idx2, j)
+ printf ("%d %d %d %d\n", arr1[0,0], arr2[0], idx2, j)
// function args
aa = fna(elide_aa = 1)
@@ -40,6 +40,6 @@ probe begin {
// binary expression
cc = ((elide_hh = 4) + (cc = 1))
- printf("%d %d %d %d %d", aa, bb, cc, dd, ee)
+ printf("%d %d %d %d %d\n", aa, bb, cc, dd, ee)
exit ()
}
diff --git a/testsuite/systemtap.base/warnings.exp b/testsuite/systemtap.base/warnings.exp
index b56d7a98..a90860d9 100644
--- a/testsuite/systemtap.base/warnings.exp
+++ b/testsuite/systemtap.base/warnings.exp
@@ -3,6 +3,7 @@ set test "warnings"
spawn stap -p4 $srcdir/$subdir/warnings.stp
set ok 0
expect {
+ -timeout 30
-re {^WARNING:[^\r\n]*\r\n} { incr ok; exp_continue }
-re {^[^\r\n]*.ko\r\n} { incr ok; exp_continue }
timeout { fail "$test (timeout)" }