From: robertc <> Date: Wed, 2 Oct 2002 17:06:28 +0000 (+0000) Subject: Andres Kroonmaa's hi-res cpu profiling patch X-Git-Tag: SQUID_3_0_PRE1~715 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88bfe092ac95ad894d1c6c57974a9af562d5091c;p=thirdparty%2Fsquid.git Andres Kroonmaa's hi-res cpu profiling patch --- diff --git a/configure b/configure index dcbc0cdbbe..ab610cec53 100755 --- a/configure +++ b/configure @@ -212,6 +212,18 @@ ac_help="$ac_help --disable-unlinkd Do not use unlinkd" ac_help="$ac_help --enable-stacktraces Enable automatic call backtrace on fatal errors" +ac_help="$ac_help + --enable-cpu-profiling + This option allows you to see which internal functions + in Squid are consuming how much CPU. Compiles in probes + that measure time spent in probed functions. Needs + source modifications to add new probes. This is meant + for developers to assist in performance optimisations + of Squid internal functions. + If you are not developer and not interested in the stats + you shouldn't enable this, as overhead added, although + small, is still overhead. See lib/Profiler.c for more. + " ac_help="$ac_help --enable-x-accelerator-vary Enable support for the X-Accelerator-Vary @@ -766,7 +778,7 @@ am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd` # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:770: checking for a BSD compatible install" >&5 +echo "configure:782: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -819,7 +831,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:823: checking whether build environment is sane" >&5 +echo "configure:835: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftest.file @@ -890,7 +902,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:894: checking for $ac_word" >&5 +echo "configure:906: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -920,7 +932,7 @@ test -n "$AWK" && break done echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:924: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:936: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1041,7 +1053,7 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # From configure.in Revision: 1.286 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:1045: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:1057: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -1073,7 +1085,7 @@ PRESET_CFLAGS="$CFLAGS" # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1077: checking for $ac_word" >&5 +echo "configure:1089: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1103,7 +1115,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1107: checking for $ac_word" >&5 +echo "configure:1119: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1154,7 +1166,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1158: checking for $ac_word" >&5 +echo "configure:1170: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1186,7 +1198,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1190: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1202: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1197,12 +1209,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1201 "configure" +#line 1213 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1228,12 +1240,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1232: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1244: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1237: checking whether we are using GNU C" >&5 +echo "configure:1249: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1242,7 +1254,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1261,7 +1273,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1265: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1277: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1300,7 +1312,7 @@ doit: END # If we don't find an include directive, just comment out the code. echo $ac_n "checking for style of include used by $am_make""... $ac_c" 1>&6 -echo "configure:1304: checking for style of include used by $am_make" >&5 +echo "configure:1316: checking for style of include used by $am_make" >&5 am__include='#' am__quote= _am_result=none @@ -1334,7 +1346,7 @@ rm -f confinc confmf depcc="$CC" am_compiler_list= echo $ac_n "checking dependency style of $depcc""... $ac_c" 1>&6 -echo "configure:1338: checking dependency style of $depcc" >&5 +echo "configure:1350: checking dependency style of $depcc" >&5 if eval "test \"`echo '$''{'am_cv_CC_dependencies_compiler_type'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1412,7 +1424,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1416: checking for $ac_word" >&5 +echo "configure:1428: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1444,7 +1456,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1448: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:1460: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1455,12 +1467,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 1459 "configure" +#line 1471 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:1464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1486,12 +1498,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1490: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1502: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1495: checking whether we are using GNU C++" >&5 +echo "configure:1507: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1500,7 +1512,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1504: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1516: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1519,7 +1531,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1523: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1535: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1553,7 +1565,7 @@ fi depcc="$CXX" am_compiler_list= echo $ac_n "checking dependency style of $depcc""... $ac_c" 1>&6 -echo "configure:1557: checking dependency style of $depcc" >&5 +echo "configure:1569: checking dependency style of $depcc" >&5 if eval "test \"`echo '$''{'am_cv_CXX_dependencies_compiler_type'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1621,10 +1633,10 @@ CXXDEPMODE="depmode=$am_cv_CXX_dependencies_compiler_type" if test "x$CC" != xcc; then echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6 -echo "configure:1625: checking whether $CC and cc understand -c and -o together" >&5 +echo "configure:1637: checking whether $CC and cc understand -c and -o together" >&5 else echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6 -echo "configure:1628: checking whether cc understands -c and -o together" >&5 +echo "configure:1640: checking whether cc understands -c and -o together" >&5 fi set dummy $CC; ac_cc="`echo $2 | sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" @@ -1636,16 +1648,16 @@ else # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5' -if { (eval echo configure:1640: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; +if { (eval echo configure:1652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1653: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then ac_try='cc -c conftest.c -o conftest.o 1>&5' - if { (eval echo configure:1648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && - test -f conftest.o && { (eval echo configure:1649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; + if { (eval echo configure:1660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } && + test -f conftest.o && { (eval echo configure:1661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; then # cc works too. : @@ -1691,7 +1703,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:1695: checking host system type" >&5 +echo "configure:1707: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -1718,12 +1730,12 @@ REGEXLIB='' # -lregex LIBREGEX='' # libregex.a echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:1722: checking for Cygwin environment" >&5 +echo "configure:1734: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -1751,19 +1763,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1755: checking for mingw32 environment" >&5 +echo "configure:1767: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -1782,7 +1794,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1786: checking for executable suffix" >&5 +echo "configure:1798: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1792,7 +1804,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -1813,13 +1825,13 @@ echo "$ac_t""${ac_cv_exeext}" 1>&6 ac_exeext=$EXEEXT echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1817: checking for object suffix" >&5 +echo "configure:1829: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1899,7 +1911,7 @@ EOF # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1903: checking for $ac_word" >&5 +echo "configure:1915: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1929,7 +1941,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1933: checking for $ac_word" >&5 +echo "configure:1945: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1980,7 +1992,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1984: checking for $ac_word" >&5 +echo "configure:1996: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2012,7 +2024,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2016: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2028: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2023,12 +2035,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2027 "configure" +#line 2039 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2054,12 +2066,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2058: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2070: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:2063: checking whether we are using GNU C" >&5 +echo "configure:2075: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2068,7 +2080,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2072: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2084: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -2087,7 +2099,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:2091: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2103: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2121,7 +2133,7 @@ fi depcc="$CC" am_compiler_list= echo $ac_n "checking dependency style of $depcc""... $ac_c" 1>&6 -echo "configure:2125: checking dependency style of $depcc" >&5 +echo "configure:2137: checking dependency style of $depcc" >&5 if eval "test \"`echo '$''{'am_cv_CC_dependencies_compiler_type'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3528,6 +3540,38 @@ EOF fi + + +if false; then + ENABLE_XPROF_STATS_TRUE= + ENABLE_XPROF_STATS_FALSE='#' +else + ENABLE_XPROF_STATS_TRUE='#' + ENABLE_XPROF_STATS_FALSE= +fi +# Check whether --enable-cpu-profiling or --disable-cpu-profiling was given. +if test "${enable_cpu_profiling+set}" = set; then + enableval="$enable_cpu_profiling" + if test "$enableval" = "yes" ; then + echo "Enabling cpu-profiling" + cat >> confdefs.h <<\EOF +#define USE_XPROF_STATS 1 +EOF + + + +if true; then + ENABLE_XPROF_STATS_TRUE= + ENABLE_XPROF_STATS_FALSE='#' +else + ENABLE_XPROF_STATS_TRUE='#' + ENABLE_XPROF_STATS_FALSE= +fi + fi + +fi + + # Check whether --enable-x_accelerator_vary or --disable-x_accelerator_vary was given. if test "${enable_x_accelerator_vary+set}" = set; then enableval="$enable_x_accelerator_vary" @@ -3569,7 +3613,7 @@ case "$host" in esac echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:3573: checking how to run the C preprocessor" >&5 +echo "configure:3617: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3584,13 +3628,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3594: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3601,13 +3645,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3611: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3618,13 +3662,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -3660,7 +3704,7 @@ echo "$ac_t""$CPP" 1>&6 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:3664: checking for a BSD compatible install" >&5 +echo "configure:3708: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3715,7 +3759,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3719: checking for $ac_word" >&5 +echo "configure:3763: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3743,7 +3787,7 @@ else fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:3747: checking whether ln -s works" >&5 +echo "configure:3791: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3766,7 +3810,7 @@ fi # Extract the first word of "sh", so it can be a program name with args. set dummy sh; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3770: checking for $ac_word" >&5 +echo "configure:3814: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3802,7 +3846,7 @@ fi # Extract the first word of "false", so it can be a program name with args. set dummy false; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3806: checking for $ac_word" >&5 +echo "configure:3850: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_FALSE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3838,7 +3882,7 @@ fi # Extract the first word of "true", so it can be a program name with args. set dummy true; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3842: checking for $ac_word" >&5 +echo "configure:3886: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TRUE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3874,7 +3918,7 @@ fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3878: checking for $ac_word" >&5 +echo "configure:3922: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3910,7 +3954,7 @@ fi # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3914: checking for $ac_word" >&5 +echo "configure:3958: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3946,7 +3990,7 @@ fi # Extract the first word of "mkdir", so it can be a program name with args. set dummy mkdir; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3950: checking for $ac_word" >&5 +echo "configure:3994: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MKDIR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3982,7 +4026,7 @@ fi # Extract the first word of "ln", so it can be a program name with args. set dummy ln; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3986: checking for $ac_word" >&5 +echo "configure:4030: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4018,7 +4062,7 @@ fi # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4022: checking for $ac_word" >&5 +echo "configure:4066: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4054,7 +4098,7 @@ fi # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4058: checking for $ac_word" >&5 +echo "configure:4102: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4114,12 +4158,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:4118: checking for $ac_hdr that defines DIR" >&5 +echo "configure:4162: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -4127,7 +4171,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:4131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4152,7 +4196,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:4156: checking for opendir in -ldir" >&5 +echo "configure:4200: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4160,7 +4204,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4193,7 +4237,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4197: checking for opendir in -lx" >&5 +echo "configure:4241: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4201,7 +4245,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4235,12 +4279,12 @@ fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4239: checking for ANSI C header files" >&5 +echo "configure:4283: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4248,7 +4292,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4265,7 +4309,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -4283,7 +4327,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -4304,7 +4348,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -4315,7 +4359,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:4319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -4422,17 +4466,17 @@ for ac_hdr in \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4426: checking for $ac_hdr" >&5 +echo "configure:4470: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4436: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4460,12 +4504,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:4464: checking for working const" >&5 +echo "configure:4508: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4562: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -4535,14 +4579,14 @@ EOF fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:4539: checking whether byte ordering is bigendian" >&5 +echo "configure:4583: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -4553,11 +4597,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:4557: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -4568,7 +4612,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:4572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -4588,7 +4632,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -4626,20 +4670,20 @@ fi echo $ac_n "checking if ANSI prototypes work""... $ac_c" 1>&6 -echo "configure:4630: checking if ANSI prototypes work" >&5 +echo "configure:4674: checking if ANSI prototypes work" >&5 if eval "test \"`echo '$''{'ac_cv_have_ansi_prototypes'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_ansi_prototypes="yes" else @@ -4661,13 +4705,13 @@ EOF fi echo $ac_n "checking for tm->tm_gmtoff""... $ac_c" 1>&6 -echo "configure:4665: checking for tm->tm_gmtoff" >&5 +echo "configure:4709: checking for tm->tm_gmtoff" >&5 if eval "test \"`echo '$''{'ac_cv_have_tm_gmoff'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4676,7 +4720,7 @@ struct tm foo; foo.tm_gmtoff = 0; ; return 0; } EOF -if { (eval echo configure:4680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_tm_gmoff="yes" else @@ -4698,13 +4742,13 @@ EOF fi echo $ac_n "checking for struct mallinfo""... $ac_c" 1>&6 -echo "configure:4702: checking for struct mallinfo" >&5 +echo "configure:4746: checking for struct mallinfo" >&5 if eval "test \"`echo '$''{'ac_cv_have_struct_mallinfo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if HAVE_MALLOC_H @@ -4722,7 +4766,7 @@ struct mallinfo foo; foo.keepcost = 0; ; return 0; } EOF -if { (eval echo configure:4726: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_struct_mallinfo="yes" else @@ -4744,13 +4788,13 @@ EOF fi echo $ac_n "checking for extended mallinfo""... $ac_c" 1>&6 -echo "configure:4748: checking for extended mallinfo" >&5 +echo "configure:4792: checking for extended mallinfo" >&5 if eval "test \"`echo '$''{'ac_cv_have_ext_mallinfo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4759,7 +4803,7 @@ struct mallinfo foo; foo.mxfast = 0; ; return 0; } EOF -if { (eval echo configure:4763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4807: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_ext_mallinfo="yes" else @@ -4781,13 +4825,13 @@ EOF fi echo $ac_n "checking for struct rusage""... $ac_c" 1>&6 -echo "configure:4785: checking for struct rusage" >&5 +echo "configure:4829: checking for struct rusage" >&5 if eval "test \"`echo '$''{'ac_cv_have_struct_rusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_struct_rusage="yes" else @@ -4822,13 +4866,13 @@ EOF fi echo $ac_n "checking for ip->ip_hl""... $ac_c" 1>&6 -echo "configure:4826: checking for ip->ip_hl" >&5 +echo "configure:4870: checking for ip->ip_hl" >&5 if eval "test \"`echo '$''{'ac_cv_have_ip_hl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4847,7 +4891,7 @@ struct iphdr ip; ip.ip_hl= 0; ; return 0; } EOF -if { (eval echo configure:4851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_ip_hl="yes" else @@ -4869,7 +4913,7 @@ EOF fi echo $ac_n "checking size of void *""... $ac_c" 1>&6 -echo "configure:4873: checking size of void *" >&5 +echo "configure:4917: checking size of void *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4877,7 +4921,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4888,7 +4932,7 @@ main() exit(0); } EOF -if { (eval echo configure:4892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_void_p=`cat conftestval` else @@ -4908,7 +4952,7 @@ EOF echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:4912: checking size of short" >&5 +echo "configure:4956: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4916,7 +4960,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4927,7 +4971,7 @@ main() exit(0); } EOF -if { (eval echo configure:4931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -4947,7 +4991,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:4951: checking size of int" >&5 +echo "configure:4995: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4955,7 +4999,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -4966,7 +5010,7 @@ main() exit(0); } EOF -if { (eval echo configure:4970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -4986,7 +5030,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:4990: checking size of long" >&5 +echo "configure:5034: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4994,7 +5038,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -5005,7 +5049,7 @@ main() exit(0); } EOF -if { (eval echo configure:5009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -5025,7 +5069,7 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:5029: checking size of long long" >&5 +echo "configure:5073: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5033,7 +5077,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -5044,7 +5088,7 @@ main() exit(0); } EOF -if { (eval echo configure:5048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -5064,7 +5108,7 @@ EOF echo $ac_n "checking size of __int64""... $ac_c" 1>&6 -echo "configure:5068: checking size of __int64" >&5 +echo "configure:5112: checking size of __int64" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof___int64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5072,7 +5116,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -5098,7 +5142,7 @@ int main() } EOF -if { (eval echo configure:5102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof___int64=`cat conftestval` else @@ -5118,7 +5162,7 @@ EOF echo $ac_n "checking size of int16_t""... $ac_c" 1>&6 -echo "configure:5122: checking size of int16_t" >&5 +echo "configure:5166: checking size of int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5126,7 +5170,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -5152,7 +5196,7 @@ int main() } EOF -if { (eval echo configure:5156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int16_t=`cat conftestval` else @@ -5172,7 +5216,7 @@ EOF echo $ac_n "checking size of uint16_t""... $ac_c" 1>&6 -echo "configure:5176: checking size of uint16_t" >&5 +echo "configure:5220: checking size of uint16_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_uint16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5180,7 +5224,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -5206,7 +5250,7 @@ int main() } EOF -if { (eval echo configure:5210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_uint16_t=`cat conftestval` else @@ -5226,7 +5270,7 @@ EOF echo $ac_n "checking size of u_int16_t""... $ac_c" 1>&6 -echo "configure:5230: checking size of u_int16_t" >&5 +echo "configure:5274: checking size of u_int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5234,7 +5278,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -5260,7 +5304,7 @@ int main() } EOF -if { (eval echo configure:5264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_u_int16_t=`cat conftestval` else @@ -5280,7 +5324,7 @@ EOF echo $ac_n "checking size of int32_t""... $ac_c" 1>&6 -echo "configure:5284: checking size of int32_t" >&5 +echo "configure:5328: checking size of int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5288,7 +5332,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -5314,7 +5358,7 @@ int main() } EOF -if { (eval echo configure:5318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int32_t=`cat conftestval` else @@ -5334,7 +5378,7 @@ EOF echo $ac_n "checking size of uint32_t""... $ac_c" 1>&6 -echo "configure:5338: checking size of uint32_t" >&5 +echo "configure:5382: checking size of uint32_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_uint32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5342,7 +5386,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -5368,7 +5412,7 @@ int main() } EOF -if { (eval echo configure:5372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_uint32_t=`cat conftestval` else @@ -5388,7 +5432,7 @@ EOF echo $ac_n "checking size of u_int32_t""... $ac_c" 1>&6 -echo "configure:5392: checking size of u_int32_t" >&5 +echo "configure:5436: checking size of u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5396,7 +5440,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -5422,7 +5466,7 @@ int main() } EOF -if { (eval echo configure:5426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_u_int32_t=`cat conftestval` else @@ -5442,7 +5486,7 @@ EOF echo $ac_n "checking size of int64_t""... $ac_c" 1>&6 -echo "configure:5446: checking size of int64_t" >&5 +echo "configure:5490: checking size of int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5450,7 +5494,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -5476,7 +5520,7 @@ int main() } EOF -if { (eval echo configure:5480: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5524: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int64_t=`cat conftestval` else @@ -5496,7 +5540,7 @@ EOF echo $ac_n "checking size of uint64_t""... $ac_c" 1>&6 -echo "configure:5500: checking size of uint64_t" >&5 +echo "configure:5544: checking size of uint64_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_uint64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5504,7 +5548,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -5530,7 +5574,7 @@ int main() } EOF -if { (eval echo configure:5534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_uint64_t=`cat conftestval` else @@ -5550,7 +5594,7 @@ EOF echo $ac_n "checking size of u_int64_t""... $ac_c" 1>&6 -echo "configure:5554: checking size of u_int64_t" >&5 +echo "configure:5598: checking size of u_int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5558,7 +5602,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -5584,7 +5628,7 @@ int main() } EOF -if { (eval echo configure:5588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_u_int64_t=`cat conftestval` else @@ -5606,12 +5650,12 @@ EOF if test "x$ac_cv_sizeof_short" = "x2"; then echo $ac_n "checking for int16_t""... $ac_c" 1>&6 -echo "configure:5610: checking for int16_t" >&5 +echo "configure:5654: checking for int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5659: checking for int16_t" >&5 +echo "configure:5703: checking for int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5709: checking for u_int16_t" >&5 +echo "configure:5753: checking for u_int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5758: checking for u_int16_t" >&5 +echo "configure:5802: checking for u_int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5807: checking for u_int16_t" >&5 +echo "configure:5851: checking for u_int16_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int16_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5857: checking for int32_t" >&5 +echo "configure:5901: checking for int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5906: checking for int32_t" >&5 +echo "configure:5950: checking for int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:5956: checking for u_int32_t" >&5 +echo "configure:6000: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6005: checking for u_int32_t" >&5 +echo "configure:6049: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6054: checking for u_int32_t" >&5 +echo "configure:6098: checking for u_int32_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6104: checking for int64_t" >&5 +echo "configure:6148: checking for int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6153: checking for int64_t" >&5 +echo "configure:6197: checking for int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6202: checking for int64_t" >&5 +echo "configure:6246: checking for int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6252: checking for u_int64_t" >&5 +echo "configure:6296: checking for u_int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6301: checking for u_int64_t" >&5 +echo "configure:6345: checking for u_int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6350: checking for u_int64_t" >&5 +echo "configure:6394: checking for u_int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6399: checking for int64_t" >&5 +echo "configure:6443: checking for int64_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 -echo "configure:6449: checking for pid_t" >&5 +echo "configure:6493: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6478,12 +6522,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:6482: checking for size_t" >&5 +echo "configure:6526: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6511,12 +6555,12 @@ EOF fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:6515: checking for ssize_t" >&5 +echo "configure:6559: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6544,12 +6588,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:6548: checking for off_t" >&5 +echo "configure:6592: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6577,12 +6621,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:6581: checking for mode_t" >&5 +echo "configure:6625: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6610,12 +6654,12 @@ EOF fi echo $ac_n "checking for fd_mask""... $ac_c" 1>&6 -echo "configure:6614: checking for fd_mask" >&5 +echo "configure:6658: checking for fd_mask" >&5 if eval "test \"`echo '$''{'ac_cv_type_fd_mask'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6644,7 +6688,7 @@ fi echo $ac_n "checking size of off_t""... $ac_c" 1>&6 -echo "configure:6648: checking size of off_t" >&5 +echo "configure:6692: checking size of off_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6652,7 +6696,7 @@ else ac_cv_sizeof_off_t=4 else cat > conftest.$ac_ext < @@ -6678,7 +6722,7 @@ int main() } EOF -if { (eval echo configure:6682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_off_t=`cat conftestval` else @@ -6698,7 +6742,7 @@ EOF echo $ac_n "checking size of size_t""... $ac_c" 1>&6 -echo "configure:6702: checking size of size_t" >&5 +echo "configure:6746: checking size of size_t" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6706,7 +6750,7 @@ else ac_cv_sizeof_size_t=4 else cat > conftest.$ac_ext < @@ -6732,7 +6776,7 @@ int main() } EOF -if { (eval echo configure:6736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_size_t=`cat conftestval` else @@ -6755,19 +6799,19 @@ EOF # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:6759: checking for working alloca.h" >&5 +echo "configure:6803: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:6771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -6788,12 +6832,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:6792: checking for alloca" >&5 +echo "configure:6836: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -6853,12 +6897,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:6857: checking whether alloca needs Cray hooks" >&5 +echo "configure:6901: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6887: checking for $ac_func" >&5 +echo "configure:6931: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6938,7 +6982,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:6942: checking stack direction for C alloca" >&5 +echo "configure:6986: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6946,7 +6990,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -6989,13 +7033,13 @@ fi echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:6993: checking for socklen_t" >&5 +echo "configure:7037: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -7026,13 +7070,13 @@ EOF fi echo $ac_n "checking for mtyp_t""... $ac_c" 1>&6 -echo "configure:7030: checking for mtyp_t" >&5 +echo "configure:7074: checking for mtyp_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mtyp_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -7060,7 +7104,7 @@ EOF fi echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:7064: checking for main in -lnsl" >&5 +echo "configure:7108: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7068,14 +7112,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7103,7 +7147,7 @@ else fi echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 -echo "configure:7107: checking for main in -lsocket" >&5 +echo "configure:7151: checking for main in -lsocket" >&5 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7111,14 +7155,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7147,13 +7191,13 @@ fi echo $ac_n "checking for unix domain sockets""... $ac_c" 1>&6 -echo "configure:7151: checking for unix domain sockets" >&5 +echo "configure:7195: checking for unix domain sockets" >&5 if eval "test \"`echo '$''{'squid_cv_unixsocket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -7168,7 +7212,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:7172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* squid_cv_unixsocket=yes else @@ -7192,7 +7236,7 @@ if test "x$ac_cv_enabled_dlmalloc" = "xyes" ; then echo "skipping libmalloc check (--enable-dlmalloc specified)" else echo $ac_n "checking for main in -lgnumalloc""... $ac_c" 1>&6 -echo "configure:7196: checking for main in -lgnumalloc" >&5 +echo "configure:7240: checking for main in -lgnumalloc" >&5 ac_lib_var=`echo gnumalloc'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7200,14 +7244,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lgnumalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7250,7 +7294,7 @@ fi *) echo $ac_n "checking for main in -lmalloc""... $ac_c" 1>&6 -echo "configure:7254: checking for main in -lmalloc" >&5 +echo "configure:7298: checking for main in -lmalloc" >&5 ac_lib_var=`echo malloc'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7258,14 +7302,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lmalloc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7298,7 +7342,7 @@ fi fi echo $ac_n "checking for main in -lbsd""... $ac_c" 1>&6 -echo "configure:7302: checking for main in -lbsd" >&5 +echo "configure:7346: checking for main in -lbsd" >&5 ac_lib_var=`echo bsd'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7306,14 +7350,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7341,7 +7385,7 @@ else fi echo $ac_n "checking for main in -lregex""... $ac_c" 1>&6 -echo "configure:7345: checking for main in -lregex" >&5 +echo "configure:7389: checking for main in -lregex" >&5 ac_lib_var=`echo regex'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7349,14 +7393,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lregex $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7377,7 +7421,7 @@ else fi echo $ac_n "checking for gethostbyname in -lbind""... $ac_c" 1>&6 -echo "configure:7381: checking for gethostbyname in -lbind" >&5 +echo "configure:7425: checking for gethostbyname in -lbind" >&5 ac_lib_var=`echo bind'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7385,7 +7429,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbind $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7430,7 +7474,7 @@ if test $ac_cv_lib_bind_gethostbyname = "no" ; then ;; *) echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6 -echo "configure:7434: checking for inet_aton in -lresolv" >&5 +echo "configure:7478: checking for inet_aton in -lresolv" >&5 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7438,7 +7482,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7465,7 +7509,7 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for inet_aton in -l44bsd""... $ac_c" 1>&6 -echo "configure:7469: checking for inet_aton in -l44bsd" >&5 +echo "configure:7513: checking for inet_aton in -l44bsd" >&5 ac_lib_var=`echo 44bsd'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7473,7 +7517,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l44bsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7516,7 +7560,7 @@ else fi echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6 -echo "configure:7520: checking for main in -lresolv" >&5 +echo "configure:7564: checking for main in -lresolv" >&5 ac_lib_var=`echo resolv'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7524,14 +7568,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7562,7 +7606,7 @@ fi esac fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:7566: checking for main in -lm" >&5 +echo "configure:7610: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7570,14 +7614,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7606,7 +7650,7 @@ fi echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:7610: checking for crypt in -lcrypt" >&5 +echo "configure:7654: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7614,7 +7658,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7649,7 +7693,7 @@ fi if test "$with_dl" = "yes"; then echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:7653: checking for dlopen in -ldl" >&5 +echo "configure:7697: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7657,7 +7701,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7699,7 +7743,7 @@ fi if test "$with_pthreads" = "yes"; then echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6 -echo "configure:7703: checking for main in -lpthread" >&5 +echo "configure:7747: checking for main in -lpthread" >&5 ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7707,14 +7751,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7745,7 +7789,7 @@ fi if test "$with_aio" = "yes"; then echo $ac_n "checking for aio_read in -lrt""... $ac_c" 1>&6 -echo "configure:7749: checking for aio_read in -lrt" >&5 +echo "configure:7793: checking for aio_read in -lrt" >&5 ac_lib_var=`echo rt'_'aio_read | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7753,7 +7797,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lrt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7796,7 +7840,7 @@ fi case "$host" in *-pc-sco3.2*) echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 -echo "configure:7800: checking for strftime in -lintl" >&5 +echo "configure:7844: checking for strftime in -lintl" >&5 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7804,7 +7848,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8003,12 +8047,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8007: checking for $ac_func" >&5 +echo "configure:8051: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8089,7 +8133,7 @@ echo "Using ${SELECT_TYPE} for select loop." echo $ac_n "checking if setresuid is implemented""... $ac_c" 1>&6 -echo "configure:8093: checking if setresuid is implemented" >&5 +echo "configure:8137: checking if setresuid is implemented" >&5 if eval "test \"`echo '$''{'ac_cv_func_setresuid'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8097,7 +8141,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -8110,7 +8154,7 @@ else } EOF -if { (eval echo configure:8114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setresuid="yes" else @@ -8156,7 +8200,7 @@ fi if test "$IPF_TRANSPARENT" ; then echo $ac_n "checking if IP-Filter header files are installed""... $ac_c" 1>&6 -echo "configure:8160: checking if IP-Filter header files are installed" >&5 +echo "configure:8204: checking if IP-Filter header files are installed" >&5 # hold on to your hats... if test "$ac_cv_header_ip_compat_h" = "yes" || test "$ac_cv_header_ip_fil_compat_h" = "yes" || @@ -8197,7 +8241,7 @@ fi if test "$PF_TRANSPARENT" ; then echo $ac_n "checking if PF header file is installed""... $ac_c" 1>&6 -echo "configure:8201: checking if PF header file is installed" >&5 +echo "configure:8245: checking if PF header file is installed" >&5 # hold on to your hats... if test "$ac_cv_header_net_pfvar_h" = "yes"; then PF_TRANSPARENT="yes" @@ -8222,7 +8266,7 @@ fi if test "$LINUX_NETFILTER" ; then echo $ac_n "checking if Linux 2.4 kernel header files are installed""... $ac_c" 1>&6 -echo "configure:8226: checking if Linux 2.4 kernel header files are installed" >&5 +echo "configure:8270: checking if Linux 2.4 kernel header files are installed" >&5 # hold on to your hats... if test "$ac_cv_header_linux_netfilter_ipv4_h" = "yes"; then LINUX_NETFILTER="yes" @@ -8256,13 +8300,13 @@ if test -z "$USE_GNUREGEX" ; then esac fi echo $ac_n "checking if GNUregex needs to be compiled""... $ac_c" 1>&6 -echo "configure:8260: checking if GNUregex needs to be compiled" >&5 +echo "configure:8304: checking if GNUregex needs to be compiled" >&5 if test -z "$USE_GNUREGEX"; then if test "$ac_cv_func_regcomp" = "no" || test "$USE_GNUREGEX" = "yes" ; then USE_GNUREGEX="yes" else cat > conftest.$ac_ext < #include @@ -8270,7 +8314,7 @@ int main() { regex_t t; regcomp(&t,"",0); ; return 0; } EOF -if { (eval echo configure:8274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* USE_GNUREGEX="no" else @@ -8301,12 +8345,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8305: checking for $ac_func" >&5 +echo "configure:8349: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8357,12 +8401,12 @@ done echo $ac_n "checking Default FD_SETSIZE value""... $ac_c" 1>&6 -echo "configure:8361: checking Default FD_SETSIZE value" >&5 +echo "configure:8405: checking Default FD_SETSIZE value" >&5 if test "$cross_compiling" = yes; then DEFAULT_FD_SETSIZE=256 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then DEFAULT_FD_SETSIZE=`cat conftestval` else @@ -8407,7 +8451,7 @@ EOF echo $ac_n "checking Maximum number of filedescriptors we can open""... $ac_c" 1>&6 -echo "configure:8411: checking Maximum number of filedescriptors we can open" >&5 +echo "configure:8455: checking Maximum number of filedescriptors we can open" >&5 if test -n "$squid_filedescriptors_num" ; then SQUID_MAXFD=$squid_filedescriptors_num echo "$ac_t""$SQUID_MAXFD (user-forced)" 1>&6 @@ -8423,7 +8467,7 @@ else SQUID_MAXFD=256 else cat > conftest.$ac_ext < @@ -8483,7 +8527,7 @@ main() { } EOF -if { (eval echo configure:8487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_MAXFD=`cat conftestval` else @@ -8511,12 +8555,12 @@ fi LDFLAGS="$TLDFLAGS" echo $ac_n "checking Default UDP send buffer size""... $ac_c" 1>&6 -echo "configure:8515: checking Default UDP send buffer size" >&5 +echo "configure:8559: checking Default UDP send buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_UDP_SO_SNDBUF=16384 else cat > conftest.$ac_ext < @@ -8537,7 +8581,7 @@ main () } EOF -if { (eval echo configure:8541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_UDP_SO_SNDBUF=`cat conftestval` else @@ -8556,12 +8600,12 @@ EOF echo $ac_n "checking Default UDP receive buffer size""... $ac_c" 1>&6 -echo "configure:8560: checking Default UDP receive buffer size" >&5 +echo "configure:8604: checking Default UDP receive buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_UDP_SO_RCVBUF=16384 else cat > conftest.$ac_ext < @@ -8582,7 +8626,7 @@ main () } EOF -if { (eval echo configure:8586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_UDP_SO_RCVBUF=`cat conftestval` else @@ -8601,12 +8645,12 @@ EOF echo $ac_n "checking Default TCP send buffer size""... $ac_c" 1>&6 -echo "configure:8605: checking Default TCP send buffer size" >&5 +echo "configure:8649: checking Default TCP send buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_TCP_SO_SNDBUF=16384 else cat > conftest.$ac_ext < @@ -8627,7 +8671,7 @@ main () } EOF -if { (eval echo configure:8631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_TCP_SO_SNDBUF=`cat conftestval` else @@ -8646,12 +8690,12 @@ EOF echo $ac_n "checking Default TCP receive buffer size""... $ac_c" 1>&6 -echo "configure:8650: checking Default TCP receive buffer size" >&5 +echo "configure:8694: checking Default TCP receive buffer size" >&5 if test "$cross_compiling" = yes; then SQUID_TCP_SO_RCVBUF=16384 else cat > conftest.$ac_ext < @@ -8672,7 +8716,7 @@ main () } EOF -if { (eval echo configure:8676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then SQUID_TCP_SO_RCVBUF=`cat conftestval` else @@ -8691,19 +8735,19 @@ EOF echo $ac_n "checking if sys_errlist is already defined""... $ac_c" 1>&6 -echo "configure:8695: checking if sys_errlist is already defined" >&5 +echo "configure:8739: checking if sys_errlist is already defined" >&5 if eval "test \"`echo '$''{'ac_cv_needs_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *s = sys_errlist; ; return 0; } EOF -if { (eval echo configure:8707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_needs_sys_errlist="no" else @@ -8725,16 +8769,16 @@ EOF fi echo $ac_n "checking for libresolv _dns_ttl_ hack""... $ac_c" 1>&6 -echo "configure:8729: checking for libresolv _dns_ttl_ hack" >&5 +echo "configure:8773: checking for libresolv _dns_ttl_ hack" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -8750,12 +8794,12 @@ fi rm -f conftest* echo $ac_n "checking if inet_ntoa() actually works""... $ac_c" 1>&6 -echo "configure:8754: checking if inet_ntoa() actually works" >&5 +echo "configure:8798: checking if inet_ntoa() actually works" >&5 if test "$cross_compiling" = yes; then INET_NTOA_RESULT="broken" else cat > conftest.$ac_ext < @@ -8774,7 +8818,7 @@ main () } EOF -if { (eval echo configure:8778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then INET_NTOA_RESULT=`cat conftestval` else @@ -8800,9 +8844,9 @@ fi if test "$ac_cv_header_sys_statvfs_h" = "yes" ; then echo $ac_n "checking for working statvfs() interface""... $ac_c" 1>&6 -echo "configure:8804: checking for working statvfs() interface" >&5 +echo "configure:8848: checking for working statvfs() interface" >&5 cat > conftest.$ac_ext < @@ -8819,7 +8863,7 @@ statvfs("/tmp", &sfs); ; return 0; } EOF -if { (eval echo configure:8823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8867: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_func_statvfs=yes else @@ -8839,12 +8883,12 @@ fi fi echo $ac_n "checking for _res.nsaddr_list""... $ac_c" 1>&6 -echo "configure:8843: checking for _res.nsaddr_list" >&5 +echo "configure:8887: checking for _res.nsaddr_list" >&5 if eval "test \"`echo '$''{'ac_cv_have_res_nsaddr_list'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_res_nsaddr_list="yes" else @@ -8889,12 +8933,12 @@ fi if test $ac_cv_have_res_nsaddr_list = "no" ; then echo $ac_n "checking for _res.ns_list""... $ac_c" 1>&6 -echo "configure:8893: checking for _res.ns_list" >&5 +echo "configure:8937: checking for _res.ns_list" >&5 if eval "test \"`echo '$''{'ac_cv_have_res_ns_list'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8965: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_res_ns_list="yes" else @@ -9224,6 +9268,8 @@ s%@DIGEST_AUTH_HELPERS@%$DIGEST_AUTH_HELPERS%g s%@EXTERNAL_ACL_HELPERS@%$EXTERNAL_ACL_HELPERS%g s%@ENABLE_UNLINKD_TRUE@%$ENABLE_UNLINKD_TRUE%g s%@ENABLE_UNLINKD_FALSE@%$ENABLE_UNLINKD_FALSE%g +s%@ENABLE_XPROF_STATS_TRUE@%$ENABLE_XPROF_STATS_TRUE%g +s%@ENABLE_XPROF_STATS_FALSE@%$ENABLE_XPROF_STATS_FALSE%g s%@CPP@%$CPP%g s%@RANLIB@%$RANLIB%g s%@LN_S@%$LN_S%g diff --git a/configure.in b/configure.in index 567aa7eb01..10867d8c92 100644 --- a/configure.in +++ b/configure.in @@ -3,7 +3,7 @@ dnl Configuration input file for Squid dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.286 2002/09/29 12:55:52 hno Exp $ +dnl $Id: configure.in,v 1.287 2002/10/02 11:06:28 robertc Exp $ dnl dnl dnl @@ -11,7 +11,7 @@ AC_INIT(src/main.c) AC_CONFIG_AUX_DIR(cfgaux) AM_INIT_AUTOMAKE(squid, 2.6-DEVEL) AM_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.286 $)dnl +AC_REVISION($Revision: 1.287 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -1127,6 +1127,27 @@ AC_ARG_ENABLE(stacktraces, fi ]) +AM_CONDITIONAL(ENABLE_XPROF_STATS, false) +dnl Enable USE_XPROF_STATS +AC_ARG_ENABLE(cpu-profiling, +[ --enable-cpu-profiling + This option allows you to see which internal functions + in Squid are consuming how much CPU. Compiles in probes + that measure time spent in probed functions. Needs + source modifications to add new probes. This is meant + for developers to assist in performance optimisations + of Squid internal functions. + If you are not developer and not interested in the stats + you shouldn't enable this, as overhead added, although + small, is still overhead. See lib/Profiler.c for more. + ], +[ if test "$enableval" = "yes" ; then + echo "Enabling cpu-profiling" + AC_DEFINE(USE_XPROF_STATS, 1) + AM_CONDITIONAL(ENABLE_XPROF_STATS, true) + fi +]) + dnl Enable X-Accelerator-Vary for Vary support within an accelerator setup AC_ARG_ENABLE(x_accelerator_vary, [ --enable-x-accelerator-vary diff --git a/include/autoconf.h.in b/include/autoconf.h.in index fd6315dc1f..13535f1c92 100644 --- a/include/autoconf.h.in +++ b/include/autoconf.h.in @@ -107,6 +107,9 @@ #undef FORW_VIA_DB +/* Define to enable CPU profiling within Squid */ +#undef USE_XPROF_STATS + /* Define if you have problems with memPools and want to disable Pools */ #undef DISABLE_POOLS diff --git a/include/profiling.h b/include/profiling.h new file mode 100644 index 0000000000..c4bccf80c1 --- /dev/null +++ b/include/profiling.h @@ -0,0 +1,131 @@ + +#ifndef _PROFILING_H_ +#define _PROFILING_H_ + +#include "config.h" + +#ifdef USE_XPROF_STATS + +#if !defined(_SQUID_SOLARIS_) +typedef long long hrtime_t; +#else +#include +#endif + +#if defined(__i386) +static inline hrtime_t +get_tick(void) +{ + hrtime_t regs; + asm volatile ("rdtsc":"=A" (regs)); + return regs; + /* We need return value, we rely on CC to optimise out needless subf calls */ + /* Note that "rdtsc" is relatively slow OP and stalls the CPU pipes, so use it wisely */ +} + +#elif defined(__alpha) +static inline hrtime_t +get_tick(void) +{ + hrtime_t regs; + asm volatile ("rpcc $0":"=A" (regs)); /* I'm not sure of syntax */ + return regs; +} +#else +#warning Unsupported CPU. Define function get_tick(). Disabling USE_XPROF_STATS... +#undef USE_XPROF_STATS +#endif + +#endif /* USE_XPROF_STATS - maybe disabled above */ + +#ifdef USE_XPROF_STATS + +typedef enum { + XPROF_PROF_UNACCOUNTED, + XPROF_PROF_OVERHEAD, + XPROF_hash_lookup, + XPROF_splay_splay, + XPROF_xmalloc, + XPROF_malloc, + XPROF_xfree, + XPROF_xxfree, + XPROF_xrealloc, + XPROF_xcalloc, + XPROF_calloc, + XPROF_xstrdup, + XPROF_xstrndup, + XPROF_xstrncpy, + XPROF_xcountws, + XPROF_memPoolChunkNew, + XPROF_memPoolAlloc, + XPROF_memPoolFree, + XPROF_memPoolClean, + XPROF_aclMatchAclList, + XPROF_aclCheckFast, + XPROF_comm_open, + XPROF_comm_connect_addr, + XPROF_comm_accept, + XPROF_comm_close, + XPROF_comm_udp_sendto, + XPROF_commHandleWrite, + XPROF_comm_check_incoming, + XPROF_comm_poll_prep_pfds, + XPROF_comm_poll_normal, + XPROF_comm_handle_ready_fd, + XPROF_comm_read_handler, + XPROF_comm_write_handler, + XPROF_storeGet, + XPROF_storeMaintainSwapSpace, + XPROF_storeRelease, + XPROF_diskHandleWrite, + XPROF_diskHandleRead, + XPROF_file_open, + XPROF_file_read, + XPROF_file_write, + XPROF_file_close, + XPROF_LAST +} xprof_type; + +#define XP_NOBEST 9999999999 + +typedef struct _xprof_stats_node xprof_stats_node; +typedef struct _xprof_stats_data xprof_stats_data; + +struct _xprof_stats_data { + hrtime_t start; + hrtime_t stop; + hrtime_t delta; + hrtime_t best; + hrtime_t worst; + hrtime_t count; + long long summ; +}; + +struct _xprof_stats_node { + const char *name; + xprof_stats_data accu; + xprof_stats_data hist; +}; + +typedef xprof_stats_node TimersArray[1]; + +/* public Data */ +extern TimersArray *xprof_Timers; +extern int xprof_nesting; + +/* Exported functions */ +extern void xprof_start(xprof_type type, const char *timer); +extern void xprof_stop(xprof_type type, const char *timer); +extern void xprof_event(void *data); + +#define PROF_start(type) xprof_start(XPROF_##type, #type) +#define PROF_stop(type) xprof_stop(XPROF_##type, #type) + +#else /* USE_XPROF_STATS */ + +#define PROF_start(ARGS) ((void)0) +#define PROF_stop(ARGS) ((void)0) + +#endif /* USE_XPROF_STATS */ + +#endif /* _PROFILING_H_ */ diff --git a/lib/Makefile.am b/lib/Makefile.am index f5239cc0e9..f8079a6eb1 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,8 +1,14 @@ ## Process this file with automake to produce Makefile.in # -# $Id: Makefile.am,v 1.4 2002/04/06 08:49:26 adrian Exp $ +# $Id: Makefile.am,v 1.5 2002/10/02 11:06:30 robertc Exp $ # +if ENABLE_XPROF_STATS +XPROF_STATS_SOURCE = Profiler.c +else +XPROF_STATS_SOURCE = +endif + if NEED_OWN_SNPRINTF SNPRINTFSOURCE=snprintf.c else @@ -24,6 +30,7 @@ noinst_LIBRARIES = \ @LIBREGEX@ EXTRA_libmiscutil_a_SOURCES = \ md5.c \ + Profiler.c \ snprintf.c libmiscutil_a_SOURCES = \ MemPool.c \ @@ -46,7 +53,8 @@ libmiscutil_a_SOURCES = \ Stack.c \ stub_memaccount.c \ util.c \ - uudecode.c + uudecode.c \ + $(XPROF_STATS_SOURCE) libmiscutil_a_LIBADD = \ @LIBOBJS@ # $(top_srcdir)/include/version.h should be a dependency diff --git a/lib/Makefile.in b/lib/Makefile.in index 900248f236..0464f9e846 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -14,7 +14,7 @@ @SET_MAKE@ # -# $Id: Makefile.in,v 1.67 2002/09/30 00:23:01 hno Exp $ +# $Id: Makefile.in,v 1.68 2002/10/02 11:06:30 robertc Exp $ # SHELL = @SHELL@ @@ -117,6 +117,9 @@ am__quote = @am__quote@ install_sh = @install_sh@ makesnmplib = @makesnmplib@ +@ENABLE_XPROF_STATS_TRUE@XPROF_STATS_SOURCE = Profiler.c +@ENABLE_XPROF_STATS_FALSE@XPROF_STATS_SOURCE = + @NEED_OWN_SNPRINTF_TRUE@SNPRINTFSOURCE = snprintf.c @NEED_OWN_SNPRINTF_FALSE@SNPRINTFSOURCE = @NEED_OWN_MD5_TRUE@MD5SOURCE = md5.c @@ -134,6 +137,7 @@ noinst_LIBRARIES = \ EXTRA_libmiscutil_a_SOURCES = \ md5.c \ + Profiler.c \ snprintf.c libmiscutil_a_SOURCES = \ @@ -157,7 +161,8 @@ libmiscutil_a_SOURCES = \ Stack.c \ stub_memaccount.c \ util.c \ - uudecode.c + uudecode.c \ + $(XPROF_STATS_SOURCE) libmiscutil_a_LIBADD = \ @LIBOBJS@ @@ -193,6 +198,8 @@ libmiscutil_a_DEPENDENCIES = @LIBOBJS@ @NEED_OWN_MD5_FALSE@am__objects_1 = @NEED_OWN_SNPRINTF_TRUE@am__objects_2 = snprintf.$(OBJEXT) @NEED_OWN_SNPRINTF_FALSE@am__objects_2 = +@ENABLE_XPROF_STATS_TRUE@am__objects_3 = Profiler.$(OBJEXT) +@ENABLE_XPROF_STATS_FALSE@am__objects_3 = am_libmiscutil_a_OBJECTS = MemPool.$(OBJEXT) Array.$(OBJEXT) \ base64.$(OBJEXT) getfullhostname.$(OBJEXT) hash.$(OBJEXT) \ heap.$(OBJEXT) html_quote.$(OBJEXT) iso3307.$(OBJEXT) \ @@ -200,7 +207,7 @@ am_libmiscutil_a_OBJECTS = MemPool.$(OBJEXT) Array.$(OBJEXT) \ rfc1123.$(OBJEXT) rfc1738.$(OBJEXT) rfc2617.$(OBJEXT) \ safe_inet_addr.$(OBJEXT) $(am__objects_2) splay.$(OBJEXT) \ Stack.$(OBJEXT) stub_memaccount.$(OBJEXT) util.$(OBJEXT) \ - uudecode.$(OBJEXT) + uudecode.$(OBJEXT) $(am__objects_3) libmiscutil_a_OBJECTS = $(am_libmiscutil_a_OBJECTS) libntlmauth_a_AR = $(AR) cru libntlmauth_a_DEPENDENCIES = @LIBOBJS@ @@ -218,19 +225,20 @@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/cfgaux/depcomp @AMDEP_TRUE@DEP_FILES = $(DEPDIR)/Array.Po $(DEPDIR)/GNUregex.Po \ -@AMDEP_TRUE@ $(DEPDIR)/MemPool.Po $(DEPDIR)/Stack.Po \ -@AMDEP_TRUE@ $(DEPDIR)/base64.Po $(DEPDIR)/dlmalloc.Po \ -@AMDEP_TRUE@ $(DEPDIR)/drand48.Po $(DEPDIR)/getfullhostname.Po \ -@AMDEP_TRUE@ $(DEPDIR)/hash.Po $(DEPDIR)/heap.Po \ -@AMDEP_TRUE@ $(DEPDIR)/html_quote.Po $(DEPDIR)/inet_ntoa.Po \ -@AMDEP_TRUE@ $(DEPDIR)/iso3307.Po $(DEPDIR)/md5.Po \ -@AMDEP_TRUE@ $(DEPDIR)/ntlmauth.Po $(DEPDIR)/radix.Po \ -@AMDEP_TRUE@ $(DEPDIR)/rfc1035.Po $(DEPDIR)/rfc1123.Po \ -@AMDEP_TRUE@ $(DEPDIR)/rfc1738.Po $(DEPDIR)/rfc2617.Po \ -@AMDEP_TRUE@ $(DEPDIR)/safe_inet_addr.Po $(DEPDIR)/snprintf.Po \ -@AMDEP_TRUE@ $(DEPDIR)/splay.Po $(DEPDIR)/strerror.Po \ -@AMDEP_TRUE@ $(DEPDIR)/stub_memaccount.Po $(DEPDIR)/tempnam.Po \ -@AMDEP_TRUE@ $(DEPDIR)/util.Po $(DEPDIR)/uudecode.Po +@AMDEP_TRUE@ $(DEPDIR)/MemPool.Po $(DEPDIR)/Profiler.Po \ +@AMDEP_TRUE@ $(DEPDIR)/Stack.Po $(DEPDIR)/base64.Po \ +@AMDEP_TRUE@ $(DEPDIR)/dlmalloc.Po $(DEPDIR)/drand48.Po \ +@AMDEP_TRUE@ $(DEPDIR)/getfullhostname.Po $(DEPDIR)/hash.Po \ +@AMDEP_TRUE@ $(DEPDIR)/heap.Po $(DEPDIR)/html_quote.Po \ +@AMDEP_TRUE@ $(DEPDIR)/inet_ntoa.Po $(DEPDIR)/iso3307.Po \ +@AMDEP_TRUE@ $(DEPDIR)/md5.Po $(DEPDIR)/ntlmauth.Po \ +@AMDEP_TRUE@ $(DEPDIR)/radix.Po $(DEPDIR)/rfc1035.Po \ +@AMDEP_TRUE@ $(DEPDIR)/rfc1123.Po $(DEPDIR)/rfc1738.Po \ +@AMDEP_TRUE@ $(DEPDIR)/rfc2617.Po $(DEPDIR)/safe_inet_addr.Po \ +@AMDEP_TRUE@ $(DEPDIR)/snprintf.Po $(DEPDIR)/splay.Po \ +@AMDEP_TRUE@ $(DEPDIR)/strerror.Po $(DEPDIR)/stub_memaccount.Po \ +@AMDEP_TRUE@ $(DEPDIR)/tempnam.Po $(DEPDIR)/util.Po \ +@AMDEP_TRUE@ $(DEPDIR)/uudecode.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) @@ -285,6 +293,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/Array.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/GNUregex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/MemPool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/Profiler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/Stack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/dlmalloc.Po@am__quote@ diff --git a/lib/Profiler.c b/lib/Profiler.c new file mode 100644 index 0000000000..025c81454a --- /dev/null +++ b/lib/Profiler.c @@ -0,0 +1,183 @@ + +/* + * $Id: Profiler.c,v 1.1 2002/10/02 11:06:30 robertc Exp $ + * + * DEBUG: section 81 CPU Profiling Routines + * AUTHOR: Andres Kroonmaa, Sep.2000 + * + * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from the + * Internet community. Development is led by Duane Wessels of the + * National Laboratory for Applied Network Research and funded by the + * National Science Foundation. Squid is Copyrighted (C) 1998 by + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ + +/* + * CPU Profiling implementation. + * + * This library implements the Probes needed to gather stats. + * See src/ProfStats.c which implements historical recording and + * presentation in CacheMgr.cgi. + * + * For timing we prefer on-CPU ops that retrieve cpu ticks counter. + * For Intel, this is "rdtsc", which is 64-bit counter that virtually + * never wraps. For alpha, this is "rpcc" which is 32-bit counter and + * wraps every few seconds. Currently, no handling of wrapping counters + * is implemented. Other CPU's are also not covered. Potentially all + * modern CPU's has similar counters. + * + * Usage. + * Insert macro PROF_state(probename) in strategic places in code. + * PROF_start(probename); + * ... section of code measured ... + * PROF_stop(probename); + * + * probename must be added to profiling.h into xprof_type enum list + * with prepended "XPROF_" string. + * + * Description. + * PROF gathers stats per probename into structures. It indexes these + * structures by enum type index in an array. + * + * PROF records best, best, average and worst values for delta time, + * also, if UNACCED is defined, it measures "empty" time during which + * no probes are in measuring state. This allows to see time "unaccounted" + * for. If OVERHEAD is defined, additional calculations are made at every + * probe to measure approximate overhead of the probe code itself. + * + * Probe data is stored in linked-list, so the more probes you define, + * the more overhead is added to find the deepest nested probe. To reduce + * average overhead, linked list is manipulated each time PR_start is + * called, so that probe just started is moved 1 position up in linkedlist. + * This way frequently used probes are moved closer to the head of list, + * reducing average overhead. + * Note that all overhead is on the scale of one hundred of CPU clock + * ticks, which on the scale of submicroseconds. Yet, to optimise really + * fast and frequent sections of code, we want to reduce this overhead + * to absolute minimum possible. + * + * For actual measurements, probe overhead cancels out mostly. Still, + * do not take the measured times as facts, they should be viewed in + * relative comparison to overall CPU time and on the same platform. + * + * Every 1 second, Event within squid is called that parses gathered + * statistics of every probe, and accumulates that into historical + * structures for last 1,5,30 secs, 1,5,30 mins, and 1,5 and 24 hours. + * Each second active probe stats are reset, and only historical data + * is presented in cachemgr output. + * + * Reading stats. + * "Worst case" may be misleading. Anything can happen at any section + * of code that could delay reaching to probe stop. For eg. system may + * need to service interrupt routine, task switch could occur, or page + * fault needs to be handled. In this sense, this is quite meaningless + * metric. "Best case" shows fastest completion of probe section, and + * is also somewhat useless, unless you know that amount of work is + * constant. Best metric to watch is "average time" and total cumulated + * time in given timeframe, which really show percentage of time spent + * in given section of code, and its average completion time. This data + * could be used to detect bottlenecks withing squid and optimise them. + * + * TOTALS are quite off reality. Its there just to summarise cumulative + * times and percent column. Percent values over 100% shows that there + * have been some probes nested into each other. + * + */ + +#include "profiling.h" + +#ifdef USE_XPROF_STATS + + +#if HAVE_GNUMALLLOC_H +#include +#elif HAVE_MALLOC_H && !defined(_SQUID_FREEBSD_) && !defined(_SQUID_NEXT_) +#include +#endif +#if HAVE_UNISTD_H +#include +#endif + +/* Exported Data */ +TimersArray *xprof_Timers = NULL; +int xprof_nesting = 0; + +/* Private stuff */ + +static inline void +xprof_update(xprof_stats_data * head) +{ + head->delta = head->stop - head->start; + if (head->delta < head->best) + head->best = head->delta; + if (head->worst < head->delta) + head->worst = head->delta; + head->summ += head->delta; + head->count++; +} + +static xprof_stats_data *xp_UNACCOUNTED; +static int xprof_inited = 0; + +static void +xprof_InitLib(void) +{ + if (xprof_inited) + return; + + xprof_Timers = calloc(XPROF_LAST + 2, sizeof(xprof_stats_node)); + + xprof_Timers[XPROF_PROF_UNACCOUNTED]->name = "PROF_UNACCOUNTED"; + xprof_Timers[XPROF_PROF_UNACCOUNTED]->accu.start = get_tick(); + xp_UNACCOUNTED = &xprof_Timers[XPROF_PROF_UNACCOUNTED]->accu; + xprof_inited = 1; +} + +void +xprof_start(xprof_type type, const char *timer) +{ + if (!xprof_inited) + xprof_InitLib(); + + xprof_Timers[type]->accu.start = get_tick(); + xprof_Timers[type]->name = timer; + + if (xprof_nesting++) + return; + xp_UNACCOUNTED->stop = xprof_Timers[type]->accu.start; + xprof_update(xp_UNACCOUNTED); +} + +void +xprof_stop(xprof_type type, const char *timer) +{ + xprof_Timers[type]->accu.stop = get_tick(); + xprof_update(&xprof_Timers[type]->accu); + if (--xprof_nesting) + return; + xp_UNACCOUNTED->start = xprof_Timers[type]->accu.stop; + xprof_nesting = 0; +} + +#endif /* USE_XPROF_STATS */ diff --git a/lib/hash.c b/lib/hash.c index b5942af4ef..0108471059 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -1,6 +1,6 @@ /* - * $Id: hash.c,v 1.12 2001/03/07 17:57:37 wessels Exp $ + * $Id: hash.c,v 1.13 2002/10/02 11:06:30 robertc Exp $ * * DEBUG: section 0 Hash Tables * AUTHOR: Harvest Derived @@ -61,6 +61,7 @@ #include "hash.h" #include "util.h" +#include "profiling.h" static void hash_next_bucket(hash_table * hid); @@ -183,13 +184,17 @@ hash_lookup(hash_table * hid, const void *k) { hash_link *walker; int b; + PROF_start(hash_lookup); assert(k != NULL); b = hid->hash(k, hid->size); for (walker = hid->buckets[b]; walker != NULL; walker = walker->next) { - if ((hid->cmp) (k, walker->key) == 0) + if ((hid->cmp) (k, walker->key) == 0) { + PROF_stop(hash_lookup); return (walker); + } assert(walker != walker->next); } + PROF_stop(hash_lookup); return NULL; } diff --git a/lib/util.c b/lib/util.c index 8137441c51..86d043605b 100644 --- a/lib/util.c +++ b/lib/util.c @@ -1,6 +1,6 @@ /* - * $Id: util.c,v 1.86 2002/08/12 01:21:06 hno Exp $ + * $Id: util.c,v 1.87 2002/10/02 11:06:30 robertc Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -36,6 +36,7 @@ #define _etext etext #include "config.h" +#include "profiling.h" #if HAVE_STDIO_H #include @@ -427,10 +428,14 @@ xmalloc(size_t sz) { void *p; + PROF_start(xmalloc); if (sz < 1) sz = 1; - if ((p = malloc(sz)) == NULL) { + PROF_start(malloc); + p = malloc(sz); + PROF_stop(malloc); + if (p == NULL) { if (failure_notify) { snprintf(msg, 128, "xmalloc: Unable to allocate %d bytes!\n", (int) sz); @@ -453,6 +458,7 @@ xmalloc(size_t sz) if (tracefp) fprintf(tracefp, "m:%d:%p\n", sz, p); #endif + PROF_stop(xmalloc); return (p); } @@ -462,6 +468,7 @@ xmalloc(size_t sz) void xfree(void *s) { + PROF_start(xfree); #if XMALLOC_TRACE xmalloc_show_trace(s, -1); #endif @@ -476,13 +483,15 @@ xfree(void *s) if (tracefp && s) fprintf(tracefp, "f:%p\n", s); #endif + PROF_stop(xfree); } /* xxfree() - like xfree(), but we already know s != NULL */ void xxfree(const void *s_const) { - void *s = (void *) s_const; + void *s = (void *)s_const; + PROF_start(xxfree); #if XMALLOC_TRACE xmalloc_show_trace(s, -1); #endif @@ -494,6 +503,7 @@ xxfree(const void *s_const) if (tracefp && s) fprintf(tracefp, "f:%p\n", s); #endif + PROF_stop(xxfree); } /* @@ -505,6 +515,7 @@ xrealloc(void *s, size_t sz) { void *p; + PROF_start(xrealloc); #if XMALLOC_TRACE xmalloc_show_trace(s, -1); #endif @@ -538,6 +549,7 @@ xrealloc(void *s, size_t sz) if (tracefp) /* new ptr, old ptr, new size */ fprintf(tracefp, "r:%p:%p:%d\n", p, s, sz); #endif + PROF_stop(xrealloc); return (p); } @@ -550,11 +562,15 @@ xcalloc(size_t n, size_t sz) { void *p; + PROF_start(xcalloc); if (n < 1) n = 1; if (sz < 1) sz = 1; - if ((p = calloc(n, sz)) == NULL) { + PROF_start(calloc); + p = calloc(n, sz); + PROF_stop(calloc); + if (p == NULL) { if (failure_notify) { snprintf(msg, 128, "xcalloc: Unable to allocate %u blocks of %u bytes!\n", (unsigned int) n, (unsigned int) sz); @@ -577,6 +593,7 @@ xcalloc(size_t n, size_t sz) if (tracefp) fprintf(tracefp, "c:%u:%u:%p\n", (unsigned int) n, (unsigned int) sz, p); #endif + PROF_stop(xcalloc); return (p); } @@ -588,6 +605,8 @@ char * xstrdup(const char *s) { size_t sz; + void *p; + PROF_start(xstrdup); if (s == NULL) { if (failure_notify) { (*failure_notify) ("xstrdup: tried to dup a NULL pointer!\n"); @@ -598,7 +617,9 @@ xstrdup(const char *s) } /* copy string, including terminating character */ sz = strlen(s) + 1; - return memcpy(xmalloc(sz), s, sz); + p = memcpy(xmalloc(sz), s, sz); + PROF_stop(xstrdup); + return p; } /* @@ -608,12 +629,16 @@ char * xstrndup(const char *s, size_t n) { size_t sz; + void *p; + PROF_start(xstrndup); assert(s); assert(n); sz = strlen(s) + 1; if (sz > n) sz = n; - return xstrncpy(xmalloc(sz), s, sz); + p = xstrncpy(xmalloc(sz), s, sz); + PROF_stop(xstrndup); + return p; } /* @@ -674,12 +699,14 @@ char * xstrncpy(char *dst, const char *src, size_t n) { char *r = dst; + PROF_start(xstrncpy); if (!n || !dst) return dst; if (src) while (--n != 0 && *src != '\0') *dst++ = *src++; *dst = '\0'; + PROF_stop(xstrncpy); return r; } @@ -688,12 +715,14 @@ size_t xcountws(const char *str) { size_t count = 0; + PROF_start(xcountws); if (str) { while (xisspace(*str)) { str++; count++; } } + PROF_stop(xcountws); return count; } diff --git a/src/Makefile.am b/src/Makefile.am index 9f78535255..71ef90610f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.am,v 1.33 2002/09/29 12:55:52 hno Exp $ +# $Id: Makefile.am,v 1.34 2002/10/02 11:06:31 robertc Exp $ # # Uncomment and customize the following to suit your needs: # @@ -26,6 +26,12 @@ else DELAY_POOL_SOURCE = endif +if ENABLE_XPROF_STATS +XPROF_STATS_SOURCE = ProfStats.c +else +XPROF_STATS_SOURCE = +endif + if ENABLE_HTCP HTCPSOURCE = htcp.c endif @@ -178,6 +184,7 @@ squid_SOURCES = \ neighbors.c \ net_db.c \ Packer.c \ + $(XPROF_STATS_SOURCE) \ pconn.c \ peer_digest.c \ peer_select.c \ diff --git a/src/Makefile.in b/src/Makefile.in index 4c04bf95bf..b961a52b5f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -16,7 +16,7 @@ # # Makefile for the Squid Object Cache server # -# $Id: Makefile.in,v 1.247 2002/09/30 00:23:55 hno Exp $ +# $Id: Makefile.in,v 1.248 2002/10/02 11:06:31 robertc Exp $ # # Uncomment and customize the following to suit your needs: # @@ -132,6 +132,9 @@ makesnmplib = @makesnmplib@ @USE_DELAY_POOLS_TRUE@DELAY_POOL_SOURCE = delay_pools.c @USE_DELAY_POOLS_FALSE@DELAY_POOL_SOURCE = +@ENABLE_XPROF_STATS_TRUE@XPROF_STATS_SOURCE = ProfStats.c +@ENABLE_XPROF_STATS_FALSE@XPROF_STATS_SOURCE = + @ENABLE_HTCP_TRUE@HTCPSOURCE = htcp.c @MAKE_LEAKFINDER_TRUE@LEAKFINDERSOURCE = leakfinder.c @@ -272,6 +275,7 @@ squid_SOURCES = \ neighbors.c \ net_db.c \ Packer.c \ + $(XPROF_STATS_SOURCE) \ pconn.c \ peer_digest.c \ peer_select.c \ @@ -467,21 +471,23 @@ pinger_OBJECTS = $(am_pinger_OBJECTS) $(nodist_pinger_OBJECTS) pinger_LDADD = $(LDADD) pinger_DEPENDENCIES = pinger_LDFLAGS = -@USE_DELAY_POOLS_FALSE@am__objects_3 = -@USE_DELAY_POOLS_TRUE@am__objects_3 = delay_pools.$(OBJEXT) -@USE_DNSSERVER_FALSE@am__objects_4 = dns_internal.$(OBJEXT) -@USE_DNSSERVER_TRUE@am__objects_4 = dns.$(OBJEXT) -@ENABLE_HTCP_TRUE@am__objects_5 = htcp.$(OBJEXT) -@MAKE_LEAKFINDER_TRUE@am__objects_6 = leakfinder.$(OBJEXT) -@MAKE_LEAKFINDER_FALSE@am__objects_6 = -@USE_SNMP_TRUE@am__objects_7 = snmp_core.$(OBJEXT) snmp_agent.$(OBJEXT) -@USE_SNMP_FALSE@am__objects_7 = -@ENABLE_SSL_FALSE@am__objects_8 = -@ENABLE_SSL_TRUE@am__objects_8 = ssl_support.$(OBJEXT) -@ENABLE_UNLINKD_TRUE@am__objects_9 = unlinkd.$(OBJEXT) -@ENABLE_UNLINKD_FALSE@am__objects_9 = -@ENABLE_WIN32SPECIFIC_FALSE@am__objects_10 = -@ENABLE_WIN32SPECIFIC_TRUE@am__objects_10 = win32.$(OBJEXT) +@USE_DELAY_POOLS_FALSE@am__objects_4 = +@USE_DELAY_POOLS_TRUE@am__objects_4 = delay_pools.$(OBJEXT) +@USE_DNSSERVER_FALSE@am__objects_5 = dns_internal.$(OBJEXT) +@USE_DNSSERVER_TRUE@am__objects_5 = dns.$(OBJEXT) +@ENABLE_HTCP_TRUE@am__objects_6 = htcp.$(OBJEXT) +@MAKE_LEAKFINDER_TRUE@am__objects_7 = leakfinder.$(OBJEXT) +@MAKE_LEAKFINDER_FALSE@am__objects_7 = +@ENABLE_XPROF_STATS_TRUE@am__objects_3 = ProfStats.$(OBJEXT) +@ENABLE_XPROF_STATS_FALSE@am__objects_3 = +@USE_SNMP_TRUE@am__objects_8 = snmp_core.$(OBJEXT) snmp_agent.$(OBJEXT) +@USE_SNMP_FALSE@am__objects_8 = +@ENABLE_SSL_FALSE@am__objects_9 = +@ENABLE_SSL_TRUE@am__objects_9 = ssl_support.$(OBJEXT) +@ENABLE_UNLINKD_TRUE@am__objects_10 = unlinkd.$(OBJEXT) +@ENABLE_UNLINKD_FALSE@am__objects_10 = +@ENABLE_WIN32SPECIFIC_FALSE@am__objects_11 = +@ENABLE_WIN32SPECIFIC_TRUE@am__objects_11 = win32.$(OBJEXT) am_squid_OBJECTS = access_log.$(OBJEXT) acl.$(OBJEXT) asn.$(OBJEXT) \ authenticate.$(OBJEXT) cache_cf.$(OBJEXT) CacheDigest.$(OBJEXT) \ cache_manager.$(OBJEXT) carp.$(OBJEXT) cbdata.$(OBJEXT) \ @@ -489,11 +495,11 @@ am_squid_OBJECTS = access_log.$(OBJEXT) acl.$(OBJEXT) asn.$(OBJEXT) \ client_side_reply.$(OBJEXT) client_side_request.$(OBJEXT) \ clientStream.$(OBJEXT) comm.$(OBJEXT) comm_select.$(OBJEXT) \ comm_poll.$(OBJEXT) comm_kqueue.$(OBJEXT) debug.$(OBJEXT) \ - $(am__objects_3) disk.$(OBJEXT) $(am__objects_4) \ + $(am__objects_4) disk.$(OBJEXT) $(am__objects_5) \ errorpage.$(OBJEXT) ETag.$(OBJEXT) event.$(OBJEXT) \ external_acl.$(OBJEXT) fd.$(OBJEXT) filemap.$(OBJEXT) \ forward.$(OBJEXT) fqdncache.$(OBJEXT) ftp.$(OBJEXT) \ - gopher.$(OBJEXT) helper.$(OBJEXT) $(am__objects_5) \ + gopher.$(OBJEXT) helper.$(OBJEXT) $(am__objects_6) \ http.$(OBJEXT) HttpStatusLine.$(OBJEXT) HttpHdrCc.$(OBJEXT) \ HttpHdrRange.$(OBJEXT) HttpHdrContRange.$(OBJEXT) \ HttpHeader.$(OBJEXT) HttpHeaderTools.$(OBJEXT) \ @@ -501,22 +507,22 @@ am_squid_OBJECTS = access_log.$(OBJEXT) acl.$(OBJEXT) asn.$(OBJEXT) \ HttpRequest.$(OBJEXT) icmp.$(OBJEXT) icp_v2.$(OBJEXT) \ icp_v3.$(OBJEXT) ident.$(OBJEXT) internal.$(OBJEXT) \ ipc.$(OBJEXT) ipcache.$(OBJEXT) IPInterception.$(OBJEXT) \ - $(am__objects_6) logfile.$(OBJEXT) main.$(OBJEXT) mem.$(OBJEXT) \ + $(am__objects_7) logfile.$(OBJEXT) main.$(OBJEXT) mem.$(OBJEXT) \ MemBuf.$(OBJEXT) mime.$(OBJEXT) multicast.$(OBJEXT) \ neighbors.$(OBJEXT) net_db.$(OBJEXT) Packer.$(OBJEXT) \ - pconn.$(OBJEXT) peer_digest.$(OBJEXT) peer_select.$(OBJEXT) \ - redirect.$(OBJEXT) referer.$(OBJEXT) refresh.$(OBJEXT) \ - send-announce.$(OBJEXT) $(am__objects_7) ssl.$(OBJEXT) \ - $(am__objects_8) stat.$(OBJEXT) StatHist.$(OBJEXT) \ - String.$(OBJEXT) stmem.$(OBJEXT) store.$(OBJEXT) \ - store_io.$(OBJEXT) store_client.$(OBJEXT) \ + $(am__objects_3) pconn.$(OBJEXT) peer_digest.$(OBJEXT) \ + peer_select.$(OBJEXT) redirect.$(OBJEXT) referer.$(OBJEXT) \ + refresh.$(OBJEXT) send-announce.$(OBJEXT) $(am__objects_8) \ + ssl.$(OBJEXT) $(am__objects_9) stat.$(OBJEXT) \ + StatHist.$(OBJEXT) String.$(OBJEXT) stmem.$(OBJEXT) \ + store.$(OBJEXT) store_io.$(OBJEXT) store_client.$(OBJEXT) \ store_digest.$(OBJEXT) store_dir.$(OBJEXT) \ store_key_md5.$(OBJEXT) store_log.$(OBJEXT) \ store_rebuild.$(OBJEXT) store_swapin.$(OBJEXT) \ store_swapmeta.$(OBJEXT) store_swapout.$(OBJEXT) \ - tools.$(OBJEXT) $(am__objects_9) url.$(OBJEXT) urn.$(OBJEXT) \ + tools.$(OBJEXT) $(am__objects_10) url.$(OBJEXT) urn.$(OBJEXT) \ useragent.$(OBJEXT) wais.$(OBJEXT) wccp.$(OBJEXT) \ - whois.$(OBJEXT) $(am__objects_10) + whois.$(OBJEXT) $(am__objects_11) nodist_squid_OBJECTS = repl_modules.$(OBJEXT) auth_modules.$(OBJEXT) \ store_modules.$(OBJEXT) globals.$(OBJEXT) \ string_arrays.$(OBJEXT) @@ -544,15 +550,16 @@ depcomp = $(SHELL) $(top_srcdir)/cfgaux/depcomp @AMDEP_TRUE@ $(DEPDIR)/HttpReply.Po $(DEPDIR)/HttpRequest.Po \ @AMDEP_TRUE@ $(DEPDIR)/HttpStatusLine.Po \ @AMDEP_TRUE@ $(DEPDIR)/IPInterception.Po $(DEPDIR)/MemBuf.Po \ -@AMDEP_TRUE@ $(DEPDIR)/Packer.Po $(DEPDIR)/StatHist.Po \ -@AMDEP_TRUE@ $(DEPDIR)/String.Po $(DEPDIR)/access_log.Po \ -@AMDEP_TRUE@ $(DEPDIR)/acl.Po $(DEPDIR)/asn.Po \ -@AMDEP_TRUE@ $(DEPDIR)/auth_modules.Po $(DEPDIR)/authenticate.Po \ -@AMDEP_TRUE@ $(DEPDIR)/cache_cf.Po $(DEPDIR)/cache_manager.Po \ -@AMDEP_TRUE@ $(DEPDIR)/cachemgr.Po $(DEPDIR)/carp.Po \ -@AMDEP_TRUE@ $(DEPDIR)/cbdata.Po $(DEPDIR)/cf_gen.Po \ -@AMDEP_TRUE@ $(DEPDIR)/client.Po $(DEPDIR)/clientStream.Po \ -@AMDEP_TRUE@ $(DEPDIR)/client_db.Po $(DEPDIR)/client_side.Po \ +@AMDEP_TRUE@ $(DEPDIR)/Packer.Po $(DEPDIR)/ProfStats.Po \ +@AMDEP_TRUE@ $(DEPDIR)/StatHist.Po $(DEPDIR)/String.Po \ +@AMDEP_TRUE@ $(DEPDIR)/access_log.Po $(DEPDIR)/acl.Po \ +@AMDEP_TRUE@ $(DEPDIR)/asn.Po $(DEPDIR)/auth_modules.Po \ +@AMDEP_TRUE@ $(DEPDIR)/authenticate.Po $(DEPDIR)/cache_cf.Po \ +@AMDEP_TRUE@ $(DEPDIR)/cache_manager.Po $(DEPDIR)/cachemgr.Po \ +@AMDEP_TRUE@ $(DEPDIR)/carp.Po $(DEPDIR)/cbdata.Po \ +@AMDEP_TRUE@ $(DEPDIR)/cf_gen.Po $(DEPDIR)/client.Po \ +@AMDEP_TRUE@ $(DEPDIR)/clientStream.Po $(DEPDIR)/client_db.Po \ +@AMDEP_TRUE@ $(DEPDIR)/client_side.Po \ @AMDEP_TRUE@ $(DEPDIR)/client_side_reply.Po \ @AMDEP_TRUE@ $(DEPDIR)/client_side_request.Po $(DEPDIR)/comm.Po \ @AMDEP_TRUE@ $(DEPDIR)/comm_kqueue.Po $(DEPDIR)/comm_poll.Po \ @@ -742,6 +749,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/IPInterception.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/MemBuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/Packer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/ProfStats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/StatHist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/String.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/access_log.Po@am__quote@ diff --git a/src/ProfStats.cc b/src/ProfStats.cc new file mode 100644 index 0000000000..3ceb7a21b8 --- /dev/null +++ b/src/ProfStats.cc @@ -0,0 +1,293 @@ + +/* + * $Id: ProfStats.cc,v 1.1 2002/10/02 11:06:31 robertc Exp $ + * + * DEBUG: section 81 CPU Profiling Routines + * AUTHOR: Andres Kroonmaa + * + * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ + * ---------------------------------------------------------- + * + * Squid is the result of efforts by numerous individuals from the + * Internet community. Development is led by Duane Wessels of the + * National Laboratory for Applied Network Research and funded by the + * National Science Foundation. Squid is Copyrighted (C) 1998 by + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. + * + */ + +#include "squid.h" + +#ifdef USE_XPROF_STATS + +/* Private stuff */ + +#define MAX_SORTLIST 200 + +static hrtime_t xprof_delta = 0; +static hrtime_t xprof_start_t = 0; +static hrtime_t xprof_verystart = 0; +static hrtime_t xprof_average_delta = 0; +static int xprof_events = 0; +static int xprof_inited = 0; +static xprof_stats_data Totals; + +static TimersArray *xprof_stats_avg1sec = NULL; +static TimersArray *xprof_stats_avg5sec = NULL; +static TimersArray *xprof_stats_avg30sec = NULL; +static TimersArray *xprof_stats_avg1min = NULL; +static TimersArray *xprof_stats_avg5min = NULL; +static TimersArray *xprof_stats_avg30min = NULL; +static TimersArray *xprof_stats_avg1hour = NULL; +static TimersArray *xprof_stats_avg5hour = NULL; +static TimersArray *xprof_stats_avg24hour = NULL; + +static xprof_stats_node *sortlist[XPROF_LAST + 2]; + +static void +xprof_reset(xprof_stats_data * head) +{ + head->summ = 0; + head->count = 0; + head->delta = 0; + head->best = XP_NOBEST; + head->worst = 0; + head->start = 0; + head->stop = 0; +} + +static void +xprof_move(xprof_stats_data * head, xprof_stats_data * hist) +{ + memcpy(hist, head, sizeof(xprof_stats_data)); +} + +static int +xprof_comp(xprof_stats_node ** ii, xprof_stats_node ** jj) +{ + if ((*ii)->hist.summ < (*jj)->hist.summ) + return (1); + if ((*ii)->hist.summ > (*jj)->hist.summ) + return (-1); + + return (0); +} + +static void +xprof_sorthist(TimersArray * xprof_list) +{ + int i; + + for (i = 0; i < XPROF_LAST; i++) { + sortlist[i] = xprof_list[i]; + } + qsort(&sortlist[XPROF_hash_lookup], XPROF_LAST - XPROF_hash_lookup, sizeof(xprof_stats_node *), (QS *) xprof_comp); +} + +static double time_frame; + +static void +xprof_show_item(StoreEntry * sentry, const char *name, xprof_stats_data * hist) +{ + storeAppendPrintf(sentry, + "%s\t %llu\t %llu\t %llu\t %llu\t %llu\t %.2f\t %6.3f\t\n", + name, + hist->count, + hist->summ, + (hist->best != XP_NOBEST ? hist->best : 0), + hist->count ? hist->summ / hist->count : 0, + hist->worst, + hist->count / time_frame, + dpercent((double) hist->summ, (double) hist->delta)); +} + +static void +xprof_summary_item(StoreEntry * sentry, char *descr, TimersArray * list) +{ + int i; + xprof_stats_node **hist; + xprof_stats_data *show; + xprof_reset(&Totals); + xprof_sorthist(list); + hist = &sortlist[0]; + + show = &hist[0]->hist; + if (!hist[0]->hist.delta) + show = &hist[0]->accu; + + time_frame = (double) show->delta / (double) xprof_average_delta; + + storeAppendPrintf(sentry, "\n%s:", descr); + storeAppendPrintf(sentry, " (Cumulated time: %llu, %.2f sec)\n", + show->delta, + time_frame + ); + storeAppendPrintf(sentry, + "Probe Name\t Events\t cumulated time \t best case \t average \t worst case\t Rate / sec \t %% in int\n"); + + for (i = 0; i < XPROF_LAST; i++) { + if (!hist[i]->name) + continue; + + show = &hist[i]->hist; + if (!show->count) + continue; + xprof_show_item(sentry, hist[i]->name, show); + + Totals.count += show->count; + Totals.summ += show->summ; + Totals.best += (show->best != XP_NOBEST ? show->best : 0); + Totals.worst += show->worst; + Totals.delta = (show->delta > Totals.delta ? show->delta : Totals.delta); + } + xprof_show_item(sentry, "TOTALS", &Totals); +} + +static void +xprof_average(TimersArray ** list, int secs) +{ + int i; + TimersArray *head = xprof_Timers; + TimersArray *hist; + hrtime_t now; + hrtime_t keep; + int doavg = (xprof_events % secs); + + if (!*list) + *list = xcalloc(XPROF_LAST, sizeof(xprof_stats_node)); + + hist = *list; + now = get_tick(); + + for (i = 0; i < XPROF_LAST; i++) { + hist[i]->name = head[i]->name; + hist[i]->accu.summ += head[i]->accu.summ; + hist[i]->accu.count += head[i]->accu.count; /* accumulate multisec */ + + if (!hist[i]->accu.best) + hist[i]->accu.best = head[i]->accu.best; + + if (hist[i]->accu.best > head[i]->accu.best) + hist[i]->accu.best = head[i]->accu.best; + + if (hist[i]->accu.worst < head[i]->accu.worst) + hist[i]->accu.worst = head[i]->accu.worst; + + hist[i]->accu.delta += xprof_delta; + if (!doavg) { + /* we have X seconds accumulated */ + xprof_move(&hist[i]->accu, &hist[i]->hist); + xprof_reset(&hist[i]->accu); + + hist[i]->accu.start = now; + } + /* reset 0sec counters */ + if (secs == 1) { + keep = head[i]->accu.start; + xprof_move(&head[i]->accu, &head[i]->hist); + xprof_reset(&head[i]->accu); + hist[i]->accu.delta = 0; + head[i]->accu.start = keep; + } + } +} + +void +xprof_summary(StoreEntry * sentry) +{ + hrtime_t now = get_tick(); + + storeAppendPrintf(sentry, "CPU Profiling Statistics:\n"); + storeAppendPrintf(sentry, + " (CPU times are in arbitrary units, most probably in CPU clock ticks)\n"); + storeAppendPrintf(sentry, + "Probe Name\t Event Count\t last Interval \t Avg Interval \t since squid start \t (since system boot) \n"); + storeAppendPrintf(sentry, "Total\t %lu\t %llu \t %llu \t %llu \t %llu\n", + (long unsigned) xprof_events, + xprof_delta, + xprof_average_delta, + now - xprof_verystart, + now); + + xprof_summary_item(sentry, "Last 1 sec averages", xprof_stats_avg1sec); + xprof_summary_item(sentry, "Last 5 sec averages", xprof_stats_avg5sec); + xprof_summary_item(sentry, "Last 30 sec averages", xprof_stats_avg30sec); + xprof_summary_item(sentry, "Last 1 min averages", xprof_stats_avg1min); + xprof_summary_item(sentry, "Last 5 min averages", xprof_stats_avg5min); + xprof_summary_item(sentry, "Last 30 min averages", xprof_stats_avg30min); + xprof_summary_item(sentry, "Last 1 hour averages", xprof_stats_avg1hour); + xprof_summary_item(sentry, "Last 5 hour averages", xprof_stats_avg5hour); + xprof_summary_item(sentry, "Last 24 hour averages", xprof_stats_avg24hour); +} + +static inline void +xprof_chk_overhead(int samples) +{ + while (samples--) { + PROF_start(PROF_OVERHEAD); + PROF_stop(PROF_OVERHEAD); + } +} + +static hrtime_t now; +static void +xprof_Init(void) +{ + if (xprof_inited) + return; + + xprof_delta = xprof_verystart = xprof_start_t = now; + + xprof_inited = 1; + cachemgrRegister("cpu_profile", "CPU Profiling Stats", xprof_summary, 0, 1); +} + +void +xprof_event(void *data) +{ + now = get_tick(); + xprof_Init(); + xprof_delta = now - xprof_start_t; + xprof_start_t = now; + xprof_events++; + + if (!xprof_average_delta) + xprof_average_delta = xprof_delta; + if (xprof_average_delta > (xprof_delta >> 1)) + xprof_average_delta = xprof_average_delta - (xprof_average_delta >> 8) + (xprof_delta >> 8); + + xprof_nesting++; + xprof_chk_overhead(2); + xprof_average(&xprof_stats_avg24hour, 24 * 3600); + xprof_average(&xprof_stats_avg5hour, 5 * 3600); + xprof_average(&xprof_stats_avg1hour, 3600); + xprof_average(&xprof_stats_avg30min, 1800); + xprof_average(&xprof_stats_avg5min, 300); + xprof_average(&xprof_stats_avg1min, 60); + xprof_average(&xprof_stats_avg30sec, 30); + xprof_average(&xprof_stats_avg5sec, 5); + xprof_average(&xprof_stats_avg1sec, 1); + xprof_chk_overhead(30); + xprof_nesting--; + + eventAdd("cpuProfiling", xprof_event, NULL, 1.0, 1); +} + +#endif /* USE_XPROF_STATS */ diff --git a/src/acl.cc b/src/acl.cc index 1aa73c4b06..1cb3ff4bd5 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,6 +1,6 @@ /* - * $Id: acl.cc,v 1.286 2002/09/26 13:33:07 robertc Exp $ + * $Id: acl.cc,v 1.287 2002/10/02 11:06:31 robertc Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -1682,17 +1682,20 @@ aclMatchAcl(acl * ae, aclCheck_t * checklist) int aclMatchAclList(const acl_list * list, aclCheck_t * checklist) { + PROF_start(aclMatchAclList); while (list) { AclMatchedName = list->_acl->name; debug(28, 3) ("aclMatchAclList: checking %s%s\n", list->op ? null_string : "!", list->_acl->name); if (aclMatchAcl(list->_acl, checklist) != list->op) { debug(28, 3) ("aclMatchAclList: returning 0\n"); + PROF_stop(aclMatchAclList); return 0; } list = list->next; } debug(28, 3) ("aclMatchAclList: returning 1\n"); + PROF_stop(aclMatchAclList); return 1; } @@ -1709,17 +1712,20 @@ int aclCheckFast(const acl_access * A, aclCheck_t * checklist) { allow_t allow = ACCESS_DENIED; + PROF_start(aclCheckFast); debug(28, 5) ("aclCheckFast: list: %p\n", A); while (A) { allow = A->allow; if (aclMatchAclList(A->aclList, checklist)) { aclCheckCleanup(checklist); + PROF_stop(aclCheckFast); return allow == ACCESS_ALLOWED; } A = A->next; } debug(28, 5) ("aclCheckFast: no matches, returning: %d\n", allow == ACCESS_DENIED); aclCheckCleanup(checklist); + PROF_stop(aclCheckFast); return allow == ACCESS_DENIED; } diff --git a/src/comm.cc b/src/comm.cc index 30b3a2177f..4310120340 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.334 2002/09/15 06:40:57 robertc Exp $ + * $Id: comm.cc,v 1.335 2002/10/02 11:06:31 robertc Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -174,6 +174,7 @@ comm_openex(int sock_type, int tos = 0; fde *F = NULL; + PROF_start(comm_open); /* Create socket for accepting new connections. */ statCounter.syscalls.sock.sockets++; if ((new_socket = socket(AF_INET, sock_type, proto)) < 0) { @@ -189,6 +190,7 @@ comm_openex(int sock_type, default: debug(50, 0) ("comm_open: socket failure: %s\n", xstrerror()); } + PROF_stop(comm_open); return -1; } /* set TOS if needed */ @@ -221,19 +223,23 @@ comm_openex(int sock_type, if (commBind(new_socket, addr, port) != COMM_OK) { comm_close(new_socket); return -1; + PROF_stop(comm_open); } } F->local_port = port; if (flags & COMM_NONBLOCKING) - if (commSetNonBlocking(new_socket) == COMM_ERROR) + if (commSetNonBlocking(new_socket) == COMM_ERROR) { return -1; + PROF_stop(comm_open); + } #ifdef TCP_NODELAY if (sock_type == SOCK_STREAM) commSetTcpNoDelay(new_socket); #endif if (Config.tcpRcvBufsz > 0 && sock_type == SOCK_STREAM) commSetTcpRcvbuf(new_socket, Config.tcpRcvBufsz); + PROF_stop(comm_open); return new_socket; } @@ -463,6 +469,7 @@ comm_connect_addr(int sock, const struct sockaddr_in *address) int err = 0; socklen_t errlen; assert(ntohs(address->sin_port) != 0); + PROF_start(comm_connect_addr); /* Establish connection. */ errno = 0; if (!F->flags.called_connect) { @@ -498,6 +505,7 @@ comm_connect_addr(int sock, const struct sockaddr_in *address) #endif #endif } + PROF_stop(comm_connect_addr); if (errno == 0 || errno == EISCONN) status = COMM_OK; else if (ignoreErrno(errno)) @@ -527,7 +535,9 @@ comm_accept(int fd, struct sockaddr_in *pn, struct sockaddr_in *me) fde *F = NULL; Slen = sizeof(P); statCounter.syscalls.sock.accepts++; + PROF_start(comm_accept); if ((sock = accept(fd, (struct sockaddr *) &P, &Slen)) < 0) { + PROF_stop(comm_accept); if (ignoreErrno(errno)) { debug(50, 5) ("comm_accept: FD %d: %s\n", fd, xstrerror()); return COMM_NOMESSAGE; @@ -554,6 +564,7 @@ comm_accept(int fd, struct sockaddr_in *pn, struct sockaddr_in *me) F->remote_port = htons(P.sin_port); F->local_port = htons(M.sin_port); commSetNonBlocking(sock); + PROF_stop(comm_accept); return sock; } @@ -643,6 +654,7 @@ comm_close(int fd) return; assert(F->flags.open); assert(F->type != FD_FILE); + PROF_start(comm_close); F->flags.closing = 1; #if USE_SSL if (F->ssl) @@ -662,6 +674,7 @@ comm_close(int fd) fd_close(fd); /* update fdstat */ close(fd); statCounter.syscalls.sock.closes++; + PROF_stop(comm_close); } /* Send a udp datagram to specified TO_ADDR. */ @@ -673,8 +686,10 @@ comm_udp_sendto(int fd, int len) { int x; + PROF_start(comm_udp_sendto); statCounter.syscalls.sock.sendtos++; x = sendto(fd, buf, len, 0, (struct sockaddr *) to_addr, addr_len); + PROF_stop(comm_udp_sendto); if (x < 0) { #ifdef _SQUID_LINUX_ if (ECONNREFUSED != errno) @@ -856,6 +871,7 @@ commHandleWrite(int fd, void *data) int len = 0; int nleft; + PROF_start(commHandleWrite); debug(5, 5) ("commHandleWrite: FD %d: off %ld, sz %ld.\n", fd, (long int) state->offset, (long int) state->size); @@ -904,6 +920,7 @@ commHandleWrite(int fd, void *data) CommWriteStateCallbackAndFree(fd, COMM_OK); } } + PROF_stop(commHandleWrite); } diff --git a/src/comm_poll.cc b/src/comm_poll.cc index a507cc75a4..38e1d58864 100644 --- a/src/comm_poll.cc +++ b/src/comm_poll.cc @@ -1,6 +1,6 @@ /* - * $Id: comm_poll.cc,v 1.5 2002/09/15 06:40:57 robertc Exp $ + * $Id: comm_poll.cc,v 1.6 2002/10/02 11:06:31 robertc Exp $ * * DEBUG: section 5 Socket Functions * @@ -208,6 +208,7 @@ comm_check_incoming_poll_handlers(int nfds, int *fds) PF *hdl = NULL; int npfds; struct pollfd pfds[3 + MAXHTTPPORTS]; + PROF_start(comm_check_incoming); incoming_sockets_accepted = 0; for (i = npfds = 0; i < nfds; i++) { int events; @@ -224,12 +225,16 @@ comm_check_incoming_poll_handlers(int nfds, int *fds) npfds++; } } - if (!nfds) + if (!nfds) { + PROF_stop(comm_check_incoming); return -1; + } getCurrentTime(); statCounter.syscalls.polls++; - if (poll(pfds, npfds, 0) < 1) + if (poll(pfds, npfds, 0) < 1) { + PROF_stop(comm_check_incoming); return incoming_sockets_accepted; + } for (i = 0; i < npfds; i++) { int revents; if (((revents = pfds[i].revents) == 0) || ((fd = pfds[i].fd) == -1)) @@ -251,6 +256,7 @@ comm_check_incoming_poll_handlers(int nfds, int *fds) fd); } } + PROF_stop(comm_check_incoming); return incoming_sockets_accepted; } @@ -340,6 +346,7 @@ comm_select(int msec) comm_poll_dns_incoming(); if (commCheckHTTPIncoming) comm_poll_http_incoming(); + PROF_start(comm_poll_prep_pfds); callicp = calldns = callhttp = 0; nfds = 0; npending = 0; @@ -376,6 +383,7 @@ comm_select(int msec) npending++; } } + PROF_stop(comm_poll_prep_pfds); if (nfds == 0) { assert(shutting_down); return COMM_SHUTDOWN; @@ -385,9 +393,11 @@ comm_select(int msec) if (msec > MAX_POLL_TIME) msec = MAX_POLL_TIME; for (;;) { + PROF_start(comm_poll_normal); statCounter.syscalls.polls++; num = poll(pfds, nfds, msec); statCounter.select_loops++; + PROF_stop(comm_poll_normal); if (num >= 0 || npending >= 0) break; if (ignoreErrno(errno)) @@ -409,6 +419,7 @@ comm_select(int msec) /* scan each socket but the accept socket. Poll this * more frequently to minimize losses due to the 5 connect * limit in SunOS */ + PROF_start(comm_handle_ready_fd); for (i = 0; i < nfds; i++) { fde *F; int revents = pfds[i].revents; @@ -441,8 +452,10 @@ comm_select(int msec) commAddSlowFd(fd); #endif else { + PROF_start(comm_read_handler); F->read_handler = NULL; hdl(fd, F->read_data); + PROF_stop(comm_read_handler); statCounter.select_fds++; if (commCheckICPIncoming) comm_poll_icp_incoming(); @@ -455,8 +468,10 @@ comm_select(int msec) if (revents & (POLLWRNORM | POLLOUT | POLLHUP | POLLERR)) { debug(5, 5) ("comm_poll: FD %d ready for writing\n", fd); if ((hdl = F->write_handler)) { + PROF_start(comm_write_handler); F->write_handler = NULL; hdl(fd, F->write_data); + PROF_stop(comm_write_handler); statCounter.select_fds++; if (commCheckICPIncoming) comm_poll_icp_incoming(); @@ -491,6 +506,7 @@ comm_select(int msec) fd_close(fd); } } + PROF_stop(comm_handle_ready_fd); if (callicp) comm_poll_icp_incoming(); if (calldns) diff --git a/src/comm_select.cc b/src/comm_select.cc index 6ac1868935..60311952eb 100644 --- a/src/comm_select.cc +++ b/src/comm_select.cc @@ -1,6 +1,6 @@ /* - * $Id: comm_select.cc,v 1.59 2002/09/15 15:00:44 robertc Exp $ + * $Id: comm_select.cc,v 1.60 2002/10/02 11:06:31 robertc Exp $ * * DEBUG: section 5 Socket Functions * @@ -203,7 +203,6 @@ commGetSlowFd(void) } #endif - static int comm_check_incoming_select_handlers(int nfds, int *fds) { diff --git a/src/disk.cc b/src/disk.cc index dca265d439..5a899eae75 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,6 +1,6 @@ /* - * $Id: disk.cc,v 1.160 2002/09/01 15:16:35 hno Exp $ + * $Id: disk.cc,v 1.161 2002/10/02 11:06:31 robertc Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -60,6 +60,7 @@ int file_open(const char *path, int mode) { int fd; + PROF_start(file_open); if (FILE_MODE(mode) == O_WRONLY) mode |= O_APPEND; mode |= SQUID_NONBLOCK; @@ -75,6 +76,7 @@ file_open(const char *path, int mode) commSetCloseOnExec(fd); fd_open(fd, FD_FILE, path); } + PROF_stop(file_open); return fd; } @@ -85,6 +87,7 @@ file_close(int fd) { fde *F = &fd_table[fd]; PF *read_callback; + PROF_start(file_close); assert(fd >= 0); assert(F->flags.open); if ((read_callback = F->read_handler)) { @@ -102,6 +105,7 @@ file_close(int fd) #else F->flags.close_request = 1; debug(6, 2) ("file_close: FD %d, delaying close\n", fd); + PROF_stop(file_close); return; #endif } @@ -119,6 +123,7 @@ file_close(int fd) ("file_close: FD %d, really closing\n", fd); fd_close(fd); statCounter.syscalls.disk.closes++; + PROF_stop(file_close); } /* @@ -182,6 +187,7 @@ diskHandleWrite(int fd, void *notused) int do_close; if (NULL == q) return; + PROF_start(diskHandleWrite); debug(6, 3) ("diskHandleWrite: FD %d\n", fd); F->flags.write_daemon = 0; assert(fdd->write_q != NULL); @@ -272,12 +278,14 @@ diskHandleWrite(int fd, void *notused) * NOTE, this callback can close the FD, so we must * not touch 'F', 'fdd', etc. after this. */ + PROF_stop(diskHandleWrite); return; /* XXX But what about close_request??? */ } } if (do_close) file_close(fd); + PROF_stop(diskHandleWrite); } @@ -295,6 +303,7 @@ file_write(int fd, { dwrite_q *wq = NULL; fde *F = &fd_table[fd]; + PROF_start(file_write); assert(fd >= 0); assert(F->flags.open); /* if we got here. Caller is eligible to write. */ @@ -323,6 +332,7 @@ file_write(int fd, if (!F->flags.write_daemon) { diskHandleWrite(fd, NULL); } + PROF_stop(file_write); } /* @@ -351,6 +361,7 @@ diskHandleRead(int fd, void *data) memFree(ctrl_dat, MEM_DREAD_CTRL); return; } + PROF_start(diskHandleRead); if (F->disk.offset != ctrl_dat->offset) { debug(6, 3) ("diskHandleRead: FD %d seeking to offset %d\n", fd, (int) ctrl_dat->offset); @@ -367,6 +378,7 @@ diskHandleRead(int fd, void *data) if (len < 0) { if (ignoreErrno(errno)) { commSetSelect(fd, COMM_SELECT_READ, diskHandleRead, ctrl_dat, 0); + PROF_stop(diskHandleRead); return; } debug(50, 1) ("diskHandleRead: FD %d: %s\n", fd, xstrerror()); @@ -379,6 +391,7 @@ diskHandleRead(int fd, void *data) ctrl_dat->handler(fd, ctrl_dat->buf, len, rc, ctrl_dat->client_data); cbdataReferenceDone(ctrl_dat->client_data); memFree(ctrl_dat, MEM_DREAD_CTRL); + PROF_stop(diskHandleRead); } @@ -390,6 +403,7 @@ void file_read(int fd, char *buf, int req_len, off_t offset, DRCB * handler, void *client_data) { dread_ctrl *ctrl_dat; + PROF_start(file_read); assert(fd >= 0); ctrl_dat = memAllocate(MEM_DREAD_CTRL); ctrl_dat->fd = fd; @@ -400,4 +414,5 @@ file_read(int fd, char *buf, int req_len, off_t offset, DRCB * handler, void *cl ctrl_dat->handler = handler; ctrl_dat->client_data = cbdataReference(client_data); diskHandleRead(fd, ctrl_dat); + PROF_stop(file_read); } diff --git a/src/main.cc b/src/main.cc index fa284d62bb..ede5aad80a 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.353 2002/07/28 21:55:33 hno Exp $ + * $Id: main.cc,v 1.354 2002/10/02 11:06:31 robertc Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -546,6 +546,9 @@ mainInitialize(void) eventAdd("start_announce", start_announce, NULL, 3600.0, 1); eventAdd("ipcache_purgelru", ipcache_purgelru, NULL, 10.0, 1); eventAdd("fqdncache_purgelru", fqdncache_purgelru, NULL, 15.0, 1); +#if USE_XPROF_STATS + eventAdd("cpuProfiling", xprof_event, NULL, 1.0, 1); +#endif eventAdd("memPoolCleanIdlePools", memPoolCleanIdlePools, NULL, 15.0, 1); } configured_once = 1; diff --git a/src/squid.h b/src/squid.h index e603bf35ef..f0bd1679e8 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.222 2002/09/01 15:16:35 hno Exp $ + * $Id: squid.h,v 1.223 2002/10/02 11:06:31 robertc Exp $ * * AUTHOR: Duane Wessels * @@ -396,12 +396,12 @@ struct rusage { #include "enums.h" #include "typedefs.h" #include "util.h" +#include "profiling.h" #include "MemPool.h" #include "structs.h" #include "protos.h" #include "globals.h" - #if !HAVE_TEMPNAM #include "tempnam.h" #endif diff --git a/src/store.cc b/src/store.cc index 2f67f38102..2958c14752 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.546 2002/09/15 05:41:57 robertc Exp $ + * $Id: store.cc,v 1.547 2002/10/02 11:06:31 robertc Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -316,8 +316,12 @@ storeUnlockObject(StoreEntry * e) StoreEntry * storeGet(const cache_key * key) { + void *p; + PROF_start(storeGet); debug(20, 3) ("storeGet: looking up %s\n", storeKeyText(key)); - return (StoreEntry *) hash_lookup(store_table, key); + p = hash_lookup(store_table, key); + PROF_stop(storeGet); + return (StoreEntry *) p; } StoreEntry * @@ -819,6 +823,7 @@ storeMaintainSwapSpace(void *datanotused) SwapDir *SD; static time_t last_warn_time = 0; + PROF_start(storeMaintainSwapSpace); /* walk each fs */ for (i = 0; i < Config.cacheSwap.n_configured; i++) { /* call the maintain function .. */ @@ -838,6 +843,7 @@ storeMaintainSwapSpace(void *datanotused) } /* Reregister a maintain event .. */ eventAdd("MaintainSwapSpace", storeMaintainSwapSpace, NULL, 1.0, 1); + PROF_stop(storeMaintainSwapSpace); } @@ -845,6 +851,7 @@ storeMaintainSwapSpace(void *datanotused) void storeRelease(StoreEntry * e) { + PROF_start(storeRelease); debug(20, 3) ("storeRelease: Releasing: '%s'\n", storeKeyText(e->hash.key)); /* If, for any reason we can't discard this object because of an * outstanding request, mark it for pending release */ @@ -852,6 +859,7 @@ storeRelease(StoreEntry * e) storeExpireNow(e); debug(20, 3) ("storeRelease: Only setting RELEASE_REQUEST bit\n"); storeReleaseRequest(e); + PROF_stop(storeRelease); return; } if (store_dirs_rebuilding && e->swap_filen > -1) { @@ -868,6 +876,7 @@ storeRelease(StoreEntry * e) e->lock_count++; EBIT_SET(e->flags, RELEASE_REQUEST); stackPush(&LateReleaseStack, e); + PROF_stop(storeRelease); return; } else { destroy_StoreEntry(e); @@ -888,6 +897,7 @@ storeRelease(StoreEntry * e) } storeSetMemStatus(e, NOT_IN_MEMORY); destroy_StoreEntry(e); + PROF_stop(storeRelease); } static void