rxperf: Move into the tools directory

Move the 'rxperf' RX performance testing utility out of the
src/rx/test directory, and into the slightly more visible top level
src/tools/ directory

As this is the first time that rxperf has been built as part of the
default build, make a number of changes so that it will build on all
of our supported platforms.

Change-Id: Ice37e7db694dbfed34009bf76d24f1e0bf272e47
Reviewed-on: http://gerrit.openafs.org/7240
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Simon Wilkinson 2012-04-17 23:19:17 +01:00 committed by Derrick Brashear
parent db733e325e
commit 06cc5bec2c
12 changed files with 93 additions and 93 deletions

View File

@ -909,6 +909,7 @@ distclean: clean
src/tests/auth/Makefile \
src/tools/Makefile \
src/tools/dumpscan/Makefile \
src/tools/rxperf/Makefile \
src/tsalvaged/Makefile \
src/tsm41/Makefile \
src/tvolser/Makefile \

View File

@ -714,8 +714,15 @@ extra: afsrdr rpctestlib
! ELSE
@echo ***** Skipping $@ ***** Not found.
! ENDIF
finale: extra
tools: extra
@echo ***** $@
$(DOCD) $(SRC)\tools\rxperf
$(CD) $(SRC)\tools\rxperf
$(NTMAKE)
$(CD) ..\..\..
finale: tools
@echo ***** $@
$(DOCD) $(SRC)\$@
$(CD) $(SRC)\$@

View File

@ -229,6 +229,7 @@ src/tests/Makefile \
src/tests/run-tests \
src/tools/Makefile \
src/tools/dumpscan/Makefile \
src/tools/rxperf/Makefile \
src/tsalvaged/Makefile \
src/tsm41/Makefile \
src/tvolser/Makefile \

View File

@ -214,6 +214,12 @@ idirs: doclink
! IF (!EXIST($(OJT)\tvolser))
$(MKDIR) $(OJT)\tvolser
! ENDIF
! IF (!EXIST($(OJT)\tools))
$(MKDIR) $(OJT)\tools
! ENDIF
! IF (!EXIST($(OJT)\tools\rxperf))
$(MKDIR) $(OJT)\tools\rxperf
! ENDIF
! IF (!EXIST($(OJT)\dviced))
$(MKDIR) $(OJT)\dviced
! ENDIF

View File

@ -2,7 +2,6 @@
# git ls-files -i --exclude-standard
# to check that you haven't inadvertently ignored any tracked files.
/rxperf
/testclient
/testserver
/generator

View File

@ -25,15 +25,7 @@ LIBS = \
RXTESTOBJS = $(OUT)\testclient.obj $(OUT)\testserver.obj
tests: $(OUT)\rxperf.exe $(OUT)\testclient.exe $(OUT)\testserver.exe $(OUT)\tableGen.exe $(OUT)\generator.exe
$(OUT)\rxperf.res: rxperf.rc AFS_component_version_number.h
$(OUT)\rxperf.exe: $(OUT)\rxperf.obj $(OUT)\rxperf.res $(LIBS)
$(EXECONLINK)
$(_VC_MANIFEST_EMBED_EXE)
$(CODESIGN_USERLAND)
$(SYMSTORE_IMPORT)
tests: $(OUT)\testclient.exe $(OUT)\testserver.exe $(OUT)\tableGen.exe $(OUT)\generator.exe
$(OUT)\testclient.exe: $(OUT)\testclient.obj $(LIBS)
$(EXECONLINK)
@ -66,4 +58,4 @@ mkdir:
install: tests
clean::
$(DEL) $(TESTS) $(OUT)\rxperf.res
$(DEL) $(TESTS)

View File

@ -1,6 +1,6 @@
srcdir=@srcdir@
SUBDIRS=dumpscan
SUBDIRS=dumpscan rxperf
all dest install clean distclean:
@for A in $(SUBDIRS); do cd $$A && $(MAKE) $@ && cd .. || exit 1; done

5
src/tools/rxperf/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# After changing this file, please run
# git ls-files -i --exclude-standard
# to check that you haven't inadvertently ignored any tracked files.
/rxperf

View File

@ -0,0 +1,20 @@
srcdir=@srcdir@
include @TOP_OBJDIR@/src/config/Makefile.config
include @TOP_OBJDIR@/src/config/Makefile.pthread
LIBS= $(TOP_LIBDIR)/libafsrpc.a \
$(TOP_LIBDIR)/libopr.a
all: rxperf
rxperf: rxperf.o $(LIBS)
$(AFS_LDRULE) rxperf.o $(LIBS) $(LIB_hcrypto) $(LIB_roken) \
$(MT_LIBS) $(XLIBS)
install:
dest:
clean:
$(RM) -f rxperf.o rxperf

View File

@ -0,0 +1,41 @@
# Copyright 2000, International Business Machines Corporation and others.
# All Rights Reserved.
#
# This software has been released under the terms of the IBM Public
# License. For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html
AFSDEV_AUXCDEFINES = -DAFS_PTHREAD_ENV -DHAVE_WARNX -DHAVE_ERRX -DHAVE_WARN -DHAVE_ERR
!IF ("$(AFSDEV_BUILDTYPE)" == "CHECKED")
AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -DRXDEBUG
!ENDIF
RELDIR=tools/rxperf
!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
!INCLUDE ..\..\config\NTMakefile.version
LIBS = \
$(DESTDIR)\lib\afs\afsreg.lib \
$(DESTDIR)\lib\afs\mtafsutil.lib \
$(DESTDIR)\lib\afsrpc.lib \
$(DESTDIR)\lib\afspthread.lib \
$(DESTDIR)\lib\afsroken.lib \
$(DESTDIR)\lib\opr.lib
all: $(OUT)\rxperf.exe
$(OUT)\rxperf.res: rxperf.rc AFS_component_version_number.h
$(OUT)\rxperf.exe: $(OUT)\rxperf.obj $(OUT)\rxperf.res $(LIBS)
$(EXECONLINK)
$(_VC_MANIFEST_EMBED_EXE)
$(CODESIGN_USERLAND)
$(SYMSTORE_IMPORT)
mkdir:
install: all
clean::
$(DEL) $(OUT)\rxperf.res

View File

@ -59,76 +59,6 @@ nn * We are using getopt since we want it to be possible to link to
#define MAX_THREADS 128
#endif
static const char *__progname;
#ifndef HAVE_WARNX
static void
warnx(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
fprintf(stderr, "%s: ", __progname);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
va_end(args);
}
#endif /* !HAVE_WARNX */
#ifndef HAVE_ERRX
static void
errx(int eval, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
fprintf(stderr, "%s: ", __progname);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
va_end(args);
exit(eval);
}
#endif /* !HAVE_ERRX */
#ifndef HAVE_WARN
static void
warn(const char *fmt, ...)
{
va_list args;
char *errstr;
va_start(args, fmt);
fprintf(stderr, "%s: ", __progname);
vfprintf(stderr, fmt, args);
errstr = strerror(errno);
fprintf(stderr, ": %s\n", errstr ? errstr : "unknown error");
va_end(args);
}
#endif /* !HAVE_WARN */
#ifndef HAVE_ERR
static void
err(int eval, const char *fmt, ...)
{
va_list args;
char *errstr;
va_start(args, fmt);
fprintf(stderr, "%s: ", __progname);
vfprintf(stderr, fmt, args);
errstr = strerror(errno);
fprintf(stderr, ": %s\n", errstr ? errstr : "unknown error");
va_end(args);
exit(eval);
}
#endif /* !HAVE_ERR */
#define DEFAULT_PORT 7009 /* To match tcpdump */
#define DEFAULT_HOST "127.0.0.1"
#define DEFAULT_BYTES 1024 * 1024
@ -884,17 +814,17 @@ usage(void)
{
#define COMMON ""
fprintf(stderr, "usage: %s client -c send -b <bytes>\n", __progname);
fprintf(stderr, "usage: %s client -c recv -b <bytes>\n", __progname);
fprintf(stderr, "usage: %s client -c send -b <bytes>\n", getprogname());
fprintf(stderr, "usage: %s client -c recv -b <bytes>\n", getprogname());
fprintf(stderr,
"usage: %s client -c rpc -S <sendbytes> -R <recvbytes>\n",
__progname);
fprintf(stderr, "usage: %s client -c file -f filename\n", __progname);
getprogname());
fprintf(stderr, "usage: %s client -c file -f filename\n", getprogname());
fprintf(stderr,
"%s: usage: common option to the client "
"-w <write-bytes> -r <read-bytes> -T times -p port -s server -D\n",
__progname);
fprintf(stderr, "usage: %s server -p port\n", __progname);
getprogname());
fprintf(stderr, "usage: %s server -p port\n", getprogname());
#undef COMMMON
exit(1);
}
@ -1197,9 +1127,7 @@ main(int argc, char **argv)
PROCESS pid;
#endif
__progname = strrchr(argv[0], '/');
if (__progname == 0)
__progname = argv[0];
setprogname(argv[0]);
#ifndef AFS_NT40_ENV
signal(SIGUSR1, sigusr1);