diff options
author | fche <fche> | 2005-05-21 01:35:34 +0000 |
---|---|---|
committer | fche <fche> | 2005-05-21 01:35:34 +0000 |
commit | 2b066ec1b8801b08052a68282ce34ef9c425ae8f (patch) | |
tree | d0b8aadc2521e2fbf1adde2d330bd7a941587087 /testsuite/semok/seven.stp | |
parent | a199030a268b007580b57a83b511f97bbb65996f (diff) | |
download | systemtap-steved-2b066ec1b8801b08052a68282ce34ef9c425ae8f.tar.gz systemtap-steved-2b066ec1b8801b08052a68282ce34ef9c425ae8f.tar.xz systemtap-steved-2b066ec1b8801b08052a68282ce34ef9c425ae8f.zip |
* at long last, a more full-bodied snapshot
2005-05-20 Frank Ch. Eigler <fche@redhat.com>
Many changes throughout. Partial sketch of translation output.
* elaborate.*: Elaboration pass.
* translate.*: Translation pass.
* staptree.*: Simplified for visitor concept.
* main.cxx: Translator mainline.
* *test.cxx: Removed.
* testsuite/*: Some new tests, some changed for newer syntax.
Diffstat (limited to 'testsuite/semok/seven.stp')
-rwxr-xr-x | testsuite/semok/seven.stp | 27 |
1 files changed, 27 insertions, 0 deletions
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]) +} |