From 54dfabe9e604ec06cdb5550f58420c60d0cbdbd9 Mon Sep 17 00:00:00 2001 From: fche Date: Tue, 26 Jul 2005 22:40:14 +0000 Subject: 2005-07-26 Frank Ch. Eigler Support %{ embedded-c %} * staptree.h (embeddedcode): New statement subtype. Stub support in visitors. * staptree.cxx: Ditto. * parse.cxx: Parse %{ / %}. Accept "_" as identifier leading char. (parse_probe): Simplify calling convention. * elaborate.h: Store embedded code. * elaborate.cxx: Pass it. * translate.cxx: Transcribe it. Return some dropped module init/exit code. * Makefile.am: Add buildok/buildko tests. * Makefile.in: Regenerated. * main.cxx: Return EXIT_SUCCESS/FAILURE even for weird rc. * testsuite/parseok/nine.stp: Test _identifiers. * testsuite/transko/*.stp: Tweak to force -p3 rather than -p2 errors. * testsuite/semok/transko.stp: ... and keep it that way in the future. * testsuite/parse*/*: Some new tests for %{ %}. * testsuite/build*/*: New tests for -p4. --- testsuite/buildok/one.stp | 16 ++++++++++++++++ testsuite/buildok/two.stp | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100755 testsuite/buildok/one.stp create mode 100755 testsuite/buildok/two.stp (limited to 'testsuite/buildok') diff --git a/testsuite/buildok/one.stp b/testsuite/buildok/one.stp new file mode 100755 index 00000000..1f4f8f9b --- /dev/null +++ b/testsuite/buildok/one.stp @@ -0,0 +1,16 @@ +#! stap -p4 + +global foo, bar + +probe begin +{ + x = 10 + foo["hello"] = 25 + foo["hello"]++ + ++foo["hello"] + x = foo["hello"] + foo["yo"] *= bar[x, foo["hello"], "goodbye"]++; + printk("hello from systemtap") +} + + diff --git a/testsuite/buildok/two.stp b/testsuite/buildok/two.stp new file mode 100755 index 00000000..83a4705c --- /dev/null +++ b/testsuite/buildok/two.stp @@ -0,0 +1,16 @@ +#! stap -p4 + +%{ +#include +%} + +function get_release () %{ +strncpy(THIS->__retvalue, UTS_RELEASE, MAXSTRINGLEN); +%} + +probe begin +{ + printk("hello from systemtap, kernel version " . get_release()) +} + + -- cgit