]> sourceware.org Git - systemtap.git/commitdiff
PR10299 groundwork: tests to check old and new behaviour.
authorSerguei Makarov <smakarov@redhat.com>
Wed, 13 Jun 2012 14:33:17 +0000 (10:33 -0400)
committerSerguei Makarov <smakarov@redhat.com>
Wed, 13 Jun 2012 14:33:17 +0000 (10:33 -0400)
testsuite/buildok/newlocals01.stp [new file with mode: 0755]
testsuite/buildok/oldlocals01.stp [new file with mode: 0755]

diff --git a/testsuite/buildok/newlocals01.stp b/testsuite/buildok/newlocals01.stp
new file mode 100755 (executable)
index 0000000..07096d1
--- /dev/null
@@ -0,0 +1,14 @@
+#! stap -gp4
+
+# test accessing locals using STAP_ARG_* macros
+function baz:long(foo:long, bar:string)
+%{
+        printk("%s\n", STAP_ARG_bar);
+        STAP_RETVALUE = 600 + STAP_ARG_foo;
+%}
+
+probe begin {
+   q = baz(9001, "I'm in your dmesg making stupid jokes")
+   printf("%d\n", q)
+   exit()
+}
diff --git a/testsuite/buildok/oldlocals01.stp b/testsuite/buildok/oldlocals01.stp
new file mode 100755 (executable)
index 0000000..2b0fee1
--- /dev/null
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+stap -g -p4 --compatible=1.7.9 -e '
+# test accessing locals using THIS->foo in legacy mode
+function baz:long(foo:long, bar:string)
+%{
+        printk("%s\n", THIS->bar);
+        THIS->__retvalue = 600 + THIS->foo;
+%}
+
+probe begin {
+   q = baz(9001, "I am in your dmesg making stupid jokes")
+   printf("%d\n", q)
+   exit()
+}
+'
This page took 0.030174 seconds and 5 git commands to generate.