diff options
author | Dave Brolley <brolley@redhat.com> | 2009-11-03 16:22:36 -0500 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-11-03 16:22:36 -0500 |
commit | 899b66209b0146560f0efc33efe58a4be3577df3 (patch) | |
tree | 7b64764b917c359a99d0adcf6c68a2d73cd52be7 /testsuite/systemtap.base/postgres.exp | |
parent | d4ad7984018ff769cbb662342be7e501632c0bea (diff) | |
parent | 89651893a8ec51ee4d77ddfd57019e350ad7b169 (diff) | |
download | systemtap-steved-899b66209b0146560f0efc33efe58a4be3577df3.tar.gz systemtap-steved-899b66209b0146560f0efc33efe58a4be3577df3.tar.xz systemtap-steved-899b66209b0146560f0efc33efe58a4be3577df3.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Conflicts:
Makefile.in
configure
doc/Makefile.in
doc/SystemTap_Tapset_Reference/Makefile.in
grapher/Makefile.in
testsuite/configure
Diffstat (limited to 'testsuite/systemtap.base/postgres.exp')
-rw-r--r-- | testsuite/systemtap.base/postgres.exp | 166 |
1 files changed, 0 insertions, 166 deletions
diff --git a/testsuite/systemtap.base/postgres.exp b/testsuite/systemtap.base/postgres.exp deleted file mode 100644 index ceef9437..00000000 --- a/testsuite/systemtap.base/postgres.exp +++ /dev/null @@ -1,166 +0,0 @@ -set test "postgres" - -# Test sdt support in postgres. - -global env - -if {! [info exists env(SYSTEMTAP_TEST_SDT)]} { - unsupported "postgres (\"SYSTEMTAP_TEST_SDT\" not in env)" - return -} - -########## Create /tmp/stap-postgres.stp ########## -set postgresbuild "[pwd]/postgresql-8.3.6/bld" -set postgresdir "[pwd]/postgresql-8.3.6/install/" -set pgdata "/tmp/stap-postgres" - - -set fp [open "$pgdata.stp" "w"] -puts $fp " -probe process(\"$postgresdir/bin/postgres\").mark(\"transaction__start\") -{ - printf(\"%s %#x\\n\", \$\$name, \$arg1); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"transaction__commit\") -{ - printf(\"%s %#x\\n\", \$\$name, \$arg1); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"transaction__abort\") -{ - printf(\"%s %#x\\n\", \$\$name, \$arg1); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"lock__startwait\") -{ - printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"lock__endwait\") -{ - printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__endwait\") -{ - printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__acquire\") -{ - printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__condacquire__fail\") -{ - printf(\"%s %#x %#x\\n\", \$\$name, - \$arg1, \$arg2); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__condacquire\") -{ - printf(\"%s %#x %#x\\n\", \$\$name, \$arg1, \$arg2); -} -probe process(\"$postgresdir/bin/postgres\").mark(\"lwlock__release\") -{ - printf(\"%s %#x\\n\", \$\$name, \$arg1); -} -" -close $fp - -########## Begin /tmp/stap-postgres.sh ########## -set fp [open "$pgdata.sh" "w"] -puts $fp " -function run_tests \{ -/bin/rm -rf $pgdata -$postgresdir/bin/initdb $pgdata - -which stap -stap -m \$(date +stapsdt_%j%k%M%N | sed 's/ //') -c \"$postgresdir/bin/postgres -D $pgdata\" $pgdata.stp >$pgdata-markers.log 2>&1 & -STAPPID=\$! - -# wait until postgres is running -for i in \$(seq 0 10) ; do - if $postgresdir/bin/pg_ctl status -D $pgdata - then break; - fi - sleep 5 -done - -(cd $postgresbuild/src/test/regress/ - make installcheck > $pgdata.log 2>&1) - -ACQUIRE=\$(grep 'lwlock__acquire 0x\[0-9\]* 0x\[0-9\]*' $pgdata-markers.log | wc -l) -RELEASE=\$(grep 'lwlock__release 0x\[0-9\]*' $pgdata-markers.log | wc -l) -START=\$(grep 'transaction__start 0x\[0-9\]*' $pgdata-markers.log | wc -l) -COMMIT=\$(grep 'transaction__commit 0x\[0-9\]*' $pgdata-markers.log | wc -l) -OKAY=\$(grep 'test .*ok' $pgdata.log | wc -l) - -echo lwlock__acquire=\$ACQUIRE lwlock__release=\$RELEASE transaction__start=\$START transaction__commit=\$COMMIT test-ok=\$OKAY -: 44873 75325 591 489 0 - -if \[ \$ACQUIRE -gt 40000 -a \$RELEASE -gt 70000 -a \$START -gt 500 -a \$COMMIT -gt 400 \] ; then - echo PASS: postgres tests \$1 -else - echo FAIL: postgres tests \$1 -fi - -if \[ \$OKAY -gt 100 \] ; then - echo PASS: postgres markers \$1 -else - echo FAIL: postgres markers \$1 -fi - -/usr/local/pgsql/bin/pg_ctl stop -D $pgdata -kill \$STAPPID -\} - -if \[ ! -r postgresql-8.3.6.tar.bz2 \] ; then -wget http://wwwmaster.postgresql.org/redir/198/h/source/v8.3.6/postgresql-8.3.6.tar.bz2 -fi - -if \[ ! -d $postgresbuild/src/backend \] ; then -tar -x -f postgresql-8.3.6.tar.bz2 -fi - -cd postgresql-8.3.6/ -mkdir bld;cd bld -../configure --enable-dtrace --prefix=$postgresdir -# sed -i -e 's/ifeq (\$(PORTNAME), solaris)/ifeq (\$(enable_dtrace), yes)/' src/backend/Makefile -sed -i -e 's/^CFLAGS = -O2.*\$/& -g -DEXPERIMENTAL_UTRACE_SDT/' src/Makefile.global -make -make install -run_tests utrace - -sed -i -e 's/UTRACE/KPROBE/' src/Makefile.global -(cd src/backend/utils/ - make clean) -make -make install -run_tests kprobe - -sed -i -e 's/-DEXPERIMENTAL_KPROBE_SDT//' src/Makefile.global -(cd src/backend/utils/ - make clean) -make -make install -run_tests uprobe -" -########## End /tmp/stap-postgres.sh ########## -close $fp - -########## /tmp/stap-postgres.sh does most of the work ########## -verbose -log Running postgres testsuite -spawn sh $pgdata.sh 2>&1 -expect { - -timeout 1000 - -re {FAIL: [a-z_ ]+} { regexp " .*$" $expect_out(0,string) s; - fail "$s"; exp_continue } - -re {PASS: [a-z_ ]+} { regexp " .*$" $expect_out(0,string) s; - pass "$s"; exp_continue } - -re {UNSUPPORTED: [a-zA-Z_/: ]+} { regexp " .*$" $expect_out(0,string) s; - verbose -log "$s" - unsupported "$s"; exp_continue } - timeout { fail "$test (timeout)" } - eof { } -} - -if { $verbose == 0 } { -catch {exec rm -rf $pgdata} -catch {exec rm -rf $pgdata.stp $pgdata.log \ - $pgdata-markers.log $pgdata.sh postgresql-8.3.6.tar.bz2} -catch {exec rm -rf postgresql-8.3.6} -} |