summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.apps/stap-tcl.stp
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2009-10-31 13:54:41 -0400
committerFrank Ch. Eigler <fche@elastic.org>2009-10-31 13:58:38 -0400
commit2c279bc4231e44dba80e5fdb10aa1626e412eab3 (patch)
treec931b7a898830dea6684b091e9f2c2c9585d241c /testsuite/systemtap.apps/stap-tcl.stp
parent5b8642a208b614769f934c6a4ce2991658025a57 (diff)
downloadsystemtap-steved-2c279bc4231e44dba80e5fdb10aa1626e412eab3.tar.gz
systemtap-steved-2c279bc4231e44dba80e5fdb10aa1626e412eab3.tar.xz
systemtap-steved-2c279bc4231e44dba80e5fdb10aa1626e412eab3.zip
reorganize app tests; rewrite tcl as sample of improvements
* testsuite/configure.ac (--enable-testapps): New option. * testsuite/Makefile.am (TESTAPPS): Pass to dejagnu. * testsuite/systemtap.base/{xulrunner,tcl,mysql,postgres}: Moved under new systemtap.apps/ subdirectory. * testsuite/systemtap.apps/stap-tcl.sh: New file to build tcl. * testsuite/systemtap.apps/stap-tcl.stp: New file to test tcl. * testsuite/systemtap.apps/tcl.exp: New simplified test driver. * dtrace.in: Disable STAP_HAS_SEMAPHORES as they don't work on shlibs yet. * includes/sys/sdt.h (STAP_SEMAPHORE): Include __builtin_expect for unlikely.
Diffstat (limited to 'testsuite/systemtap.apps/stap-tcl.stp')
-rw-r--r--testsuite/systemtap.apps/stap-tcl.stp30
1 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/systemtap.apps/stap-tcl.stp b/testsuite/systemtap.apps/stap-tcl.stp
new file mode 100644
index 00000000..d3293b09
--- /dev/null
+++ b/testsuite/systemtap.apps/stap-tcl.stp
@@ -0,0 +1,30 @@
+global counts
+
+probe process(@1).mark("*") {
+ counts[$$name]<<<1 # PR10878; check also $$parms length
+}
+
+function judge(name, minvalue) {
+ value = @count(counts[name])
+ printf("%s %s %d %d\n", ((value>=minvalue)?"OK":"KO"), name, value, minvalue)
+}
+
+probe end,error {
+ /* foreach (name in counts-) {
+ printf("== %s %d\n", name, @count(counts[name]))
+ } */
+ judge("proc__entry", 9000)
+ judge("proc__return", 9000)
+ judge("proc__result", 9000)
+ judge("proc__args", 9000)
+ judge("proc__info", 9000)
+ judge("cmd__entry", 37000)
+ judge("cmd__return", 37000)
+ judge("cmd__result", 37000)
+ judge("cmd__args", 3700 /* not 37000? */)
+ judge("cmd__info", 37000)
+ judge("inst__start", 542000)
+ judge("inst__done", 542000)
+ judge("obj__create", 723000)
+ judge("obj__free", 704000)
+}