From 25b24f3675cc75b3740955f9f1098b5c12733a4b Mon Sep 17 00:00:00 2001 From: Serguei Makarov Date: Wed, 13 Jun 2012 10:33:17 -0400 Subject: [PATCH] PR10299 groundwork: tests to check old and new behaviour. --- testsuite/buildok/newlocals01.stp | 14 ++++++++++++++ testsuite/buildok/oldlocals01.stp | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 testsuite/buildok/newlocals01.stp create mode 100755 testsuite/buildok/oldlocals01.stp diff --git a/testsuite/buildok/newlocals01.stp b/testsuite/buildok/newlocals01.stp new file mode 100755 index 000000000..07096d16e --- /dev/null +++ b/testsuite/buildok/newlocals01.stp @@ -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 index 000000000..2b0fee17c --- /dev/null +++ b/testsuite/buildok/oldlocals01.stp @@ -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() +} +' -- 2.43.5