summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/parseko/one.stp2
-rwxr-xr-xtestsuite/parseko/two.stp2
-rwxr-xr-xtestsuite/parseok/one.stp3
-rwxr-xr-xtestsuite/parseok/two.stp9
-rwxr-xr-xtestsuite/semko/four.stp12
-rwxr-xr-xtestsuite/semko/one.stp8
-rwxr-xr-xtestsuite/semko/three.stp6
-rwxr-xr-xtestsuite/semko/two.stp8
-rwxr-xr-xtestsuite/semok/four.stp23
-rwxr-xr-xtestsuite/semok/one.stp25
-rwxr-xr-xtestsuite/semok/three.stp6
-rwxr-xr-xtestsuite/semok/two.stp13
12 files changed, 112 insertions, 5 deletions
diff --git a/testsuite/parseko/one.stp b/testsuite/parseko/one.stp
index f288e930..149f602e 100755
--- a/testsuite/parseko/one.stp
+++ b/testsuite/parseko/one.stp
@@ -1,2 +1,2 @@
-#! stap
+#! parsetest
"not a probe"
diff --git a/testsuite/parseko/two.stp b/testsuite/parseko/two.stp
index 64a24afe..e17024ff 100755
--- a/testsuite/parseko/two.stp
+++ b/testsuite/parseko/two.stp
@@ -1,4 +1,4 @@
-#! stap
+#! parsetest
probe foo {
a +
}
diff --git a/testsuite/parseok/one.stp b/testsuite/parseok/one.stp
index b3ca32b2..5b69767d 100755
--- a/testsuite/parseok/one.stp
+++ b/testsuite/parseok/one.stp
@@ -1,2 +1,3 @@
-#! stap
+#! parsetest
# test
+function k () { }
diff --git a/testsuite/parseok/two.stp b/testsuite/parseok/two.stp
index 3776633b..6ab3823e 100755
--- a/testsuite/parseok/two.stp
+++ b/testsuite/parseok/two.stp
@@ -1,4 +1,4 @@
-#! stap
+#! parsetest
probe kernel:systemcall("foo")
{
@@ -6,7 +6,12 @@ probe kernel:systemcall("foo")
if (global > 5) { global -- } else ;
}
+function foo () {
+ delete array[4];
+ return 0;
+}
+
probe systemtap:end
{
- function("value", 4+8);
+ foo ("value", 4+8);
}
diff --git a/testsuite/semko/four.stp b/testsuite/semko/four.stp
new file mode 100755
index 00000000..e73cc88d
--- /dev/null
+++ b/testsuite/semko/four.stp
@@ -0,0 +1,12 @@
+#! semtest
+
+global a, b; # types unknown
+
+function bar ()
+{
+ # no return statement
+}
+
+probe foo {
+ a = b;
+}
diff --git a/testsuite/semko/one.stp b/testsuite/semko/one.stp
new file mode 100755
index 00000000..994bb451
--- /dev/null
+++ b/testsuite/semko/one.stp
@@ -0,0 +1,8 @@
+#! semtest
+
+function stamp (syscall)
+{
+ # no return expression => unknown function type
+}
+
+probe kernel:syscall:read { stamp ("read"); }
diff --git a/testsuite/semko/three.stp b/testsuite/semko/three.stp
new file mode 100755
index 00000000..bfdeec66
--- /dev/null
+++ b/testsuite/semko/three.stp
@@ -0,0 +1,6 @@
+#! semtest
+
+probe foo {
+ a << 2;
+ b[a] = 4; # must not index with stats variable
+}
diff --git a/testsuite/semko/two.stp b/testsuite/semko/two.stp
new file mode 100755
index 00000000..39b77f6a
--- /dev/null
+++ b/testsuite/semko/two.stp
@@ -0,0 +1,8 @@
+#! semtest
+
+function zoo (p) { p << 5; return 0 } # passing stats as function arg
+
+probe foo {
+ bar = 2 + "string"; # mixing integer+string arithmetic
+ zoo (car)
+}
diff --git a/testsuite/semok/four.stp b/testsuite/semok/four.stp
new file mode 100755
index 00000000..e11b644a
--- /dev/null
+++ b/testsuite/semok/four.stp
@@ -0,0 +1,23 @@
+#! semtest
+
+# these will ultimately be somehow associated with "providers"
+# and have a syntax of their own
+global kernel_jiffies, kernel_current_comm;
+
+function kernel_netlink(a, b) {
+ # this should be a builtin function
+ return 0
+}
+
+function stamp (syscall)
+{
+ return kernel_netlink (4, kernel_jiffies . " " . kernel_current_comm . " " . syscall)
+}
+
+# probe kernel:syscall:read = kernel:function("sys_read");
+
+
+probe kernel:syscall:read
+{
+ stamp ("read");
+}
diff --git a/testsuite/semok/one.stp b/testsuite/semok/one.stp
new file mode 100755
index 00000000..fb7483e2
--- /dev/null
+++ b/testsuite/semok/one.stp
@@ -0,0 +1,25 @@
+#! semtest
+
+# these will ultimately be somehow associated with "providers"
+# and have a syntax of their own
+global kernel_jiffies, kernel_current_comm;
+
+function kernel_netlink(a, b) {
+ # this should be a builtin function
+ return 0
+}
+
+function stamp (syscall)
+{
+ kernel_netlink (4, kernel_jiffies . " " .
+ kernel_current_comm . " " . syscall);
+ return 0
+}
+
+# probe kernel:syscall:read = kernel:function("sys_read");
+
+
+probe kernel:syscall:read
+{
+ stamp ("read");
+}
diff --git a/testsuite/semok/three.stp b/testsuite/semok/three.stp
new file mode 100755
index 00000000..6ae531a2
--- /dev/null
+++ b/testsuite/semok/three.stp
@@ -0,0 +1,6 @@
+#! semtest
+
+probe foo {
+ a << 2;
+ b[4] << 4;
+}
diff --git a/testsuite/semok/two.stp b/testsuite/semok/two.stp
new file mode 100755
index 00000000..f3c6046e
--- /dev/null
+++ b/testsuite/semok/two.stp
@@ -0,0 +1,13 @@
+#! semtest
+
+global bar, baz;
+
+function koo (p) {
+ baz [p, "p", p] ++;
+ return p + 2;
+}
+
+probe foo {
+ bar = 2 + koo (4);
+ foo = bar + koo;
+}