[svn] commit: r2625 - in /experiments/stephen-receptionist: ./ client/ common/ common/test/ contractor/ intermediary/ receptionist/ scripts/ server/ worker/
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Aug 4 08:16:03 UTC 2010
Author: stephen
Date: Wed Aug 4 08:16:03 2010
New Revision: 2625
Log:
Allow location of boost libraries to be specified to configure script
Removed:
experiments/stephen-receptionist/configure
Modified:
experiments/stephen-receptionist/client/Makefile.am
experiments/stephen-receptionist/client/client_controller_asynchronous.cc
experiments/stephen-receptionist/common/Makefile.am
experiments/stephen-receptionist/common/debug_flags.h
experiments/stephen-receptionist/common/test/Makefile.am
experiments/stephen-receptionist/configure.ac
experiments/stephen-receptionist/contractor/Makefile.am
experiments/stephen-receptionist/intermediary/Makefile.am
experiments/stephen-receptionist/receptionist/Makefile.am
experiments/stephen-receptionist/scripts/common.sh
experiments/stephen-receptionist/server/Makefile.am
experiments/stephen-receptionist/worker/Makefile.am
Modified: experiments/stephen-receptionist/client/Makefile.am
==============================================================================
--- experiments/stephen-receptionist/client/Makefile.am (original)
+++ experiments/stephen-receptionist/client/Makefile.am Wed Aug 4 08:16:03 2010
@@ -1,8 +1,9 @@
bin_PROGRAMS = client
-AM_CPPFLAGS = -I$(top_srcdir)/common
+AM_CPPFLAGS = -I$(top_srcdir)/common $(BOOSTLOCINC)
-AM_LDFLAGS = -lboost_program_options -lboost_system -lboost_thread
+AM_LDFLAGS = $(BOOSTLOCLIB)
+AM_LDFLAGS += -lboost_program_options-mt -lboost_system-mt -lboost_thread-mt
client_SOURCES = client.cc
client_SOURCES += client_command.cc client_command.h
Modified: experiments/stephen-receptionist/client/client_controller_asynchronous.cc
==============================================================================
--- experiments/stephen-receptionist/client/client_controller_asynchronous.cc (original)
+++ experiments/stephen-receptionist/client/client_controller_asynchronous.cc Wed Aug 4 08:16:03 2010
@@ -28,6 +28,7 @@
#include "client_communicator.h"
#include "client_controller_asynchronous.h"
#include "debug.h"
+#include "debug_flags.h"
#include "defaults.h"
#include "logger.h"
#include "packet_counter.h"
@@ -102,13 +103,17 @@
uint32_t missing = 0;
uint32_t this_packet = rcv_buffer_.getPacketNumber();
- if (this_packet < last_packet) {
- std::cout << "ERROR: packets received out of sequence\n";
- }
- else {
+ if (this_packet > last_packet) {
missing = this_packet - last_packet - 1;
+ if ((missing > 0) && Debug::flagSet(DebugFlags::LOST_PACKETS)) {
+ std::ostringstream s;
+ s << missing << " missing packets detected";
+ Debug::log(s.str().c_str(), DebugFlags::LOST_PACKETS);
+ }
lost_ += missing;
last_packet = this_packet;
+ } else {
+ std::cout << "ERROR: packets received out of sequence\n";
}
Modified: experiments/stephen-receptionist/common/Makefile.am
==============================================================================
--- experiments/stephen-receptionist/common/Makefile.am (original)
+++ experiments/stephen-receptionist/common/Makefile.am Wed Aug 4 08:16:03 2010
@@ -9,7 +9,8 @@
libcommon_a_SOURCES += udp_communicator.cc udp_communiator.h
libcommon_a_SOURCES += utilities.cc utilities.h
-AM_LDFLAGS = -lboost_system
+AM_CPPFLAGS = $(BOOSTLOCINC)
+AM_LDFLAGS = $(BOOSTLOCLIB) -lboost_system-mt
bin_PROGRAMS = queue_clear
queue_clear_SOURCES = queue_clear.cc
Modified: experiments/stephen-receptionist/common/debug_flags.h
==============================================================================
--- experiments/stephen-receptionist/common/debug_flags.h (original)
+++ experiments/stephen-receptionist/common/debug_flags.h Wed Aug 4 08:16:03 2010
@@ -28,7 +28,8 @@
public:
enum {
LOG_OPERATION = 0x0001, ///< Log each send/receive operation
- PRINT_IP = 0x0002 ///< Print IP information
+ PRINT_IP = 0x0002, ///< Print IP information
+ LOST_PACKETS = 0x0004 ///< Log lost packets
};
};
Modified: experiments/stephen-receptionist/common/test/Makefile.am
==============================================================================
--- experiments/stephen-receptionist/common/test/Makefile.am (original)
+++ experiments/stephen-receptionist/common/test/Makefile.am Wed Aug 4 08:16:03 2010
@@ -3,8 +3,8 @@
test_SOURCES = test.cc
test_SOURCES += test_utilities.cc
-AM_CPPFLAGS = -I$(top_srcdir)/common
+AM_CPPFLAGS = -I$(top_srcdir)/common $(BOOSTLOCINC)
-AM_LDFLAGS = -lboost_system -lgtest
+AM_LDFLAGS = $(BOOSTLOCLIB) -lboost_system-mt -lgtest
test_LDADD = $(top_srcdir)/common/libcommon.a
Modified: experiments/stephen-receptionist/configure.ac
==============================================================================
--- experiments/stephen-receptionist/configure.ac (original)
+++ experiments/stephen-receptionist/configure.ac Wed Aug 4 08:16:03 2010
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_PREREQ([2.65])
+#AC_PREREQ([2.63])
AC_INIT([receptionist], [0.1], [stephen at isc.org])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_SRCDIR([client/client_communicator.h])
@@ -12,12 +12,31 @@
AC_PROG_RANLIB
# Checks for libraries.
+AC_ARG_WITH([boost],
+ [AS_HELP_STRING([--with-boost=<loc>], [Specify location of boost root (if not /usr)])],
+ [
+ AC_CHECK_FILE([$with_boost/lib/libboost_system-mt.a],
+ [], [AC_MSG_FAILURE([Unable to find boost libraries in location specified])])
+ ],
+ [
+ AC_CHECK_FILE([/usr/lib/libboost_system.a],
+ [], [AC_MSG_FAILURE([Unable to find boost libraries in /usr/lib])])
+ ])
+
+BOOSTLOCLIB=
+AS_IF([test "x$with_boost" != "x"],
+ [AC_SUBST([BOOSTLOCLIB], [-L$with_boost/lib])], [])
+
+BOOSTLOCINC=
+AS_IF([test "x$with_boost" != "x"],
+ [AC_SUBST([BOOSTLOCINC], [-I$with_boost/include])], [])
# Checks for header files.
AC_CHECK_HEADERS([stdint.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
+AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
Modified: experiments/stephen-receptionist/contractor/Makefile.am
==============================================================================
--- experiments/stephen-receptionist/contractor/Makefile.am (original)
+++ experiments/stephen-receptionist/contractor/Makefile.am Wed Aug 4 08:16:03 2010
@@ -1,8 +1,9 @@
bin_PROGRAMS = contractor
-AM_CPPFLAGS = -I$(top_srcdir)/common
+AM_CPPFLAGS = -I$(top_srcdir)/common $(BOOSTLOCINC)
-AM_LDFLAGS = -lboost_program_options -lboost_system
+AM_LDFLAGS = $(BOOSTLOCLIB)
+AM_LDFLAGS += -lboost_program_options-mt -lboost_system-mt
contractor_LDADD = $(top_srcdir)/common/libcommon.a
Modified: experiments/stephen-receptionist/intermediary/Makefile.am
==============================================================================
--- experiments/stephen-receptionist/intermediary/Makefile.am (original)
+++ experiments/stephen-receptionist/intermediary/Makefile.am Wed Aug 4 08:16:03 2010
@@ -1,8 +1,9 @@
bin_PROGRAMS = intermediary
-AM_CPPFLAGS = -I$(top_srcdir)/common
+AM_CPPFLAGS = -I$(top_srcdir)/common $(BOOSTLOCINC)
-AM_LDFLAGS = -lboost_program_options -lboost_system -lboost_thread
+AM_LDFLAGS = $(BOOSTLOCLIB)
+AM_LDFLAGS += -lboost_program_options-mt -lboost_system-mt -lboost_thread-mt
intermediary_LDADD = $(top_srcdir)/common/libcommon.a
Modified: experiments/stephen-receptionist/receptionist/Makefile.am
==============================================================================
--- experiments/stephen-receptionist/receptionist/Makefile.am (original)
+++ experiments/stephen-receptionist/receptionist/Makefile.am Wed Aug 4 08:16:03 2010
@@ -1,8 +1,8 @@
bin_PROGRAMS = receptionist
-AM_CPPFLAGS = -I$(top_srcdir)/common
+AM_CPPFLAGS = -I$(top_srcdir)/common $(BOOSTLOCINC)
-AM_LDFLAGS = -lboost_program_options -lboost_system
+AM_LDFLAGS = $(BOOSTLOCLIB) -lboost_program_options-mt -lboost_system-mt
receptionist_LDADD = $(top_srcdir)/common/libcommon.a
Modified: experiments/stephen-receptionist/scripts/common.sh
==============================================================================
--- experiments/stephen-receptionist/scripts/common.sh (original)
+++ experiments/stephen-receptionist/scripts/common.sh Wed Aug 4 08:16:03 2010
@@ -29,12 +29,12 @@
progdir=`dirname $0`
if [ $# -lt 2 -o $# -gt 4 ]; then
- echo "Usage: common [-a] logfile [middle-program] server-program"
+ echo "Usage: common [-a] logfile first-program [second-program]"
exit 1;
fi
if [ $1 = "-a" ]; then
- async_flags=" --margin 2 --asynchronous"
+ async_flags=" --margin 4 --asynchronous"
shift
else
async_flags=""
@@ -43,15 +43,14 @@
# set the remaining parameters
logfile=$1;
+first=$2
if [ $# = 2 ]; then
- middle=""
- server=$2
+ second=""
else
- middle=$2
- server=$3
+ second=$3
fi
-for burst in 1 2 4 8 16 32 64 96 128 160 192 224 256
+for burst in 1 2 4 8 16 32 64 128 256
do
echo "Setting burst to $burst"
@@ -59,18 +58,15 @@
# queues has been deleted before any run starts.
$progdir/queue_clear
- # If an intermediary/receptionist program was specified, start
- # it.
- if [ "$middle" != "" ]; then
- $progdir/$middle --burst $burst &
- fi;
+ # Start the first of the server program(s) (the client or intermediary
+ # if two programs are specified, or the server if just one is being used)
+ # with the specified burst level.
+ $progdir/$first --burst $burst &
- # Start the server. If running asynchronously, we want the server
- # to process packets as soon as they arrive.
- if [ "$async_flags" = "" ]; then
- $progdir/$server --burst $burst &
- else
- $progdir/$server --burst 1 &
+ # If this is a chain of three programs, start the second program. We want
+ # this program to process packets as soon as they arrive.
+ if [ "$second" != "" ]; then
+ $progdir/$second --burst 1 &
fi
# Allow server programs to start.
@@ -85,7 +81,7 @@
# Kill the server programs and wait to stop before doing the next loop.
kill -9 %1
- if [ "$middle" != "" ]; then
+ if [ "$second" != "" ]; then
kill -9 %2
fi;
Modified: experiments/stephen-receptionist/server/Makefile.am
==============================================================================
--- experiments/stephen-receptionist/server/Makefile.am (original)
+++ experiments/stephen-receptionist/server/Makefile.am Wed Aug 4 08:16:03 2010
@@ -1,8 +1,9 @@
bin_PROGRAMS = server
-AM_CPPFLAGS = -I$(top_srcdir)/common
+AM_CPPFLAGS = -I$(top_srcdir)/common $(BOOSTLOCINC)
-AM_LDFLAGS = -lboost_program_options -lboost_system -lboost_thread
+AM_LDFLAGS = $(BOOSTLOCLIB)
+AM_LDFLAGS += -lboost_program_options-mt -lboost_system-mt -lboost_thread-mt
server_LDADD = $(top_srcdir)/common/libcommon.a
Modified: experiments/stephen-receptionist/worker/Makefile.am
==============================================================================
--- experiments/stephen-receptionist/worker/Makefile.am (original)
+++ experiments/stephen-receptionist/worker/Makefile.am Wed Aug 4 08:16:03 2010
@@ -1,8 +1,8 @@
bin_PROGRAMS = worker
-AM_CPPFLAGS = -I$(top_srcdir)/common
+AM_CPPFLAGS = -I$(top_srcdir)/common $(BOOSTLOCINC)
-AM_LDFLAGS = -lboost_program_options -lboost_system
+AM_LDFLAGS = $(BOOSTLOCLIB) -lboost_program_options-mt -lboost_system-mt
worker_LDADD = $(top_srcdir)/common/libcommon.a
More information about the bind10-changes
mailing list