summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/vars.exp
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2008-08-08 15:15:19 -0400
committerDave Brolley <brolley@redhat.com>2008-08-08 15:15:19 -0400
commit71906647386a9684086b0542318b536d95ae089c (patch)
treefb0348d7bb34095e95ad830da8e832bad9187a55 /testsuite/systemtap.base/vars.exp
parentd5658775da9fa0ac792eb3f874df9f7c4d60de7e (diff)
parentf1118e1032612170cae8cd979cd529722ad95fdb (diff)
downloadsystemtap-steved-71906647386a9684086b0542318b536d95ae089c.tar.gz
systemtap-steved-71906647386a9684086b0542318b536d95ae089c.tar.xz
systemtap-steved-71906647386a9684086b0542318b536d95ae089c.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Conflicts: ChangeLog testsuite/ChangeLog
Diffstat (limited to 'testsuite/systemtap.base/vars.exp')
-rw-r--r--testsuite/systemtap.base/vars.exp32
1 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/vars.exp b/testsuite/systemtap.base/vars.exp
new file mode 100644
index 00000000..7541c01b
--- /dev/null
+++ b/testsuite/systemtap.base/vars.exp
@@ -0,0 +1,32 @@
+# Script for testing $$vars, $$parms, $$locals
+
+set test "vars"
+
+# grab C statement that $$vars yields
+set cmd [concat stap -p3 -e {"probe kernel.statement(\"bio_copy_user@fs/bio.c+1\") \{print (\$\$vars)\}"} 2>&1 | grep {"printf.*="} | sed -e {"s/^.*MAXSTRINGLEN, \"//"} -e {s/..\".*$//}]
+catch {eval exec $cmd} vars
+
+# grab C statement that $$parms yields
+set cmd [regsub "vars" $cmd "parms"]
+catch {eval exec $cmd} parms
+
+# grab C statement that $$locals yields
+set cmd [regsub "parms" $cmd "locals"]
+catch {eval exec $cmd} locals
+
+# syntax check of $$vars C statement
+set vars_ok [regexp "(\[a-z_\]+=%#llx *)+" $vars]
+if {!$vars_ok} {
+ fail "$test"
+} else {
+ pass "$test"
+}
+
+# $$vars should be equivalent to $$parms + $$locals
+if {![string equal [string trim $vars] \
+ [string trim [concat $parms " " $locals]]]} {
+ fail "$test parms/locals"
+} else {
+ pass "$test parms/locals"
+}
+