From d950d08e6f21c19fa63a4435fd7071fe02c66745 Mon Sep 17 00:00:00 2001 From: jistone Date: Fri, 22 Dec 2006 22:18:02 +0000 Subject: 2006-12-22 Josh Stone * stap.1.in: Document how to specify the size of global arrays. testsuite/ * buildok/array_size.stp, parseko/array01.stp, parseko/array02.stp, parseko/array03.stp, parseko/array04.stp, transko/array01.stp, systemtap.base/array_size.exp, systemtap.base/array_size.stp: Tests for specifying the size of global arrays. --- testsuite/systemtap.base/array_size.stp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 testsuite/systemtap.base/array_size.stp (limited to 'testsuite/systemtap.base/array_size.stp') diff --git a/testsuite/systemtap.base/array_size.stp b/testsuite/systemtap.base/array_size.stp new file mode 100644 index 00000000..cf597a61 --- /dev/null +++ b/testsuite/systemtap.base/array_size.stp @@ -0,0 +1,30 @@ +/* + * array_size.stp + * + * Check that specifying an array size gives more room than MAXMAPENTRIES + * + * Call with MAXMAPENTRIES << 100 + */ + +probe begin { log("systemtap starting probe") } +probe end { log("systemtap ending probe") } + +global a[100] + +probe begin { + for (i=42; i<142; ++i) + a[i] = i*i +} + +probe end(1) { + for (i=42; i<142; ++i) { + if (a[i] == i*i) + ++ok + else + ++bad + } + if (ok == 100 && bad == 0) + log("systemtap test success") + else + printf("systemtap test failure - ok:%d, bad:%d\n", ok, bad) +} -- cgit