From fb1bdb8ee0fc7e6138c76d7a7449b3d7a487694a Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Fri, 22 Feb 2008 10:19:49 +0000 Subject: [PATCH] default to faster internal event loop. git-svn-id: file:///svn/unbound/trunk@983 be551aaa-1e26-0410-a405-d3ace91eadb9 --- README | 6 ++--- configure | 68 +++++++++++++++++++++++++----------------------- configure.ac | 8 +++--- doc/Changelog | 2 ++ doc/README | 11 +++++--- doc/README.svn | 2 +- doc/README.tests | 13 ++++++++- 7 files changed, 64 insertions(+), 46 deletions(-) diff --git a/README b/README index 0caeeb779..2c97589dd 100644 --- a/README +++ b/README @@ -1,9 +1,9 @@ Unbound README * ./configure && make && make install * on BSDs and Solaris use gmake (GNU make). -* If it complains that no libevent can be found; libevent is useful when - using many (10000) outgoing ports. By default 16 ports are used and the - builtin alternative is equally capable. +* You can use libevent if you want. libevent is useful when using + many (10000) outgoing ports. By default 16 ports are used and the + builtin alternative is equally capable and a little faster. * More detailed README, README.svn, README.tests in doc directory * manual pages can be found in doc directory, and are installed, unbound(8). * example configuration file doc/example.conf diff --git a/configure b/configure index f2e5500ab..f1bd3c3f6 100755 --- a/configure +++ b/configure @@ -1462,8 +1462,10 @@ Optional Packages: disable threading support. --with-solaris-threads use solaris native thread library. --with-libevent=pathname - set path to libevent (will check /usr/local - /opt/local /usr/lib /usr/pkg /usr/sfw /usr) + use libevent (will check /usr/local /opt/local + /usr/lib /usr/pkg /usr/sfw /usr or you can specify + an explicit path). Slower, but allows use of large + outgoing port ranges. --with-ldns=PATH specify prefix of path of ldns library to use @@ -5750,7 +5752,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5753 "configure"' > conftest.$ac_ext + echo '#line 5755 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7052,11 +7054,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7055: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7057: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7059: \$? = $ac_status" >&5 + echo "$as_me:7061: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7320,11 +7322,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7323: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7325: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7327: \$? = $ac_status" >&5 + echo "$as_me:7329: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7424,11 +7426,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7427: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7429: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7431: \$? = $ac_status" >&5 + echo "$as_me:7433: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8889,7 +8891,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 8892 "configure"' > conftest.$ac_ext + echo '#line 8894 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -9753,7 +9755,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:12194: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12196: \$? = $ac_status" >&5 + echo "$as_me:12198: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12293,11 +12295,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12296: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12298: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12300: \$? = $ac_status" >&5 + echo "$as_me:12302: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12829,7 +12831,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 12832 "configure"' > conftest.$ac_ext + echo '#line 12834 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -13884,11 +13886,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13887: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13889: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13891: \$? = $ac_status" >&5 + echo "$as_me:13893: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -13988,11 +13990,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13991: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13993: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13995: \$? = $ac_status" >&5 + echo "$as_me:13997: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15433,7 +15435,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 15436 "configure"' > conftest.$ac_ext + echo '#line 15438 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -16207,11 +16209,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16210: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16212: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16214: \$? = $ac_status" >&5 + echo "$as_me:16216: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16475,11 +16477,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16478: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16480: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16482: \$? = $ac_status" >&5 + echo "$as_me:16484: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16579,11 +16581,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16582: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16584: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16586: \$? = $ac_status" >&5 + echo "$as_me:16588: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -18044,7 +18046,7 @@ linux*) libsuff= case "$host_cpu" in x86_64*|s390x*|powerpc64*) - echo '#line 18047 "configure"' > conftest.$ac_ext + echo '#line 18049 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -21960,10 +21962,10 @@ fi if test "${with_libevent+set}" = set; then withval=$with_libevent; else - withval="yes" + withval="no" fi -if test x_$withval != x_no; then +if test x_$withval == x_yes -o x_$withval != x_no; then { echo "$as_me:$LINENO: checking for libevent" >&5 echo $ECHO_N "checking for libevent... $ECHO_C" >&6; } if test x_$withval = x_ -o x_$withval = x_yes; then @@ -22000,11 +22002,11 @@ echo "${ECHO_T}found in $thedir" >&6; } { { echo "$as_me:$LINENO: error: Cannot find the libevent library in $withval You can restart ./configure --with-libevent=no to use a builtin alternative. Please note that this alternative is not as capable as libevent when using -many outgoing ports. " >&5 +large outgoing port ranges. " >&5 echo "$as_me: error: Cannot find the libevent library in $withval You can restart ./configure --with-libevent=no to use a builtin alternative. Please note that this alternative is not as capable as libevent when using -many outgoing ports. " >&2;} +large outgoing port ranges. " >&2;} { (exit 1); exit 1; }; } fi else diff --git a/configure.ac b/configure.ac index 1c375b3aa..264d8e91e 100644 --- a/configure.ac +++ b/configure.ac @@ -513,9 +513,9 @@ AC_SEARCH_LIBS([clock_gettime], [rt]) # check for libevent AC_ARG_WITH(libevent, AC_HELP_STRING([--with-libevent=pathname], - [set path to libevent (will check /usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr)]), - [ ],[ withval="yes" ]) -if test x_$withval != x_no; then + [use libevent (will check /usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr or you can specify an explicit path). Slower, but allows use of large outgoing port ranges.]), + [ ],[ withval="no" ]) +if test x_$withval == x_yes -o x_$withval != x_no; then AC_MSG_CHECKING(for libevent) if test x_$withval = x_ -o x_$withval = x_yes; then withval="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr" @@ -550,7 +550,7 @@ if test x_$withval != x_no; then AC_MSG_ERROR([Cannot find the libevent library in $withval You can restart ./configure --with-libevent=no to use a builtin alternative. Please note that this alternative is not as capable as libevent when using -many outgoing ports. ]) +large outgoing port ranges. ]) fi else AC_MSG_RESULT(found in $thedir) diff --git a/doc/Changelog b/doc/Changelog index f73f2cf6c..fd2c2cfcc 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -3,6 +3,8 @@ and query ID) in the reply list, avoid re-encoding the answer. - removed TODO items for optimizations that do not show up in profile reports. + - default is now minievent - not libevent. As its faster and + not needed for regular installs, only for very large port ranges. 21 February 2008: Wouter - speedup of root-delegation message encoding by 15%. diff --git a/doc/README b/doc/README index 7e2204eae..c44debc3f 100644 --- a/doc/README +++ b/doc/README @@ -11,7 +11,9 @@ This software is under BSD license, see LICENSE for details. * Uses the following libraries; * ldns http://www.nlnetlabs.nl/ldns/ (BSD license) + (required) can use tarball from source directory. * libevent http://www.monkey.org/~provos/libevent/ (BSD license) + (optional) can use builtin alternative instead. * Create build environment * run libtoolize -c if config.sub is missing, or run glibtoolize. @@ -25,10 +27,11 @@ This software is under BSD license, see LICENSE for details. If detected on the system, it will dynamically link against it. * --with-libevent=/path/to/libevent Can be set to either the system install or the build directory. - --with-libevent=no gives a builtin alternative implementation. - libevent is useful when having many (thousands) of outgoing ports. - This improves randomization and spoof resistance. For the default - of 16 ports the builtin alternative works well. + --with-libevent=no (default) gives a builtin alternative + implementation. libevent is useful when having many (thousands) + of outgoing ports. This improves randomization and spoof + resistance. For the default of 16 ports the builtin alternative + works well and is a little faster. * --without-pthreads This disables pthreads. Without this option the pthreads library is detected automatically. Use this option to disable threading diff --git a/doc/README.svn b/doc/README.svn index ae1e8ac76..18c145849 100644 --- a/doc/README.svn +++ b/doc/README.svn @@ -5,7 +5,7 @@ For a svn checkout * possibly copy aclocal.m4 from your autoconf/libtool setup. * Note changes in the Changelog. -* Every checking a postcommit hook is run +* Every check-in a postcommit hook is run (the postcommit hook is in the svn/unbound/hooks directory). * generates commit email with your changes and comment. * compiles and runs the tests (with testcode/do-tests.sh). diff --git a/doc/README.tests b/doc/README.tests index 5c83cc084..e6a39ca2b 100644 --- a/doc/README.tests +++ b/doc/README.tests @@ -3,7 +3,18 @@ README unbound tests There is a test setup for unbound. Use make test To make and run the tests. The results are summarized at the end. -You can also run ./unittest by hand, if the system lacks other debug tools. + +You need to have the following programs installed and in your PATH. +* dig - from the bind-tools package. Used to send DNS queries. +* splint (optional) - for lint test +* doxygen (optional) - for doc completeness test +* ldns-testns (optional) - from ldns examples. Used as DNS auth server. +* xxd and nc (optional) - for (malformed) packet transmission. +The optional programs are detected and can be omitted. + +Without any support programs, unittest and testbound can still be used. + (cd testdata; ../testcode/mini_tpkg.sh exe 02-unittest.tpkg) + (cd testdata; ../testcode/mini_tpkg.sh exe 03-testbound.tpkg) testdata/ contains the data for tests. testcode/ contains scripts and c code for the tests. -- 2.47.2