diff options
Diffstat (limited to 'testsuite')
30 files changed, 115 insertions, 29 deletions
diff --git a/testsuite/parseko/five.stp b/testsuite/parseko/five.stp index 1673a1e6..a80b6734 100755 --- a/testsuite/parseko/five.stp +++ b/testsuite/parseko/five.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p1 probe foo( { } diff --git a/testsuite/parseko/four.stp b/testsuite/parseko/four.stp index ad77239b..7bfccd02 100755 --- a/testsuite/parseko/four.stp +++ b/testsuite/parseko/four.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p1 probe foo { somethingawful->foo = 1; diff --git a/testsuite/parseko/one.stp b/testsuite/parseko/one.stp index 149f602e..0388a7e6 100755 --- a/testsuite/parseko/one.stp +++ b/testsuite/parseko/one.stp @@ -1,2 +1,2 @@ -#! parsetest +#! stap -p1 "not a probe" diff --git a/testsuite/parseko/six.stp b/testsuite/parseko/six.stp index 2e8c8dbe..f37cd034 100755 --- a/testsuite/parseko/six.stp +++ b/testsuite/parseko/six.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p1 probe foo { a = -9999999999999999999999999; diff --git a/testsuite/parseko/three.stp b/testsuite/parseko/three.stp index 4db7dd3f..be810e9d 100755 --- a/testsuite/parseko/three.stp +++ b/testsuite/parseko/three.stp @@ -1,5 +1,7 @@ -#! semtest +#! stap -p1 probe foo { - 1 + 2 = 3; # bad lvalue + a(1) +# need ; + b(2) } diff --git a/testsuite/parseko/two.stp b/testsuite/parseko/two.stp index e17024ff..74633df4 100755 --- a/testsuite/parseko/two.stp +++ b/testsuite/parseko/two.stp @@ -1,4 +1,4 @@ -#! parsetest +#! stap -p1 probe foo { a + } diff --git a/testsuite/parseok/five.stp b/testsuite/parseok/five.stp index a475807e..b7690943 100755 --- a/testsuite/parseok/five.stp +++ b/testsuite/parseok/five.stp @@ -1,4 +1,4 @@ -#! parsetest +#! stap -p1 probe lkst("process_contextswitch") {} probe syscall("name").return {} diff --git a/testsuite/parseok/four.stp b/testsuite/parseok/four.stp index d381b242..39c9ebd4 100755 --- a/testsuite/parseok/four.stp +++ b/testsuite/parseok/four.stp @@ -1,4 +1,4 @@ -#! parsetest +#! stap -p1 probe syscall ("foo").foo.bar , syscall ("bar"), syscall ("*").return { diff --git a/testsuite/parseok/one.stp b/testsuite/parseok/one.stp index 5b69767d..dab3b394 100755 --- a/testsuite/parseok/one.stp +++ b/testsuite/parseok/one.stp @@ -1,3 +1,3 @@ -#! parsetest +#! stap -p1 # test function k () { } diff --git a/testsuite/parseok/seven.stp b/testsuite/parseok/seven.stp new file mode 100755 index 00000000..8f692958 --- /dev/null +++ b/testsuite/parseok/seven.stp @@ -0,0 +1,26 @@ +#! stap -p1 + +probe one { if (1) {} } +probe two { if (2) {;} } +probe three { if (3) ; } +probe four { if (4) {} else ; } +probe five { if (5) ; else {} } +probe six { if (6) {} else {;} } +probe seven { ; } +probe eight { {} } +probe nine { {;} } +probe ten { a=1; } + +probe all +{ + if (1) {} ; + if (2) {;} ; + if (3) ; ; + if (4) {} else ; ; + if (5) ; else {} ; + if (6) {} else {;} ; + ; ; + {} ; + {;} ; + a=1 +} diff --git a/testsuite/parseok/six.stp b/testsuite/parseok/six.stp index 6fb9b764..bc16a336 100755 --- a/testsuite/parseok/six.stp +++ b/testsuite/parseok/six.stp @@ -1,4 +1,4 @@ -#! parsetest +#! stap -p1 probe one { diff --git a/testsuite/parseok/three.stp b/testsuite/parseok/three.stp index d2401877..1b31f6d8 100755 --- a/testsuite/parseok/three.stp +++ b/testsuite/parseok/three.stp @@ -1,4 +1,4 @@ -#! parsetest +#! stap -p1 probe syscall ("foo") { diff --git a/testsuite/parseok/two.stp b/testsuite/parseok/two.stp index fdcf335e..d18dd3e3 100755 --- a/testsuite/parseok/two.stp +++ b/testsuite/parseok/two.stp @@ -1,4 +1,4 @@ -#! parsetest +#! stap -p1 probe syscall (231) { diff --git a/testsuite/provok/one.stp b/testsuite/provok/one.stp new file mode 100755 index 00000000..e51ee28a --- /dev/null +++ b/testsuite/provok/one.stp @@ -0,0 +1,26 @@ +#! stap + +global ar1, ar2 + +function string (v) { return "" } # to become built-in + +function search (key) +{ + if (key in ar1) + { ar1[key] ++; return ar2[ar1[key]] } + else + return "no can do" +} + +probe syscall("zamboni") +{ + thread->ar2 = $tgid; + search ($pid) +} + +probe end +{ + for (key in ar2) + # if (key in ar2) + printk ("this: " . string (key) . " was " . string (ar2[key])) +} diff --git a/testsuite/semko/eight.stp b/testsuite/semko/eight.stp index 1bcb344a..7d297295 100755 --- a/testsuite/semko/eight.stp +++ b/testsuite/semko/eight.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p2 probe foo { stats << "string" # stats only collect numbers diff --git a/testsuite/semko/five.stp b/testsuite/semko/five.stp index 6887fced..ddbbdca5 100755 --- a/testsuite/semko/five.stp +++ b/testsuite/semko/five.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p2 function bar () { diff --git a/testsuite/semko/four.stp b/testsuite/semko/four.stp index e73cc88d..fd2b3928 100755 --- a/testsuite/semko/four.stp +++ b/testsuite/semko/four.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p2 global a, b; # types unknown diff --git a/testsuite/semko/nine.stp b/testsuite/semko/nine.stp index 7e864671..f9a704f1 100755 --- a/testsuite/semko/nine.stp +++ b/testsuite/semko/nine.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p2 probe foo { a[4] = 1; diff --git a/testsuite/semko/one.stp b/testsuite/semko/one.stp index 7519dfc6..324dee7c 100755 --- a/testsuite/semko/one.stp +++ b/testsuite/semko/one.stp @@ -1,8 +1,8 @@ -#! semtest +#! stap -p2 function stamp (syscall) { # no return expression => unknown function type } -probe syscall (read) { stamp ("read"); } +probe syscall.read { stamp ("read"); } diff --git a/testsuite/semko/seven.stp b/testsuite/semko/seven.stp index 7d987f77..ce36762a 100755 --- a/testsuite/semko/seven.stp +++ b/testsuite/semko/seven.stp @@ -1,5 +1,6 @@ -#! semtest +#! stap -p2 +global baz probe foo { baz[1] = 4; baz["1"] = 5; # inconsistent index types diff --git a/testsuite/semko/six.stp b/testsuite/semko/six.stp index aa7d10d7..89457fac 100755 --- a/testsuite/semko/six.stp +++ b/testsuite/semko/six.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p2 probe foo { bar[1] = 2; diff --git a/testsuite/semko/three.stp b/testsuite/semko/three.stp index bfdeec66..423dbcdf 100755 --- a/testsuite/semko/three.stp +++ b/testsuite/semko/three.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p2 probe foo { a << 2; diff --git a/testsuite/semko/two.stp b/testsuite/semko/two.stp index 39b77f6a..acf0a973 100755 --- a/testsuite/semko/two.stp +++ b/testsuite/semko/two.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p2 function zoo (p) { p << 5; return 0 } # passing stats as function arg diff --git a/testsuite/semok/five.stp b/testsuite/semok/five.stp index 2bb656b1..4e229f42 100755 --- a/testsuite/semok/five.stp +++ b/testsuite/semok/five.stp @@ -1,5 +1,6 @@ -#! semtest +#! stap -p2 +global array probe foo { array[1] = array[2] = 3; diff --git a/testsuite/semok/four.stp b/testsuite/semok/four.stp index eb87f3f9..978ec557 100755 --- a/testsuite/semok/four.stp +++ b/testsuite/semok/four.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p2 # these will ultimately be somehow associated with "providers" # and have a syntax of their own diff --git a/testsuite/semok/one.stp b/testsuite/semok/one.stp index 764bd476..909d8eac 100755 --- a/testsuite/semok/one.stp +++ b/testsuite/semok/one.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p2 # these will ultimately be somehow associated with "providers" # and have a syntax of their own diff --git a/testsuite/semok/seven.stp b/testsuite/semok/seven.stp new file mode 100755 index 00000000..8351c1e2 --- /dev/null +++ b/testsuite/semok/seven.stp @@ -0,0 +1,27 @@ +#! stap -p2 + +global ar1, ar2 + +function string (v) { num=v+0; return "stringify me" } # to become a built-in +function printk (s) { str=s.""; return 0 } # to become a built-in + +function search (key) +{ + if (1) # (key in ar1) + { ar1[key] ++; return ar2[ar1[key]] } + else + return "no can do" # implies ar2[]: string +} + +probe syscall("zamboni") +{ + thread->ar2 = string ($tgid); + search ($pid) +} + +probe end +{ + # for (key in ar2) + if (1) # (key in ar2) + printk ("this: " . string (key) . " was " . ar2[key]) +} diff --git a/testsuite/semok/six.stp b/testsuite/semok/six.stp index 72b7e065..ef14827c 100755 --- a/testsuite/semok/six.stp +++ b/testsuite/semok/six.stp @@ -1,4 +1,6 @@ -#! semtest +#! stap -p2 + +global bar, baz probe foo { diff --git a/testsuite/semok/three.stp b/testsuite/semok/three.stp index 100a5f2b..41d726a0 100755 --- a/testsuite/semok/three.stp +++ b/testsuite/semok/three.stp @@ -1,5 +1,6 @@ -#! semtest +#! stap -p2 +global b probe foo { a <<< 2; b[4] <<< 4; diff --git a/testsuite/semok/two.stp b/testsuite/semok/two.stp index 5a124474..e68d596e 100755 --- a/testsuite/semok/two.stp +++ b/testsuite/semok/two.stp @@ -1,4 +1,4 @@ -#! semtest +#! stap -p2 global bar, baz |