summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-05-14 14:35:48 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-05-14 14:35:48 -0400
commit0fe2b97c7b967d833b5588dbf1ef763bb4440ed3 (patch)
treefcce9345c9ebacb7d5bc1f510f155bfdcea08dc4 /testsuite/systemtap.base
parenta007b4068d20af2d4488d54bf3ef2edbf47f2f06 (diff)
parentc3799d720b60bd74a60de4addcd0d77a90f7842a (diff)
downloadsystemtap-steved-0fe2b97c7b967d833b5588dbf1ef763bb4440ed3.tar.gz
systemtap-steved-0fe2b97c7b967d833b5588dbf1ef763bb4440ed3.tar.xz
systemtap-steved-0fe2b97c7b967d833b5588dbf1ef763bb4440ed3.zip
Merge commit 'origin/master' into pr6429-comp-unwindsyms
* commit 'origin/master': PR 5955 - Accept ; terminated globals Factored returnval() out of returnstr(), for use in dwarfless probing. Converted more aliases to use arg numbers instead of names. In particular, Revert "PR6487: extend blacklist with relay/timer subsystem" Add syscalls_by_pid.meta, syscalls_by_proc.meta, PR6487: extend blacklist with relay/timer subsystem Adjust iotime.meta description. * iotime.meta: New. Fix for PR 6500. Update ChangeLog * sleeptime.meta, wait4time.meta: New. systemtap.examples futexes.meta change futex.stp to futexes.stp. In ioblock.stp ioblock.end set bytes_done depending on kernel version. PR6492: make listing mode warning-free PR5648: Fix unaligned access warning in stp_print_flush on ia64 PR5648: Fix memcpy's endianess issue. futexes.meta, nettop.meta, pf2.meta: New. Clean up output.
Diffstat (limited to 'testsuite/systemtap.base')
-rw-r--r--testsuite/systemtap.base/global_vars.exp5
-rw-r--r--testsuite/systemtap.base/global_vars.stp57
2 files changed, 62 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/global_vars.exp b/testsuite/systemtap.base/global_vars.exp
new file mode 100644
index 00000000..059ebf8d
--- /dev/null
+++ b/testsuite/systemtap.base/global_vars.exp
@@ -0,0 +1,5 @@
+# Check that global variables terminated with a ; work fine
+
+set test "global_vars"
+
+stap_run $srcdir/$subdir/$test.stp no_load $all_pass_string
diff --git a/testsuite/systemtap.base/global_vars.stp b/testsuite/systemtap.base/global_vars.stp
new file mode 100644
index 00000000..737e2556
--- /dev/null
+++ b/testsuite/systemtap.base/global_vars.stp
@@ -0,0 +1,57 @@
+/*
+ * global_vars.stp
+ *
+ * Check that global variables with a ; termination work fine
+ */
+
+probe begin { println("systemtap starting probe") }
+probe end { println("systemtap ending probe") }
+
+global a;
+global c, d;
+global g = 42;
+global e[1], f;
+global gstr = "foobar";
+
+global gstr_saved;
+probe begin(-9223372036854775808) {
+ c = g
+ d = c + g
+ a = d
+ f = c
+ e[0] = "a";
+ gstr_saved = gstr
+}
+
+probe end {
+ if (c == 42)
+ println("systemtap test success")
+ else
+ printf("systemtap test failure - c:%d != 42\n", c)
+
+ if (d == (c + g))
+ println("systemtap test success")
+ else
+ printf("systemtap test failure - d:%d != %d\n", d, (c+g))
+
+ if (a == d)
+ println("systemtap test success")
+ else
+ printf("systemtap test failure - a:%d != %d\n", a, d)
+
+ if (f == c)
+ println("systemtap test success")
+ else
+ printf("systemtap test failure - f:%d != %d\n", f, c)
+
+ if (e[0] == "a")
+ println("systemtap test success")
+ else
+ printf("systemtap test failure - e:%s != a\n", e[0])
+
+ if (gstr_saved == "foobar")
+ println("systemtap test success")
+ else
+ printf("systemtap test failure - gstr_saved:%s != foobar\n", gstr_saved)
+}
+