Changeset 1970
- Timestamp:
- 04/09/08 16:36:23 (2 years ago)
- Location:
- features/performance
- Files:
-
- 2 added
- 14 edited
-
aclocal.m4 (modified) (96 diffs)
-
configure.in (modified) (7 diffs)
-
src/Makefile.am (modified) (3 diffs)
-
src/common/Makefile.am (modified) (1 diff)
-
src/common/rdtsc.c (modified) (2 diffs)
-
src/common/rdtsc.h (modified) (6 diffs)
-
src/common/timer.c (modified) (1 diff)
-
src/common/timer.h (modified) (1 diff)
-
src/config.h.in (modified) (5 diffs)
-
src/defines.h.in (modified) (1 diff)
-
src/send_packets.c (modified) (15 diffs)
-
src/sleep.c (added)
-
src/sleep.h (added)
-
src/tcpreplay.c (modified) (4 diffs)
-
src/tcpreplay.h (modified) (5 diffs)
-
src/tcpreplay_opts.def (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
features/performance/aclocal.m4
r1738 r1970 1 # generated automatically by aclocal 1.10 -*- Autoconf -*-1 # generated automatically by aclocal 1.10.1 -*- Autoconf -*- 2 2 3 3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4 # 2005, 2006 Free Software Foundation, Inc.4 # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 5 5 # This file is free software; the Free Software Foundation 6 6 # gives unlimited permission to copy and/or distribute it, … … 12 12 # PARTICULAR PURPOSE. 13 13 14 m4_if(m4_PACKAGE_VERSION, [2.61],, 15 [m4_fatal([this file was generated for autoconf 2.61. 16 You have another version of autoconf. If you want to use that, 17 you should regenerate the build system entirely.], [63])]) 14 m4_ifndef([AC_AUTOCONF_VERSION], 15 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 16 m4_if(AC_AUTOCONF_VERSION, [2.61],, 17 [m4_warning([this file was generated for autoconf 2.61. 18 You have another version of autoconf. It may work, but is not guaranteed to. 19 If you have problems, you may need to regenerate the build system entirely. 20 To do so, use the procedure documented by the package, typically `autoreconf'.])]) 18 21 19 22 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- 20 23 21 # serial 48AC_PROG_LIBTOOL24 # serial 51 AC_PROG_LIBTOOL 22 25 23 26 … … 182 185 183 186 # Determine commands to create old-style static archives. 184 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs $old_deplibs'187 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' 185 188 old_postinstall_cmds='chmod 644 $oldlib' 186 189 old_postuninstall_cmds= … … 269 272 # the simple compiler test code. 270 273 AC_DEFUN([_LT_COMPILER_BOILERPLATE], 271 [ac_outfile=conftest.$ac_objext 272 printf "$lt_simple_compile_test_code" >conftest.$ac_ext 274 [AC_REQUIRE([LT_AC_PROG_SED])dnl 275 ac_outfile=conftest.$ac_objext 276 echo "$lt_simple_compile_test_code" >conftest.$ac_ext 273 277 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err 274 278 _lt_compiler_boilerplate=`cat conftest.err` … … 282 286 # the simple link test code. 283 287 AC_DEFUN([_LT_LINKER_BOILERPLATE], 284 [ac_outfile=conftest.$ac_objext 285 printf "$lt_simple_link_test_code" >conftest.$ac_ext 288 [AC_REQUIRE([LT_AC_PROG_SED])dnl 289 ac_outfile=conftest.$ac_objext 290 echo "$lt_simple_link_test_code" >conftest.$ac_ext 286 291 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err 287 292 _lt_linker_boilerplate=`cat conftest.err` … … 299 304 # to the aix ld manual. 300 305 AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], 301 [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ 302 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } 303 }'` 306 [AC_REQUIRE([LT_AC_PROG_SED])dnl 307 AC_LINK_IFELSE(AC_LANG_PROGRAM,[ 308 lt_aix_libpath_sed=' 309 /Import File Strings/,/^$/ { 310 /^0/ { 311 s/^0 *\(.*\)$/\1/ 312 p 313 } 314 }' 315 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` 304 316 # Check for a 64-bit object if we didn't find anything. 305 if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } 306 }'`; fi],[]) 317 if test -z "$aix_libpath"; then 318 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` 319 fi],[]) 307 320 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi 308 321 ])# _LT_AC_SYS_LIBPATH_AIX … … 535 548 ;; 536 549 537 x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) 550 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ 551 s390*-*linux*|sparc*-*linux*) 538 552 # Find out which ABI we are using. 539 553 echo 'int i;' > conftest.$ac_ext … … 542 556 *32-bit*) 543 557 case $host in 558 x86_64-*kfreebsd*-gnu) 559 LD="${LD-ld} -m elf_i386_fbsd" 560 ;; 544 561 x86_64-*linux*) 545 562 LD="${LD-ld} -m elf_i386" … … 558 575 *64-bit*) 559 576 case $host in 577 x86_64-*kfreebsd*-gnu) 578 LD="${LD-ld} -m elf_x86_64_fbsd" 579 ;; 560 580 x86_64-*linux*) 561 581 LD="${LD-ld} -m elf_x86_64" … … 629 649 [$2=no 630 650 ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) 631 printf"$lt_simple_compile_test_code" > conftest.$ac_ext651 echo "$lt_simple_compile_test_code" > conftest.$ac_ext 632 652 lt_compiler_flag="$3" 633 653 # Insert the option either (1) after the last *FLAGS variable, or … … 670 690 # Check whether the given compiler option works 671 691 AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], 672 [AC_CACHE_CHECK([$1], [$2], 692 [AC_REQUIRE([LT_AC_PROG_SED])dnl 693 AC_CACHE_CHECK([$1], [$2], 673 694 [$2=no 674 695 save_LDFLAGS="$LDFLAGS" 675 696 LDFLAGS="$LDFLAGS $3" 676 printf"$lt_simple_link_test_code" > conftest.$ac_ext697 echo "$lt_simple_link_test_code" > conftest.$ac_ext 677 698 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then 678 699 # The linker can only warn and ignore the option if not recognized … … 788 809 ;; 789 810 *) 790 # If test is not a shell built-in, we'll probably end up computing a 791 # maximum length that is only half of the actual maximum length, but 792 # we can't tell. 793 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} 794 while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ 811 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` 812 if test -n "$lt_cv_sys_max_cmd_len"; then 813 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` 814 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` 815 else 816 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} 817 while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ 795 818 = "XX$teststring") >/dev/null 2>&1 && 796 new_result=`expr "X$teststring" : ".*" 2>&1` && 797 lt_cv_sys_max_cmd_len=$new_result && 798 test $i != 17 # 1/2 MB should be enough 799 do 800 i=`expr $i + 1` 801 teststring=$teststring$teststring 802 done 803 teststring= 804 # Add a significant safety factor because C++ compilers can tack on massive 805 # amounts of additional arguments before passing them to the linker. 806 # It appears as though 1/2 is a usable value. 807 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` 819 new_result=`expr "X$teststring" : ".*" 2>&1` && 820 lt_cv_sys_max_cmd_len=$new_result && 821 test $i != 17 # 1/2 MB should be enough 822 do 823 i=`expr $i + 1` 824 teststring=$teststring$teststring 825 done 826 teststring= 827 # Add a significant safety factor because C++ compilers can tack on massive 828 # amounts of additional arguments before passing them to the linker. 829 # It appears as though 1/2 is a usable value. 830 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` 831 fi 808 832 ;; 809 833 esac … … 1032 1056 # Check to see if options -c and -o are simultaneously supported by compiler 1033 1057 AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], 1034 [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl 1058 [AC_REQUIRE([LT_AC_PROG_SED])dnl 1059 AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl 1035 1060 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], 1036 1061 [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], … … 1040 1065 cd conftest 1041 1066 mkdir out 1042 printf"$lt_simple_compile_test_code" > conftest.$ac_ext1067 echo "$lt_simple_compile_test_code" > conftest.$ac_ext 1043 1068 1044 1069 lt_compiler_flag="-o out/conftest2.$ac_objext" … … 1180 1205 if test -n "$STRIP" ; then 1181 1206 striplib="$STRIP -x" 1207 old_striplib="$STRIP -S" 1182 1208 AC_MSG_RESULT([yes]) 1183 1209 else … … 1197 1223 # PORTME Fill in your ld.so characteristics 1198 1224 AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], 1199 [AC_MSG_CHECKING([dynamic linker characteristics]) 1225 [AC_REQUIRE([LT_AC_PROG_SED])dnl 1226 AC_MSG_CHECKING([dynamic linker characteristics]) 1200 1227 library_names_spec= 1201 1228 libname_spec='lib$name' … … 1211 1238 dynamic_linker="$host_os ld.so" 1212 1239 sys_lib_dlsearch_path_spec="/lib /usr/lib" 1240 m4_if($1,[],[ 1213 1241 if test "$GCC" = yes; then 1214 sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` 1215 if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then 1242 case $host_os in 1243 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; 1244 *) lt_awk_arg="/^libraries:/" ;; 1245 esac 1246 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` 1247 if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then 1216 1248 # if the path contains ";" then we assume it to be the separator 1217 1249 # otherwise default to the standard path separator (i.e. ":") - it is 1218 1250 # assumed that no part of a normal pathname contains ";" but that should 1219 1251 # okay in the real world where ";" in dirpaths is itself problematic. 1220 sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`1252 lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` 1221 1253 else 1222 sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`1254 lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` 1223 1255 fi 1256 # Ok, now we have the path, separated by spaces, we can step through it 1257 # and add multilib dir if necessary. 1258 lt_tmp_lt_search_path_spec= 1259 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` 1260 for lt_sys_path in $lt_search_path_spec; do 1261 if test -d "$lt_sys_path/$lt_multi_os_dir"; then 1262 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" 1263 else 1264 test -d "$lt_sys_path" && \ 1265 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" 1266 fi 1267 done 1268 lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' 1269 BEGIN {RS=" "; FS="/|\n";} { 1270 lt_foo=""; 1271 lt_count=0; 1272 for (lt_i = NF; lt_i > 0; lt_i--) { 1273 if ($lt_i != "" && $lt_i != ".") { 1274 if ($lt_i == "..") { 1275 lt_count++; 1276 } else { 1277 if (lt_count == 0) { 1278 lt_foo="/" $lt_i lt_foo; 1279 } else { 1280 lt_count--; 1281 } 1282 } 1283 } 1284 } 1285 if (lt_foo != "") { lt_freq[[lt_foo]]++; } 1286 if (lt_freq[[lt_foo]] == 1) { print lt_foo; } 1287 }'` 1288 sys_lib_search_path_spec=`echo $lt_search_path_spec` 1224 1289 else 1225 1290 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" 1226 fi 1291 fi]) 1227 1292 need_lib_prefix=unknown 1228 1293 hardcode_into_libs=no … … 1381 1446 shlibpath_var=DYLD_LIBRARY_PATH 1382 1447 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' 1383 # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. 1384 if test "$GCC" = yes; then 1385 sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` 1386 else 1387 sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' 1388 fi 1448 m4_if([$1], [],[ 1449 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 1389 1450 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' 1390 1451 ;; … … 1401 1462 freebsd1*) 1402 1463 dynamic_linker=no 1403 ;;1404 1405 kfreebsd*-gnu)1406 version_type=linux1407 need_lib_prefix=no1408 need_version=no1409 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'1410 soname_spec='${libname}${release}${shared_ext}$major'1411 shlibpath_var=LD_LIBRARY_PATH1412 shlibpath_overrides_runpath=no1413 hardcode_into_libs=yes1414 dynamic_linker='GNU ld.so'1415 1464 ;; 1416 1465 … … 1452 1501 hardcode_into_libs=yes 1453 1502 ;; 1454 freebsd*) # from 4.6 on1503 *) # from 4.6 on, and DragonFly 1455 1504 shlibpath_overrides_runpath=yes 1456 1505 hardcode_into_libs=yes … … 1515 1564 ;; 1516 1565 1517 interix 3*)1566 interix[[3-9]]*) 1518 1567 version_type=linux 1519 1568 need_lib_prefix=no … … 1570 1619 1571 1620 # This must be Linux ELF. 1572 linux* )1621 linux* | k*bsd*-gnu) 1573 1622 version_type=linux 1574 1623 need_lib_prefix=no … … 1586 1635 # Append ld.so.conf contents to the search path 1587 1636 if test -f /etc/ld.so.conf; then 1588 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s ", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`1637 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` 1589 1638 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" 1590 1639 fi … … 1597 1646 # assume the GNU/Linux dynamic linker is in use. 1598 1647 dynamic_linker='GNU/Linux ld.so' 1599 ;;1600 1601 knetbsd*-gnu)1602 version_type=linux1603 need_lib_prefix=no1604 need_version=no1605 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'1606 soname_spec='${libname}${release}${shared_ext}$major'1607 shlibpath_var=LD_LIBRARY_PATH1608 shlibpath_overrides_runpath=no1609 hardcode_into_libs=yes1610 dynamic_linker='GNU ld.so'1611 1648 ;; 1612 1649 … … 1692 1729 ;; 1693 1730 1731 rdos*) 1732 dynamic_linker=no 1733 ;; 1734 1694 1735 solaris*) 1695 1736 version_type=linux … … 1797 1838 # ---------------- 1798 1839 AC_DEFUN([_LT_AC_TAGCONFIG], 1799 [AC_ARG_WITH([tags], 1840 [AC_REQUIRE([LT_AC_PROG_SED])dnl 1841 AC_ARG_WITH([tags], 1800 1842 [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], 1801 1843 [include additional configurations @<:@automatic@:>@])], … … 2058 2100 # AC_PATH_TOOL_PREFIX 2059 2101 # ------------------- 2060 # find a file program which can recogni se shared library2102 # find a file program which can recognize shared library 2061 2103 AC_DEFUN([AC_PATH_TOOL_PREFIX], 2062 2104 [AC_REQUIRE([AC_PROG_EGREP])dnl … … 2121 2163 # AC_PATH_MAGIC 2122 2164 # ------------- 2123 # find a file program which can recogni se a shared library2165 # find a file program which can recognize a shared library 2124 2166 AC_DEFUN([AC_PATH_MAGIC], 2125 2167 [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) … … 2268 2310 # -- PORTME fill in with the dynamic library characteristics 2269 2311 AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], 2270 [AC_CACHE_CHECK([how to recogni se dependent libraries],2312 [AC_CACHE_CHECK([how to recognize dependent libraries], 2271 2313 lt_cv_deplibs_check_method, 2272 2314 [lt_cv_file_magic_cmd='$MAGIC_CMD' … … 2307 2349 mingw* | pw32*) 2308 2350 # Base MSYS/MinGW do not provide the 'file' command needed by 2309 # func_win32_libid shell function, so use a weaker test based on 'objdump'. 2310 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' 2311 lt_cv_file_magic_cmd='$OBJDUMP -f' 2351 # func_win32_libid shell function, so use a weaker test based on 'objdump', 2352 # unless we find 'file', for example because we are cross-compiling. 2353 if ( file / ) >/dev/null 2>&1; then 2354 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' 2355 lt_cv_file_magic_cmd='func_win32_libid' 2356 else 2357 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' 2358 lt_cv_file_magic_cmd='$OBJDUMP -f' 2359 fi 2312 2360 ;; 2313 2361 … … 2316 2364 ;; 2317 2365 2318 freebsd* | kfreebsd*-gnu |dragonfly*)2366 freebsd* | dragonfly*) 2319 2367 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then 2320 2368 case $host_cpu in … … 2354 2402 ;; 2355 2403 2356 interix 3*)2404 interix[[3-9]]*) 2357 2405 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here 2358 2406 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' … … 2370 2418 2371 2419 # This must be Linux ELF. 2372 linux* )2420 linux* | k*bsd*-gnu) 2373 2421 lt_cv_deplibs_check_method=pass_all 2374 2422 ;; … … 2401 2449 2402 2450 osf3* | osf4* | osf5*) 2451 lt_cv_deplibs_check_method=pass_all 2452 ;; 2453 2454 rdos*) 2403 2455 lt_cv_deplibs_check_method=pass_all 2404 2456 ;; … … 2456 2508 else 2457 2509 lt_nm_to_check="${ac_tool_prefix}nm" 2458 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 2510 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then 2459 2511 lt_nm_to_check="$lt_nm_to_check nm" 2460 2512 fi … … 2672 2724 2673 2725 # Code to be used in simple compile tests 2674 lt_simple_compile_test_code="int some_variable = 0; \n"2726 lt_simple_compile_test_code="int some_variable = 0;" 2675 2727 2676 2728 # Code to be used in simple link tests 2677 lt_simple_link_test_code='int main(){return(0);} \n'2729 lt_simple_link_test_code='int main(){return(0);}' 2678 2730 2679 2731 _LT_AC_SYS_COMPILER … … 2777 2829 2778 2830 # Code to be used in simple compile tests 2779 lt_simple_compile_test_code="int some_variable = 0; \n"2831 lt_simple_compile_test_code="int some_variable = 0;" 2780 2832 2781 2833 # Code to be used in simple link tests 2782 lt_simple_link_test_code='int main(int, char *[[]]) { return(0); } \n'2834 lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' 2783 2835 2784 2836 # ltmain only uses $CC for tagged configurations so make sure $CC is set. … … 2926 2978 then 2927 2979 # We have reworked collect2 2928 _LT_AC_TAGVAR(hardcode_direct, $1)=yes2980 : 2929 2981 else 2930 2982 # We have old collect2 … … 3085 3137 xlc*) 3086 3138 output_verbose_link_cmd='echo' 3087 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $ verstring'3139 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' 3088 3140 _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' 3089 3141 # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds 3090 _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $ verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'3142 _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' 3091 3143 _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' 3092 3144 ;; … … 3122 3174 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no 3123 3175 ;; 3124 freebsd* | kfreebsd*-gnu |dragonfly*)3176 freebsd* | dragonfly*) 3125 3177 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF 3126 3178 # conventions … … 3171 3223 3172 3224 case $host_cpu in 3173 hppa*64*|ia64*) 3174 _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' 3175 ;; 3225 hppa*64*|ia64*) ;; 3176 3226 *) 3177 3227 _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' … … 3241 3291 esac 3242 3292 ;; 3243 interix 3*)3293 interix[[3-9]]*) 3244 3294 _LT_AC_TAGVAR(hardcode_direct, $1)=no 3245 3295 _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no … … 3281 3331 _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: 3282 3332 ;; 3283 linux* )3333 linux* | k*bsd*-gnu) 3284 3334 case $cc_basename in 3285 3335 KCC*) … … 3361 3411 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' 3362 3412 ;; 3413 *) 3414 case `$CC -V 2>&1 | sed 5q` in 3415 *Sun\ C*) 3416 # Sun C++ 5.9 3417 _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' 3418 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' 3419 _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' 3420 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' 3421 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' 3422 3423 # Not sure whether something based on 3424 # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 3425 # would be better. 3426 output_verbose_link_cmd='echo' 3427 3428 # Archives containing C++ object files must be created using 3429 # "CC -xar", where "CC" is the Sun C++ compiler. This is 3430 # necessary to make sure instantiated templates are included 3431 # in the archive. 3432 _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' 3433 ;; 3434 esac 3435 ;; 3363 3436 esac 3364 3437 ;; … … 3399 3472 ;; 3400 3473 openbsd*) 3401 _LT_AC_TAGVAR(hardcode_direct, $1)=yes 3402 _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no 3403 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' 3404 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' 3405 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then 3406 _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' 3407 _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' 3408 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' 3474 if test -f /usr/libexec/ld.so; then 3475 _LT_AC_TAGVAR(hardcode_direct, $1)=yes 3476 _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no 3477 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' 3478 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' 3479 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then 3480 _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' 3481 _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' 3482 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' 3483 fi 3484 output_verbose_link_cmd='echo' 3485 else 3486 _LT_AC_TAGVAR(ld_shlibs, $1)=no 3409 3487 fi 3410 output_verbose_link_cmd='echo'3411 3488 ;; 3412 3489 osf3*) … … 3570 3647 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; 3571 3648 *) 3572 # The C++ compiler is used as linker so we must use $wl 3573 # flag to pass the commands to the underlying system 3574 # linker. We must also pass each convience library through 3575 # to the system linker between allextract/defaultextract. 3576 # The C++ compiler will combine linker options so we 3577 # cannot just pass the convience library names through 3578 # without $wl. 3649 # The compiler driver will combine and reorder linker options, 3650 # but understands `-z linker_flag'. 3579 3651 # Supported since Solaris 2.6 (maybe 2.5.1?) 3580 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'3652 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' 3581 3653 ;; 3582 3654 esac … … 3625 3697 3626 3698 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' 3699 case $host_os in 3700 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; 3701 *) 3702 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' 3703 ;; 3704 esac 3627 3705 fi 3628 3706 ;; … … 3868 3946 ifelse([$1],[CXX], 3869 3947 [case $host_os in 3870 interix 3*)3948 interix[[3-9]]*) 3871 3949 # Interix 3.5 installs completely hosed .la files for C++, so rather than 3872 3950 # hack all around it, let's just trust "g++" to DTRT. … … 3876 3954 ;; 3877 3955 3956 linux*) 3957 case `$CC -V 2>&1 | sed 5q` in 3958 *Sun\ C*) 3959 # Sun C++ 5.9 3960 # 3961 # The more standards-conforming stlport4 library is 3962 # incompatible with the Cstd library. Avoid specifying 3963 # it if it's in CXXFLAGS. Ignore libCrun as 3964 # -library=stlport4 depends on it. 3965 case " $CXX $CXXFLAGS " in 3966 *" -library=stlport4 "*) 3967 solaris_use_stlport4=yes 3968 ;; 3969 esac 3970 if test "$solaris_use_stlport4" != yes; then 3971 _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' 3972 fi 3973 ;; 3974 esac 3975 ;; 3976 3878 3977 solaris*) 3879 3978 case $cc_basename in 3880 3979 CC*) 3980 # The more standards-conforming stlport4 library is 3981 # incompatible with the Cstd library. Avoid specifying 3982 # it if it's in CXXFLAGS. Ignore libCrun as 3983 # -library=stlport4 depends on it. 3984 case " $CXX $CXXFLAGS " in 3985 *" -library=stlport4 "*) 3986 solaris_use_stlport4=yes 3987 ;; 3988 esac 3989 3881 3990 # Adding this requires a known-good setup of shared libraries for 3882 3991 # Sun compiler versions before 5.6, else PIC objects from an old 3883 3992 # archive will be linked into the output, leading to subtle bugs. 3884 _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun' 3993 if test "$solaris_use_stlport4" != yes; then 3994 _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' 3995 fi 3885 3996 ;; 3886 3997 esac … … 3931 4042 3932 4043 # Code to be used in simple compile tests 3933 lt_simple_compile_test_code=" subroutine t\n return\n end\n" 4044 lt_simple_compile_test_code="\ 4045 subroutine t 4046 return 4047 end 4048 " 3934 4049 3935 4050 # Code to be used in simple link tests 3936 lt_simple_link_test_code=" program t\n end\n" 4051 lt_simple_link_test_code="\ 4052 program t 4053 end 4054 " 3937 4055 3938 4056 # ltmain only uses $CC for tagged configurations so make sure $CC is set. … … 4013 4131 4014 4132 # Code to be used in simple compile tests 4015 lt_simple_compile_test_code="class foo {} \n"4133 lt_simple_compile_test_code="class foo {}" 4016 4134 4017 4135 # Code to be used in simple link tests 4018 lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; } \n'4136 lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' 4019 4137 4020 4138 # ltmain only uses $CC for tagged configurations so make sure $CC is set. … … 4069 4187 4070 4188 # Code to be used in simple compile tests 4071 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED } \n'4189 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' 4072 4190 4073 4191 # Code to be used in simple link tests … … 4158 4276 _LT_AC_TAGVAR(module_expsym_cmds, $1) \ 4159 4277 _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ 4278 _LT_AC_TAGVAR(fix_srcfile_path, $1) \ 4160 4279 _LT_AC_TAGVAR(exclude_expsyms, $1) \ 4161 4280 _LT_AC_TAGVAR(include_expsyms, $1); do … … 4204 4323 # NOTE: Changes made to this file will be lost: look at ltmain.sh. 4205 4324 # 4206 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 4325 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 4207 4326 # Free Software Foundation, Inc. 4208 4327 # … … 4529 4648 4530 4649 # Fix the shell variable \$srcfile for the compiler. 4531 fix_srcfile_path= "$_LT_AC_TAGVAR(fix_srcfile_path, $1)"4650 fix_srcfile_path=$lt_fix_srcfile_path 4532 4651 4533 4652 # Set to yes if exported symbols are required. … … 4612 4731 AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], 4613 4732 [AC_REQUIRE([AC_CANONICAL_HOST]) 4733 AC_REQUIRE([LT_AC_PROG_SED]) 4614 4734 AC_REQUIRE([AC_PROG_NM]) 4615 4735 AC_REQUIRE([AC_OBJEXT]) … … 4648 4768 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" 4649 4769 ;; 4650 linux* )4770 linux* | k*bsd*-gnu) 4651 4771 if test "$host_cpu" = ia64; then 4652 4772 symcode='[[ABCDGIRSTW]]' … … 4838 4958 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' 4839 4959 ;; 4840 beos* | cygwin* |irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)4960 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) 4841 4961 # PIC is the default for these OSes. 4842 4962 ;; 4843 mingw* | os2* | pw32*)4963 mingw* | cygwin* | os2* | pw32*) 4844 4964 # This hack is so that the source file can tell whether it is being 4845 4965 # built for inclusion in a dll (and should export symbols for example). 4966 # Although the cygwin gcc ignores -fPIC, still need this for old-style 4967 # (--disable-auto-import) libraries 4846 4968 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' 4847 4969 ;; … … 4855 4977 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= 4856 4978 ;; 4857 interix 3*)4979 interix[[3-9]]*) 4858 4980 # Interix 3.x gcc -fpic/-fPIC options generate broken code. 4859 4981 # Instead, we relocate shared libraries at runtime. … … 4921 5043 esac 4922 5044 ;; 4923 freebsd* | kfreebsd*-gnu |dragonfly*)5045 freebsd* | dragonfly*) 4924 5046 # FreeBSD uses GNU C++ 4925 5047 ;; … … 4964 5086 esac 4965 5087 ;; 4966 linux* )5088 linux* | k*bsd*-gnu) 4967 5089 case $cc_basename in 4968 5090 KCC*) … … 4991 5113 ;; 4992 5114 *) 5115 case `$CC -V 2>&1 | sed 5q` in 5116 *Sun\ C*) 5117 # Sun C++ 5.9 5118 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' 5119 _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' 5120 _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' 5121 ;; 5122 esac 4993 5123 ;; 4994 5124 esac … … 5111 5241 ;; 5112 5242 5113 beos* | cygwin* |irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)5243 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) 5114 5244 # PIC is the default for these OSes. 5115 5245 ;; 5116 5246 5117 mingw* | pw32* | os2*)5247 mingw* | cygwin* | pw32* | os2*) 5118 5248 # This hack is so that the source file can tell whether it is being 5119 5249 # built for inclusion in a dll (and should export symbols for example). 5250 # Although the cygwin gcc ignores -fPIC, still need this for old-style 5251 # (--disable-auto-import) libraries 5120 5252 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' 5121 5253 ;; … … 5127 5259 ;; 5128 5260 5129 interix 3*)5261 interix[[3-9]]*) 5130 5262 # Interix 3.x gcc -fpic/-fPIC options generate broken code. 5131 5263 # Instead, we relocate shared libraries at runtime. … … 5185 5317 ;; 5186 5318 5187 mingw* | pw32* | os2*)5319 mingw* | cygwin* | pw32* | os2*) 5188 5320 # This hack is so that the source file can tell whether it is being 5189 5321 # built for inclusion in a dll (and should export symbols for example). … … 5218 5350 ;; 5219 5351 5220 linux* )5352 linux* | k*bsd*-gnu) 5221 5353 case $cc_basename in 5222 5354 icc* | ecc*) … … 5237 5369 _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' 5238 5370 ;; 5371 *) 5372 case `$CC -V 2>&1 | sed 5q` in 5373 *Sun\ C*) 5374 # Sun C 5.9 5375 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' 5376 _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' 5377 _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' 5378 ;; 5379 *Sun\ F*) 5380 # Sun Fortran 8.3 passes all unrecognized flags to the linker 5381 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' 5382 _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' 5383 _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' 5384 ;; 5385 esac 5386 ;; 5239 5387 esac 5240 5388 ;; … … 5243 5391 _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' 5244 5392 # All OSF/1 code is PIC. 5393 _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' 5394 ;; 5395 5396 rdos*) 5245 5397 _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' 5246 5398 ;; … … 5340 5492 # See if the linker supports building shared libraries. 5341 5493 AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], 5342 [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) 5494 [AC_REQUIRE([LT_AC_PROG_SED])dnl 5495 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) 5343 5496 ifelse([$1],[CXX],[ 5344 5497 _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' … … 5357 5510 ;; 5358 5511 cygwin* | mingw*) 5359 _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.*//'\'' | sort | uniq > $export_symbols'5512 _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' 5360 5513 ;; 5361 5514 *) … … 5496 5649 _LT_AC_TAGVAR(always_export_symbols, $1)=no 5497 5650 _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes 5498 _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.*//'\'' | sort | uniq > $export_symbols'5651 _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' 5499 5652 5500 5653 if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then … … 5514 5667 ;; 5515 5668 5516 interix 3*)5669 interix[[3-9]]*) 5517 5670 _LT_AC_TAGVAR(hardcode_direct, $1)=no 5518 5671 _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no … … 5529 5682 ;; 5530 5683 5531 linux*)5684 gnu* | linux* | k*bsd*-gnu) 5532 5685 if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then 5533 5686 tmp_addflag= … … 5547 5700 tmp_addflag=' -nofor_main' ;; 5548 5701 esac 5549 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 5702 case `$CC -V 2>&1 | sed 5q` in 5703 *Sun\ C*) # Sun C 5.9 5704 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' 5705 tmp_sharedflag='-G' ;; 5706 *Sun\ F*) # Sun Fortran 8.3 5707 tmp_sharedflag='-G' ;; 5708 *) 5709 tmp_sharedflag='-shared' ;; 5710 esac 5711 _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' 5550 5712 5551 5713 if test $supports_anon_versioning = yes; then … … 5553 5715 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ 5554 5716 $echo "local: *; };" >> $output_objdir/$libname.ver~ 5555 $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'5717 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' 5556 5718 fi 5557 5719 else … … 5593 5755 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) 5594 5756 case `$LD -v 2>&1` in 5595 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 5757 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) 5596 5758 _LT_AC_TAGVAR(ld_shlibs, $1)=no 5597 5759 cat <<_LT_EOF 1>&2 … … 5712 5874 then 5713 5875 # We have reworked collect2 5714 _LT_AC_TAGVAR(hardcode_direct, $1)=yes5876 : 5715 5877 else 5716 5878 # We have old collect2 … … 5805 5967 _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' 5806 5968 # FIXME: Should let the user specify the lib program. 5807 _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'5969 _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' 5808 5970 _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' 5809 5971 _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes … … 5847 6009 xlc*) 5848 6010 output_verbose_link_cmd='echo' 5849 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $ verstring'6011 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' 5850 6012 _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' 5851 6013 # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds 5852 _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $ verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'6014 _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' 5853 6015 _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' 5854 6016 ;; … … 5890 6052 5891 6053 # FreeBSD 3 and greater uses gcc -shared to do shared libraries. 5892 freebsd* | kfreebsd*-gnu |dragonfly*)6054 freebsd* | dragonfly*) 5893 6055 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' 5894 6056 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' … … 6012 6174 6013 6175 openbsd*) 6014 _LT_AC_TAGVAR(hardcode_direct, $1)=yes 6015 _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no 6016 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then 6017 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' 6018 _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' 6019 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' 6020 _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' 6176 if test -f /usr/libexec/ld.so; then 6177 _LT_AC_TAGVAR(hardcode_direct, $1)=yes 6178 _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no 6179 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then 6180 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' 6181 _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' 6182 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' 6183 _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' 6184 else 6185 case $host_os in 6186 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) 6187 _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' 6188 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' 6189 ;; 6190 *) 6191 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' 6192 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' 6193 ;; 6194 esac 6195 fi 6021 6196 else 6022 case $host_os in 6023 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) 6024 _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' 6025 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' 6026 ;; 6027 *) 6028 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' 6029 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' 6030 ;; 6031 esac 6197 _LT_AC_TAGVAR(ld_shlibs, $1)=no 6032 6198 fi 6033 6199 ;; … … 6088 6254 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; 6089 6255 *) 6090 # The compiler driver will combine linker options so we 6091 # cannot just pass the convience library names through 6092 # without $wl, iff we do not link with $LD. 6093 # Luckily, gcc supports the same syntax we need for Sun Studio. 6256 # The compiler driver will combine and reorder linker options, 6257 # but understands `-z linker_flag'. GCC discards it without `$wl', 6258 # but is careful enough not to reorder. 6094 6259 # Supported since Solaris 2.6 (maybe 2.5.1?) 6095 case $wlarc in6096 '') 6097 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; 6098 *) 6099 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; 6100 esac;;6260 if test "$GCC" = yes; then 6261 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' 6262 else 6263 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' 6264 fi 6265 ;; 6101 6266 esac 6102 6267 _LT_AC_TAGVAR(link_all_deplibs, $1)=yes … … 6155 6320 ;; 6156 6321 6157 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* )6322 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) 6158 6323 _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' 6159 6324 _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no … … 6230 6395 AC_MSG_CHECKING([whether -lc should be explicitly linked in]) 6231 6396 $rm conftest* 6232 printf"$lt_simple_compile_test_code" > conftest.$ac_ext6397 echo "$lt_simple_compile_test_code" > conftest.$ac_ext 6233 6398 6234 6399 if AC_TRY_EVAL(ac_compile) 2>conftest.err; then … … 6333 6498 ]) 6334 6499 6500 6501 # Cheap backport of AS_EXECUTABLE_P and required macros 6502 # from Autoconf 2.59; we should not use $as_executable_p directly. 6503 6504 # _AS_TEST_PREPARE 6505 # ---------------- 6506 m4_ifndef([_AS_TEST_PREPARE], 6507 [m4_defun([_AS_TEST_PREPARE], 6508 [if test -x / >/dev/null 2>&1; then 6509 as_executable_p='test -x' 6510 else 6511 as_executable_p='test -f' 6512 fi 6513 ])])# _AS_TEST_PREPARE 6514 6515 # AS_EXECUTABLE_P 6516 # --------------- 6517 # Check whether a file is executable. 6518 m4_ifndef([AS_EXECUTABLE_P], 6519 [m4_defun([AS_EXECUTABLE_P], 6520 [AS_REQUIRE([_AS_TEST_PREPARE])dnl 6521 $as_executable_p $1[]dnl 6522 ])])# AS_EXECUTABLE_P 6523 6335 6524 # NOTE: This macro has been submitted for inclusion into # 6336 6525 # GNU Autoconf as AC_PROG_SED. When it is available in # … … 6353 6542 for lt_ac_prog in sed gsed; do 6354 6543 for ac_exec_ext in '' $ac_executable_extensions; do 6355 if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then6544 if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then 6356 6545 lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" 6357 6546 fi … … 6359 6548 done 6360 6549 done 6550 IFS=$as_save_IFS 6361 6551 lt_ac_max=0 6362 6552 lt_ac_count=0 … … 6391 6581 ]) 6392 6582 SED=$lt_cv_path_SED 6583 AC_SUBST([SED]) 6393 6584 AC_MSG_RESULT([$SED]) 6394 6585 ]) 6395 6586 6396 # Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.6587 # Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. 6397 6588 # 6398 6589 # This file is free software; the Free Software Foundation … … 6409 6600 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 6410 6601 dnl require some minimum version. Point them to the right macro. 6411 m4_if([$1], [1.10 ], [],6602 m4_if([$1], [1.10.1], [], 6412 6603 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 6413 6604 ]) … … 6425 6616 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. 6426 6617 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 6427 [AM_AUTOMAKE_VERSION([1.10])dnl 6428 _AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) 6618 [AM_AUTOMAKE_VERSION([1.10.1])dnl 6619 m4_ifndef([AC_AUTOCONF_VERSION], 6620 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 6621 _AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) 6429 6622 6430 6623 # AM_AUX_DIR_EXPAND -*- Autoconf -*- … … 6698 6891 # Grep'ing the whole file is not good either: AIX grep has a line 6699 6892 # limit of 2048, but all sed's we know have understand at least 4000. 6700 if sed 10q "$mf" | grep '^#.*generated by automake' >/dev/null 2>&1; then6893 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 6701 6894 dirpart=`AS_DIRNAME("$mf")` 6702 6895 else … … 6786 6979 6787 6980 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 6788 # 2005, 2006 Free Software Foundation, Inc.6981 # 2005, 2006, 2008 Free Software Foundation, Inc. 6789 6982 # 6790 6983 # This file is free software; the Free Software Foundation … … 6792 6985 # with or without modifications, as long as this notice is preserved. 6793 6986 6794 # serial 1 26987 # serial 13 6795 6988 6796 6989 # This macro actually does too much. Some checks are only needed if … … 6897 7090 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 6898 7091 [# Compute $1's index in $config_headers. 7092 _am_arg=$1 6899 7093 _am_stamp_count=1 6900 7094 for _am_header in $config_headers :; do 6901 7095 case $_am_header in 6902 $ 1 | $1:* )7096 $_am_arg | $_am_arg:* ) 6903 7097 break ;; 6904 7098 * ) … … 6906 7100 esac 6907 7101 done 6908 echo "timestamp for $ 1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])7102 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 6909 7103 6910 7104 # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. … … 7207 7401 # _AM_SUBST_NOTMAKE(VARIABLE) 7208 7402 # --------------------------- 7209 # Prevent Automake from output ing VARIABLE = @VARIABLE@ in Makefile.in.7403 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 7210 7404 # This macro is traced by Automake. 7211 7405 AC_DEFUN([_AM_SUBST_NOTMAKE]) -
features/performance/configure.in
r1872 r1970 132 132 133 133 dnl Check for other header files 134 AC_CHECK_HEADERS([fcntl.h stddef.h sys/socket.h arpa/inet.h sys/time.h signal.h string.h strings.h sys/types.h sys/select.h netinet/in.h poll.h sys/poll.h unistd.h sys/param.h ])134 AC_CHECK_HEADERS([fcntl.h stddef.h sys/socket.h arpa/inet.h sys/time.h signal.h string.h strings.h sys/types.h sys/select.h netinet/in.h poll.h sys/poll.h unistd.h sys/param.h sys/io.h architecture/i386/pio.h sys/select.h]) 135 135 136 136 dnl OpenBSD has special requirements … … 161 161 AC_CHECK_MEMBERS([struct timeval.tv_sec]) 162 162 163 AC_CHECK_FUNCS([gettimeofday ctime memset regcomp strdup strchr strerror strtol strncpy strtoull poll ntohll mmap snprintf vsnprintf ])163 AC_CHECK_FUNCS([gettimeofday ctime memset regcomp strdup strchr strerror strtol strncpy strtoull poll ntohll mmap snprintf vsnprintf ioperm select kqueue]) 164 164 165 165 dnl Look for strlcpy since some BSD's have it … … 1035 1035 fi 1036 1036 1037 dnl Do we support the RDTSC? 1038 case $host in 1039 i386-*|x86_64-*|powerpc-*) 1040 AC_DEFINE([HAVE_RDTSC], [1], [Does the CPU support the RDTSC?]) 1041 ;; 1042 esac 1043 1044 1037 1045 dnl Allows user to choose which nic to use for testing purposes 1038 1046 AC_ARG_WITH(testnic, … … 1047 1055 disable_pcap_findalldevs=no 1048 1056 1049 1057 osx_frameworks=no 1050 1058 dnl these need to be dynamic based on OS 1051 1059 case $host in … … 1074 1082 disable_pcap_findalldevs=yes 1075 1083 fi 1084 AC_DEFINE([HAVE_ABSOLUTE_TIME], [1], [Have OS X UpTime()/AbsoluteTime high-precision timing]) 1085 osx_frameworks=yes 1076 1086 AC_MSG_RESULT(Apple OS X) 1077 1087 ;; … … 1095 1105 ;; 1096 1106 esac]) 1107 1108 AM_CONDITIONAL([ENABLE_OSX_FRAMEWORKS], test "$osx_frameworks" == "yes") 1097 1109 1098 1110 … … 1155 1167 ) 1156 1168 1157 1158 1169 case $host in 1159 1170 *-apple-darwin*) -
features/performance/src/Makefile.am
r1786 r1970 49 49 tcpreplay_LDADD = ./tcpedit/libtcpedit.a ./common/libcommon.a $(LIBSTRL) \ 50 50 @LNETLIB@ @LPCAPLIB@ $(LIBOPTS_LDADD) 51 tcpreplay_SOURCES = tcpreplay_opts.c send_packets.c signal_handler.c tcpreplay.c 51 if ENABLE_OSX_FRAMEWORKS 52 tcpreplay_LDFLAGS = -framework CoreServices -framework Carbon 53 endif 54 tcpreplay_SOURCES = tcpreplay_opts.c send_packets.c signal_handler.c tcpreplay.c sleep.c 52 55 tcpreplay_OBJECTS: tcpreplay_opts.h 53 56 tcpreplay_opts.h: tcpreplay_opts.c … … 86 89 tcpbridge_LDADD = ./tcpedit/libtcpedit.a ./common/libcommon.a \ 87 90 $(LIBSTRL) @LNETLIB@ @LPCAPLIB@ $(LIBOPTS_LDADD) 88 tcpbridge_SOURCES = tcpbridge_opts.c tcpbridge.c bridge.c send_packets.c 91 if ENABLE_OSX_FRAMEWORKS 92 tcpbridge_LDFLAGS = -framework CoreServices -framework Carbon 93 endif 94 tcpbridge_SOURCES = tcpbridge_opts.c tcpbridge.c bridge.c send_packets.c sleep.c 89 95 tcpbridge_OBJECTS: tcpbridge_opts.h 90 96 tcpbridge_opts.h: tcpbridge_opts.c … … 98 104 tcpprep_opts.def tcprewrite_opts.def tcpreplay_opts.def \ 99 105 flowreplay_opts.def tcpbridge_opts.def tcpbridge.h \ 100 flowreplay_opts.h tcpbridge_opts.h tcpr.h 106 flowreplay_opts.h tcpbridge_opts.h tcpr.h sleep.h 101 107 102 108 -
features/performance/src/common/Makefile.am
r1880 r1970 5 5 6 6 svn_version.c: 7 echo-n 'const char SVN_Version[] = "' > svn_version.c7 $(ECHO) -n 'const char SVN_Version[] = "' > svn_version.c 8 8 svnversion -n ../.. >> svn_version.c 9 echo'";' >> svn_version.c10 echo'const char *svn_version(void) {' >> svn_version.c11 echo' return SVN_Version;' >> svn_version.c12 echo'}' >> svn_version.c9 $(ECHO) '";' >> svn_version.c 10 $(ECHO) 'const char *svn_version(void) {' >> svn_version.c 11 $(ECHO) ' return SVN_Version;' >> svn_version.c 12 $(ECHO) '}' >> svn_version.c 13 13 14 14 libcommon_a_SOURCES = cidr.c err.c list.c cache.c services.c get.c \ -
features/performance/src/common/rdtsc.c
r1880 r1970 2 2 3 3 /* 4 * Copyright (c) 200 7Aaron Turner.4 * Copyright (c) 2008 Aaron Turner. 5 5 * All rights reserved. 6 6 * … … 45 45 */ 46 46 u_int64_t 47 rdtsc_calibrate( void)47 rdtsc_calibrate(u_int32_t mhz) 48 48 { 49 49 static u_int64_t x = 0; 50 u_int64_t v = 0; 51 struct timeval start, end, diff; 50 52 u_int64_t x1, x2; 53 u_int16_t n; 51 54 52 if (x != 0) 55 if (x != 0) { 53 56 return x; 54 55 /* haven't calculated clicks/usec yet */ 56 x1 = rdtsc(); 57 usleep(100000); /* .1 sec = 100,000 usec */ 58 x2 = rdtsc(); 59 x = (x2 - x1) / 100000; 57 } else if (mhz > 0 && x == 0) { 58 x = (u_int64_t)mhz; 59 notice("Using user specification of %llu Mhz", x); 60 } else { 61 /* haven't calculated clicks/usec yet */ 62 for (n=0; n<16; ++n) { 63 gettimeofday(&start, 0); 64 x1 = rdtsc(); 65 66 usleep(100000); 67 68 x2 = rdtsc(); 69 gettimeofday(&end, 0); 70 71 timersub(&end, &start, &diff); 72 73 v = (x2 - x1)/(diff.tv_sec * 1000000 + diff.tv_usec); 74 x = x ? (x + v)/2 : v; 75 } 76 notice("Using guessimate of %llu Mhz", x); 77 } 60 78 return x; 61 79 } 62 63 /*64 * sleeps for sleep time, using the rdtsc counter for accuracy65 * you need to call rdtsc_calibrate() BEFORE this or you'll sleep for66 * an additional .1 sec the very first time you call it.67 */68 u_int64_t69 rdtsc_sleep(const struct timeval sleep)70 {71 u_int64_t sleep_for, now;72 73 sleep_for = rdtsc_calibrate() * (sleep.tv_sec * 1000000 + sleep.tv_usec);74 now = rdtsc();75 sleep_for += now;76 77 while (now < sleep_for)78 now += (rdtsc() - now);79 80 return now;81 } -
features/performance/src/common/rdtsc.h
r1880 r1970 1 /* $Id:$ */ 2 3 /* 4 * Copyright (c) 2008 Aaron Turner. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 3. Neither the names of the copyright owners nor the names of its 17 * contributors may be used to endorse or promote products derived from 18 * this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 21 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 26 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 28 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 30 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33 1 34 /* 2 35 * Read TimeStamp Counter (RDTSC) … … 4 37 * I'm not really sure what the license is, but I'll assume Kazutomo Yoshii is 5 38 * cool with me using it since he published it on his website. 39 * Should also check out: http://www.fftw.org/cycle.h 6 40 */ 7 41 … … 10 44 11 45 12 u_int64_t rdtsc_calibrate(void); 13 u_int64_t rdtsc_sleep(const struct timeval sleep); 46 u_int64_t rdtsc_calibrate(u_int32_t mhz); 14 47 15 48 #if defined(__i386__) 16 49 #define HAVE_RDTSC 1 17 static __inline__ u_int64_t rdtsc(void) 50 51 static inline u_int64_t 52 rdtsc(void) 18 53 { 19 54 u_int64_t x; … … 21 56 return x; 22 57 } 58 23 59 #elif defined(__x86_64__) 24 60 #define HAVE_RDTSC 1 25 61 26 static __inline__ u_int64_t rdtsc(void) 62 static inline u_int64_t 63 rdtsc(void) 27 64 { 28 unsigned hi, lo;29 __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));30 return ( (u_int64_t)lo)|( ((u_int64_t)hi)<<32 );65 unsigned hi, lo; 66 __asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); 67 return ( (u_int64_t)lo)|( ((u_int64_t)hi)<<32 ); 31 68 } 32 69 … … 34 71 #define HAVE_RDTSC 1 35 72 36 static __inline__ u_int64_t rdtsc(void) 73 static inline u_int64_t 74 rdtsc(void) 37 75 { 38 u_int64_t result=0;39 u_int32_t upper, lower,tmp;40 __asm__ volatile(41 "0: \n"42 "\tmftbu %0 \n"43 "\tmftb %1 \n"44 "\tmftbu %2 \n"45 "\tcmpw %2,%0 \n"46 "\tbne 0b \n"47 : "=r"(upper),"=r"(lower),"=r"(tmp)48 );49 result = upper;50 result = result<<32;51 result = result|lower;76 u_int64_t result=0; 77 u_int32_t upper, lower,tmp; 78 __asm__ volatile( 79 "0: \n" 80 "\tmftbu %0 \n" 81 "\tmftb %1 \n" 82 "\tmftbu %2 \n" 83 "\tcmpw %2,%0 \n" 84 "\tbne 0b \n" 85 : "=r"(upper),"=r"(lower),"=r"(tmp) 86 ); 87 result = upper; 88 result = result<<32; 89 result = result|lower; 52 90 53 return(result);91 return(result); 54 92 } 55 93 … … 60 98 #endif 61 99 100 /* only define rdtsc_sleep() if we have rdtsc() */ 101 #ifdef HAVE_RDTSC 102 /* 103 * sleeps for sleep time, using the rdtsc counter for accuracy 104 * you need to call rdtsc_calibrate() BEFORE this or you'll sleep for 105 * an additional .1 sec the very first time you call it. 106 */ 107 static inline void 108 rdtsc_sleep(const struct timeval sleep) 109 { 110 u_int64_t sleep_until; 111 u_int64_t now = 0; 112 static u_int64_t clicks_per_usec = 0; 113 114 sleep_until = rdtsc(); 115 clicks_per_usec = clicks_per_usec > 0 ? clicks_per_usec : rdtsc_calibrate(0); 116 117 sleep_until += clicks_per_usec * TIMEVAL_TO_MICROSEC(&sleep); 118 119 while (now < sleep_until) 120 now = rdtsc(); 121 } 62 122 #endif 63 123 124 #endif /* __RDTSC_H__ */ 125 -
features/performance/src/common/timer.c
r1814 r1970 54 54 tvp->tv_usec = interval - (tvp->tv_sec * 1000000); 55 55 } 56 57 /*58 * converts a float to a timeval structure59 * converted to a #define60 void61 float2timer(float time, struct timeval *tvp)62 {63 float n;64 65 n = time;66 67 tvp->tv_sec = n;68 69 n -= tvp->tv_sec;70 tvp->tv_usec = n * 100000;71 72 }73 */ -
features/performance/src/common/timer.h
r1880 r1970 44 44 45 45 /* 46 * 1 sec = 1,000,000 microsec 46 * 1 sec = 1,0000 millisec (ms) 47 * 1 sec = 1,000,000 microsec (us) 48 * 1 sec = 1,000,000,000 nanosec (ns) 49 * 1 millisec = 1,000 microsec 47 50 * 1 microsec = 1,000 nanosec 48 * 1 sec = 1,000,000,000 nanosec49 51 */ 50 52 -
features/performance/src/config.h.in
r1877 r1970 48 48 /* Enable GNU Profiler */ 49 49 #undef GPROF 50 51 /* Have OS X UpTime()/AbsoluteTime high-precision timing */ 52 #undef HAVE_ABSOLUTE_TIME 53 54 /* Define to 1 if you have the <architecture/i386/pio.h> header file. */ 55 #undef HAVE_ARCHITECTURE_I386_PIO_H 50 56 51 57 /* Define to 1 if you have the <arpa/inet.h> header file. */ … … 122 128 #undef HAVE_INTTYPES_H 123 129 130 /* Define to 1 if you have the `ioperm' function. */ 131 #undef HAVE_IOPERM 132 133 /* Define to 1 if you have the `kqueue' function. */ 134 #undef HAVE_KQUEUE 135 124 136 /* Define to 1 if you have the `gen' library (-lgen). */ 125 137 #undef HAVE_LIBGEN … … 198 210 #undef HAVE_POLL_H 199 211 212 /* Does the CPU support the RDTSC? */ 213 #undef HAVE_RDTSC 214 200 215 /* Define this if we have a functional realpath(3C) */ 201 216 #undef HAVE_REALPATH … … 203 218 /* Define to 1 if you have the `regcomp' function. */ 204 219 #undef HAVE_REGCOMP 220 221 /* Define to 1 if you have the `select' function. */ 222 #undef HAVE_SELECT 205 223 206 224 /* Define to 1 if you have the <setjmp.h> header file. */ … … 264 282 */ 265 283 #undef HAVE_SYS_DIR_H 284 285 /* Define to 1 if you have the <sys/io.h> header file. */ 286 #undef HAVE_SYS_IO_H 266 287 267 288 /* Define to 1 if you have the <sys/limits.h> header file. */ -
features/performance/src/defines.h.in
r1854 r1970 203 203 #endif 204 204 205 /* Time converters */ 206 #define SEC_TO_MILLISEC(x) (x * 1000) 207 #define SEC_TO_MICROSEC(x) (x * 1000000) 208 #define SEC_TO_NANOSEC(x) ((u_int64_t)x * 1000000000) 209 210 #define MILLISEC_TO_SEC(x) (x / 1000) 211 #define MICROSEC_TO_SEC(x) (x / 1000000) 212 #define NANOSEC_TO_SEC(x) ((u_int64_t)x / 1000000000) 213 214 #define TIMEVAL_TO_MILLISEC(x) (((x)->tv_sec * 1000) + ((x)->tv_usec / 1000)) 215 #define TIMEVAL_TO_MICROSEC(x) (((x)->tv_sec * 1000000) + (x)->tv_usec) 216 #define TIMEVAL_TO_NANOSEC(x) ((u_int64_t)((x)->tv_sec * 1000000000) + ((u_int64_t)(x)->tv_usec * 1000)) 217 218 #define MILLISEC_TO_TIMEVAL(x, tv) \ 219 do { \ 220 (tv)->tv_sec = x / 1000; \ 221 (tv)->tv_usec = (x * 1000) - ((tv)->tv_sec * 1000000); \ 222 } while(0) 223 224 #define MICROSEC_TO_TIMEVAL(x, tv) \ 225 do { \ 226 (tv)->tv_sec = x / 1000000; \ 227 (tv)->tv_usec = x - ((tv)->tv_sec * 1000000); \ 228 } while(0) 229 230 #define NANOSEC_TO_TIMEVAL(x, tv) \ 231 do { \ 232 (tv)->tv_sec = x / 1000000000; \ 233 (tv)->tv_usec = (x / 1000) - (tv)->tv_sec * 1000000); \ 234 } while(0) 235 205 236 #endif /* DEFINES */ -
features/performance/src/send_packets.c
r1880 r1970 2 2 3 3 /* 4 * Copyright (c) 2001-200 7Aaron Turner.4 * Copyright (c) 2001-2008 Aaron Turner. 5 5 * All rights reserved. 6 6 * … … 31 31 */ 32 32 33 #define ADJUSTER_OFFSET 5 /* number of usec to compensate for packet timing */ 33 34 34 35 #include "config.h" … … 59 60 60 61 #include "send_packets.h" 62 #include "sleep.h" 61 63 62 64 extern tcpreplay_opt_t options; … … 69 71 #endif 70 72 71 static void do_sleep(struct timeval *time, struct timeval *last, int len, int accurate, 72 sendpacket_t *sp, COUNTER counter); 73 static u_int32_t sleep_loop(struct timeval time); 74 static u_char *get_next_packet(pcap_t *pcap, struct pcap_pkthdr *pkthdr, int file_idx, packet_cache_t **prev_packet); 73 static void do_sleep(struct timeval *time, struct timeval *last, int len, 74 int accurate, sendpacket_t *sp, COUNTER counter); 75 static u_char *get_next_packet(pcap_t *pcap, struct pcap_pkthdr *pkthdr, 76 int file_idx, packet_cache_t **prev_packet); 77 static u_int32_t get_user_count(sendpacket_t *sp, COUNTER counter); 78 75 79 76 80 /* … … 185 189 } 186 190 } 191 187 192 188 193 /* … … 269 274 } 270 275 276 271 277 /* 272 278 * determines based upon the cachedata which interface the given packet … … 311 317 */ 312 318 static void 313 do_sleep(struct timeval *time, struct timeval *last, int len, int accurate, sendpacket_t *sp,314 COUNTER counter)319 do_sleep(struct timeval *time, struct timeval *last, int len, int accurate, 320 sendpacket_t *sp, COUNTER counter) 315 321 { 316 322 static struct timeval didsleep = { 0, 0 }; … … 319 325 static struct timeval totalsleep = { 0, 0 }; 320 326 #endif 321 struct timeval nap, now, delta; 327 static int adjuster_flipper = 0; 328 #ifdef HAVE_TCPREPLAY 329 struct timeval adjuster = { 0, OPT_VALUE_SLEEP_ACCEL } 330 #else 331 struct timeval adjuster = { 0, ADJUSTER_OFFSET }; 332 #endif 333 static struct timeval nap = { 0, 0 }; 334 static u_int32_t double_up = 0; 335 struct timeval now, sleep_until, nap_this_time; 322 336 struct timespec ignore, sleep; 323 337 float n; 324 struct pollfd poller[1]; /* use poll to read from the keyboard */ 325 char input[EBUF_SIZE]; 326 static u_int32_t send = 0; /* remember # of packets to send btw calls */ 327 u_int32_t loop; 328 u_int64_t loop2; 329 338 static u_int32_t send = 0; /* accellerator. # of packets to send w/o sleeping */ 339 u_int32_t ppusec; /* packets per usec */ 340 330 341 /* just return if topspeed */ 331 342 if (options.speed.mode == SPEED_TOPSPEED) 332 343 return; 333 344 345 /* acclerator time? */ 346 if (send > 0) { 347 send --; 348 return; 349 } 350 334 351 dbgx(3, "Last time: " TIMEVAL_FORMAT, last->tv_sec, last->tv_usec); 335 352 … … 343 360 if (pkts_sent == 0 || ((options.speed.mode != SPEED_MBPSRATE) && (counter == 0))) { 344 361 start = now; 345 timerclear(& delta);362 timerclear(&sleep_until); 346 363 timerclear(&didsleep); 347 364 } 348 365 else { 349 timersub(&now, &start, & delta);366 timersub(&now, &start, &sleep_until); 350 367 } 351 368 … … 377 394 n = (float)len / (options.speed.speed * 1024 * 1024 / 8); /* convert Mbps to bps */ 378 395 nap.tv_sec = n; 379 nap.tv_usec = (n - nap.tv_sec) * 1000000;396 nap.tv_usec = (n - nap.tv_sec) * 1000000; 380 397 dbgx(3, "packet size %d\t\tequals %f bps\t\tnap " TIMEVAL_FORMAT, len, n, 381 398 nap.tv_sec, nap.tv_usec); 382 399 } 383 400 else { 401 /* don't sleep at all for the first packet */ 384 402 timerclear(&nap); 385 403 } … … 387 405 388 406 case SPEED_PACKETRATE: 389 /* run in packets/sec */ 390 n = 1 / options.speed.speed; 391 nap.tv_sec = n; 392 n -= nap.tv_sec; 393 nap.tv_usec = n * 1000000; 407 /* only need to calculate this the first time */ 408 if (! timerisset(&nap)) { 409 /* run in packets/sec */ 410 ppusec = 1000000 / options.speed.speed; 411 MICROSEC_TO_TIMEVAL(ppusec, &nap); 412 dbgx(1, "sending 1 packet per %lu usec", nap.tv_usec); 413 } 394 414 break; 395 415 … … 397 417 /* do we skip prompting for a key press? */ 398 418 if (send == 0) { 399 printf("**** Next packet #" COUNTER_SPEC " out %s. How many packets do you wish to send? ", 400 counter, (sp == options.intf1 ? options.intf1_name : options.intf2_name)); 401 fflush(NULL); 402 poller[0].fd = STDIN_FILENO; 403 poller[0].events = POLLIN | POLLPRI | POLLNVAL; 404 poller[0].revents = 0; 405 406 if (fcntl(0, F_SETFL, fcntl(0, F_GETFL) & ~O_NONBLOCK)) 407 errx(1, "Unable to clear non-blocking flag on stdin: %s", strerror(errno)); 408 409 /* wait for the input */ 410 if (poll(poller, 1, -1) < 0) 411 errx(1, "Error reading user input from stdin: %s", strerror(errno)); 412 413 /* 414 * read to the end of the line or EBUF_SIZE, 415 * Note, if people are stupid, and type in more text then EBUF_SIZE 416 * then the next fgets() will pull in that data, which will have poor 417 * results. fuck them. 418 */ 419 if (fgets(input, sizeof(input), stdin) == NULL) { 420 errx(1, "Unable to process user input for fd %d: %s", fileno(stdin), strerror(errno)); 421 } else if (strlen(input) > 1) { 422 send = strtoul(input, NULL, 0); 423 } 424 425 /* how many packets should we send? */ 426 if (send == 0) { 427 dbg(1, "Input was less then 1 or non-numeric, assuming 1"); 428 429 /* assume send only one packet */ 430 send = 1; 431 } 432 419 send = get_user_count(sp, counter); 433 420 } 434 421 … … 448 435 } 449 436 450 451 if (accurate == 2) { 452 loop2 = rdtsc_sleep(nap); 453 //fprintf(stderr, "rdtsc slept for %llu clicks\n", loop2); 454 dbgx(3, "rdtsc slept for %llu times", loop); 455 } else if (accurate == 1) { 456 /* gettimeofday() loop */ 457 timeradd(&now, &nap, &delta); 458 loop = sleep_loop(delta); 459 dbgx(3, "sleep_loop looped %u times", loop); 460 } else { 461 timeradd(&didsleep, &nap, &didsleep); 462 463 dbgx(4, "I will sleep " TIMEVAL_FORMAT, nap.tv_sec, nap.tv_usec); 464 465 if (timercmp(&didsleep, &delta, >)) { 466 timersub(&didsleep, &delta, &nap); 467 468 sleep.tv_sec = nap.tv_sec; 469 sleep.tv_nsec = nap.tv_usec * 1000; /* convert microsec to ns */ 470 dbgx(4, "Sleeping " TIMEVAL_FORMAT, nap.tv_sec, nap.tv_usec); 437 /* 438 * since we apply the adjuster to the sleep time, we can't modify nap 439 */ 440 nap_this_time.tv_sec = nap.tv_sec; 441 nap_this_time.tv_usec = nap.tv_usec; 442 443 /* apply the adjuster... */ 444 if (timerisset(&adjuster)) { 445 if (timercmp(&nap_this_time, &adjuster, >)) { 446 timersub(&nap_this_time, &adjuster, &nap_this_time); 447 dbgx(1, "adjusting nap_this_time by %lu usec", adjuster.tv_usec); 448 } else { 449 dbg(1, "resetting nap_this_time to 0"); 450 timerclear(&nap_this_time); 451 } 452 } 453 454 /* don't sleep if nap = { 0, 0} */ 455 if (!timerisset(&nap_this_time)) 456 return; 457 458 459 /* 460 * We have multiple methods of sleeping, pick the right one... 461 */ 462 switch (accurate) { 463 #ifdef HAVE_SELECT 464 case ACCURATE_SELECT: 465 select_sleep(nap_this_time); 466 break; 467 #endif 468 469 #ifdef HAVE_IOPERM 470 case ACCURATE_IOPORT: 471 ioport_sleep(nap_this_time); 472 break; 473 #endif 474 475 #ifdef HAVE_RDTSC 476 case ACCURATE_RDTSC: 477 rdtsc_sleep(nap_this_time); 478 break; 479 #endif 480 481 #ifdef HAVE_ABSOLUTE_TIME 482 case ACCURATE_ABS_TIME: 483 absolute_time_sleep(nap_this_time); 484 break; 485 #endif 486 487 case ACCURATE_GTOD: 488 gettimeofday_sleep(nap_this_time); 489 break; 490 491 case ACCURATE_NANOSLEEP: 492 nanosleep_sleep(nap_this_time); 493 494 break; 495 /* 496 timeradd(&didsleep, &nap_this_time, &didsleep); 497 498 dbgx(4, "I will sleep " TIMEVAL_FORMAT, nap_this_time.tv_sec, nap_this_time.tv_usec); 499 500 if (timercmp(&didsleep, &sleep_until, >)) { 501 timersub(&didsleep, &sleep_until, &nap_this_time); 502 503 TIMEVAL_TO_TIMESPEC(&nap_this_time, &sleep); 504 dbgx(4, "Sleeping " TIMEVAL_FORMAT, nap_this_time.tv_sec, nap_this_time.tv_usec); 471 505 #ifdef DEBUG 472 timeradd(&totalsleep, &nap , &totalsleep);506 timeradd(&totalsleep, &nap_this_time, &totalsleep); 473 507 #endif 474 508 if (nanosleep(&sleep, &ignore) == -1) { … … 476 510 } 477 511 } 478 } 512 break; 513 */ 514 default: 515 errx(1, "Unknown timer mode %d", accurate); 516 } 517 479 518 #ifdef DEBUG 480 519 dbgx(4, "Total sleep time: " TIMEVAL_FORMAT, totalsleep.tv_sec, totalsleep.tv_usec); … … 482 521 } 483 522 484 /* 485 * this function will keep calling gettimeofday() until it returns 486 * >= time. This should be a lot more accurate then using nanosleep(), 487 * but at the cost of being more CPU intensive. 523 524 /* 525 * Ask the user how many packets we should send 488 526 */ 489 static u_int32_t 490 sleep_loop(struct timeval time) 527 static u_int32_t 528 get_user_count(sendpacket_t *sp, COUNTER counter) 491 529 { 492 struct timeval now; 493 u_int32_t loop = 0; 494 do { 495 gettimeofday(&now, NULL); 496 loop ++; 497 } while (now.tv_sec < time.tv_sec || now.tv_usec < time.tv_usec); 498 return loop; 530 struct pollfd poller[1]; /* use poll to read from the keyboard */ 531 char input[EBUF_SIZE]; 532 u_int32_t send = 0; 533 534 printf("**** Next packet #" COUNTER_SPEC " out %s. How many packets do you wish to send? ", 535 counter, (sp == options.intf1 ? options.intf1_name : options.intf2_name)); 536 fflush(NULL); 537 poller[0].fd = STDIN_FILENO; 538 poller[0].events = POLLIN | POLLPRI | POLLNVAL; 539 poller[0].revents = 0; 540 541 if (fcntl(0, F_SETFL, fcntl(0, F_GETFL) & ~O_NONBLOCK)) 542 errx(1, "Unable to clear non-blocking flag on stdin: %s", strerror(errno)); 543 544 /* wait for the input */ 545 if (poll(poller, 1, -1) < 0) 546 errx(1, "Error reading user input from stdin: %s", strerror(errno)); 547 548 /* 549 * read to the end of the line or EBUF_SIZE, 550 * Note, if people are stupid, and type in more text then EBUF_SIZE 551 * then the next fgets() will pull in that data, which will have poor 552 * results. fuck them. 553 */ 554 if (fgets(input, sizeof(input), stdin) == NULL) { 555 errx(1, "Unable to process user input for fd %d: %s", fileno(stdin), strerror(errno)); 556 } else if (strlen(input) > 1) { 557 send = strtoul(input, NULL, 0); 558 } 559 560 /* how many packets should we send? */ 561 if (send == 0) { 562 dbg(1, "Input was less then 1 or non-numeric, assuming 1"); 563 564 /* assume send only one packet */ 565 send = 1; 566 } 567 568 return send; 499 569 } 500 570 -
features/performance/src/tcpreplay.c
r1880 r1970 2 2 3 3 /* 4 * Copyright (c) 2001-200 7Aaron Turner.4 * Copyright (c) 2001-2008 Aaron Turner. 5 5 * All rights reserved. 6 6 * … … 64 64 #endif 65 65 66 #ifdef HAVE_ABSOLUTE_TIME 67 #include <CoreServices/CoreServices.h> 68 #endif 69 66 70 void replay_file(int file_idx); 67 71 void usage(void); … … 272 276 char ebuf[SENDPACKET_ERRBUF_SIZE]; 273 277 int int1dlt, int2dlt; 278 float gtod = 14.5; 274 279 275 280 #ifdef ENABLE_PCAP_FINDALLDEVS … … 326 331 } 327 332 328 if (HAVE_OPT(ACCURATE)) 329 options.accurate = 1; 330 331 if (HAVE_OPT(ACCURATE2)) { 332 options.accurate = 2; 333 rdtsc_calibrate(); 334 } 333 if (HAVE_OPT(TIMER)) { 334 if (strcmp(OPT_ARG(TIMER), "select") == 0) { 335 #ifdef HAVE_SELECT 336 options.accurate = ACCURATE_SELECT; 337 #else 338 err(1, "tcpreplay not compiled with select support"); 339 #endif 340 } else if (strcmp(OPT_ARG(TIMER), "rdtsc") == 0) { 341 #ifdef HAVE_RDTSC 342 options.accurate = ACCURATE_RDTSC; 343 #else 344 err(1, "tcpreplay not compiled with rdtsc support"); 345 #endif 346 } else if (strcmp(OPT_ARG(TIMER), "ioport") == 0) { 347 #if defined HAVE_IOPERM && defined(__i386__) 348 options.accurate = ACCURATE_IOPORT; 349 ioport_sleep_init(); 350 #else 351 err(1, "tcpreplay not compiled with IO Port 0x80 support"); 352 #endif 353 } else if (strcmp(OPT_ARG(TIMER), "gtod") == 0) { 354 options.accurate = ACCURATE_GTOD; 355 } else if (strcmp(OPT_ARG(TIMER), "nano") == 0) { 356 options.accurate = ACCURATE_NANOSLEEP; 357 } else if (strcmp(OPT_ARG(TIMER), "abstime") == 0) { 358 #ifdef HAVE_ABSOLUTE_TIME 359 options.accurate = ACCURATE_ABS_TIME; 360 if (!MPLibraryIsLoaded()) { 361 err(1, "The MP library did not load.\n"); 362 } 363 #else 364 err(1, "tcpreplay only supports absolute time on Apple OS X"); 365 #endif 366 } else { 367 errx(1, "Unsupported timer mode: %s", OPT_ARG(TIMER)); 368 } 369 } 370 371 #ifdef HAVE_RDTSC 372 if (HAVE_OPT(RDTSC_CLICKS)) { 373 rdtsc_calibrate(OPT_VALUE_RDTSC_CLICKS); 374 } 375 #endif 335 376 336 377 if (HAVE_OPT(PKTLEN)) -
features/performance/src/tcpreplay.h
r1795 r1970 2 2 3 3 /* 4 * Copyright (c) 2001-200 7Aaron Turner.4 * Copyright (c) 2001-2008 Aaron Turner. 5 5 * All rights reserved. 6 6 * … … 43 43 #include <fcntl.h> 44 44 45 struct packet_cache_s 46 { 45 struct packet_cache_s { 47 46 struct pcap_pkthdr pkthdr; 48 47 u_char *pktdata; … … 53 52 typedef struct packet_cache_s packet_cache_t; 54 53 55 typedef struct 56 { 54 typedef struct { 57 55 int index; 58 56 int cached; … … 68 66 sendpacket_t *intf1; 69 67 sendpacket_t *intf2; 70 /* disable data dump mode71 pcap_t *savepcap1;72 pcap_t *savepcap2;73 pcap_dumper_t *savedumper1;74 pcap_dumper_t *savedumper2;75 68 76 int datadump_mode;77 int datadumpfile1;78 int datadumpfile2;79 */80 69 tcpr_speed_t speed; 81 70 u_int32_t loop; … … 90 79 int truncate; 91 80 92 /* use gettimeofday() instead of sleeping between packets*/81 /* accurate mode to use */ 93 82 int accurate; 83 #define ACCURATE_NANOSLEEP 0 84 #define ACCURATE_SELECT 1 85 #define ACCURATE_RDTSC 2 86 #define ACCURATE_IOPORT 3 87 #define ACCURATE_GTOD 4 88 #define ACCURATE_ABS_TIME 5 94 89 95 90 char *files[MAX_FILES]; 96 91 COUNTER limit_send; 97 92 98 99 /* disable bridge mode100 pcap_t *listen1;101 pcap_t *listen2;102 int sniff_snaplen;103 int sniff_bridge;104 int promisc;105 int poll_timeout;106 */107 108 93 #ifdef ENABLE_VERBOSE 109 94 /* tcpdump verbose printing */ -
features/performance/src/tcpreplay_opts.def
r1880 r1970 3 3 4 4 copyright = { 5 date = "2000-200 7";5 date = "2000-2008"; 6 6 owner = "Aaron Turner"; 7 7 type = "bsd"; 8 8 author = <<- EOText 9 Copyright 2000-200 7Aaron Turner9 Copyright 2000-2008 Aaron Turner 10 10 11 11 For support please use the tcpreplay-users@lists.sourceforge.net mailing list. … … 79 79 processor, disk and system bus will allow. 80 80 81 Packet timing at high speeds is a black art and very OS/CPU dependent. 82 Your best bet is to use @var{--timing=rdtsc}, do your own testing and tweak the 83 @var{--rdtsc-clicks} option accordingly. Newer CPU's and Linux kernels 84 with HPET enabled may have good results with @var{--timing=gtod}. 85 81 86 Replaying captured traffic may simulate odd or broken conditions on your 82 87 network and cause problems. … … 114 119 115 120 flag = { 116 name = accurate;117 value = a;121 name = timer; 122 value = T; 118 123 max = 1; 119 flags-cant = accurate2;120 descrip = " Enable more accurate packet timing";124 arg-type = string; 125 descrip = "Select packet timing mode: select, ioport, rdtsc, gtod, nano, abstime"; 121 126 doc = <<- EOText 122 Enables more accurate timing between packets at the cost of higher 123 CPU utilization by using the gettimeofday() system call. This method 124 works better on some systems then others and may have rather non-granular 125 resolution which makes it problematic for replaying at high rates of speed. 126 EOText; 127 }; 128 129 flag = { 130 name = accurate2; 131 max = 1; 132 flags-cant = accurate; 133 descrip = "Enable even more accurate packet timing"; 134 doc = <<- EOText 135 Enables the "even more" accurate timing at the cost of higher CPU 136 utilization by using the RDTSC counter available on newer CPU's. 137 Only works on more recent x86, x86_64 and PPC 127 Allows you to select the packet timing method to use: 128 @enumerate 129 @item nano 130 - Use nanosleep() API [default] 131 @item select 132 - Use select() API 133 @item ioport 134 - Write to the i386 IO Port 0x80 135 @item rdtsc 136 - Use the x86/x86_64/PPC RDTSC 137 @item gtod 138 - Use a gettimeofday() loop 139 @end enumerate 140 141 EOText; 142 }; 143 144 flag = { 145 name = sleep-accel; 146 arg-type = number; 147 arg-default = 5; 148 descrip = "Reduce the amount of time to sleep by specified usec"; 149 doc = <<- EOText 150 Reduce the amount of time we would normally sleep between two packets by the 151 specified number of usec. This is primarily intended to compensate for the 152 overhead in tcpreplay to process & send packets. Default is 5usec which seems 153 to work well on my 2.16Ghz MacBook Pro. 154 EOText; 155 }; 156 157 flag = { 158 ifdef = HAVE_RDTSC; 159 name = rdtsc-clicks; 160 max = 1; 161 arg-type = number; 162 arg-default = 0; 163 descrip = "Specify the RDTSC clicks/usec"; 164 doc = <<- EOText 165 Override the calculated number of RDTSC clicks/usec which is often the speed of the 166 CPU in Mhz. Only useful if you specified @var{--timer=rdtsc} 138 167 EOText; 139 168 }; … … 169 198 }; 170 199 171 /* Cache files to internal memory */ 172 flag = { 173 name = enable_file_cache; 174 value = C; 175 flags-must = loop; 176 descrip = "Enable caching of packets to internal memory"; 177 doc = <<- EOText 200 /* Cache files to internal memory */ 201 flag = { 202 name = enable_file_cache; 203 flags-must = loop; 204 descrip = "Enable caching of packets to internal memory"; 205 doc = <<- EOText 178 206 Cache pcap file(s) the first time they are cached in RAM so that subsequent 179 207 loops don't incurr any disk I/O latency in order to increase performance. Make … … 219 247 doc = ""; 220 248 }; 221 249 /* 222 250 flag = { 223 251 ifdef = ENABLE_PCAP_FINDALLDEVS; … … 236 264 EOFlag; 237 265 }; 238 266 */ 239 267 /* 240 268 * Limits and loops: -l … … 254 282 flag = { 255 283 name = pktlen; 256 value = S;257 284 max = 1; 258 285 descrip = "Override the snaplen and use the actual packet len"; … … 292 319 flags-cant = oneatatime; 293 320 flags-cant = topspeed; 294 value = m;295 321 arg-type = string; 296 322 max = 1; … … 382 408 #endif 383 409 fprintf(stderr, "\n"); 384 fprintf(stderr, "Copyright 2001-200 7by Aaron Turner <aturner at synfin dot net>\n");410 fprintf(stderr, "Copyright 2001-2008 by Aaron Turner <aturner at synfin dot net>\n"); 385 411 fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION); 386 412 #ifdef HAVE_LIBNET
Note: See TracChangeset
for help on using the changeset viewer.
