diff --git a/Makefile.in b/Makefile.in index d35f4a6f3c..714f2f60b0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 \ diff --git a/NTMakefile b/NTMakefile index 3d2de46b91..0f1fa1b6e2 100644 --- a/NTMakefile +++ b/NTMakefile @@ -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)\$@ diff --git a/configure.ac b/configure.ac index 6d3dc5ce8b..35c8694351 100644 --- a/configure.ac +++ b/configure.ac @@ -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 \ diff --git a/src/config/NTMakefile b/src/config/NTMakefile index ff94d5c61c..cefdaee5c7 100644 --- a/src/config/NTMakefile +++ b/src/config/NTMakefile @@ -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 diff --git a/src/rx/test/.gitignore b/src/rx/test/.gitignore index c99ab9962f..f1fecd2ebe 100644 --- a/src/rx/test/.gitignore +++ b/src/rx/test/.gitignore @@ -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 diff --git a/src/rx/test/NTMakefile b/src/rx/test/NTMakefile index 3fa8ed5dab..38fa7df2e0 100644 --- a/src/rx/test/NTMakefile +++ b/src/rx/test/NTMakefile @@ -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) diff --git a/src/tools/Makefile.in b/src/tools/Makefile.in index d61a947c3e..45da45a1da 100644 --- a/src/tools/Makefile.in +++ b/src/tools/Makefile.in @@ -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 diff --git a/src/tools/rxperf/.gitignore b/src/tools/rxperf/.gitignore new file mode 100644 index 0000000000..5a2f4656e6 --- /dev/null +++ b/src/tools/rxperf/.gitignore @@ -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 diff --git a/src/tools/rxperf/Makefile.in b/src/tools/rxperf/Makefile.in new file mode 100644 index 0000000000..ca9943010e --- /dev/null +++ b/src/tools/rxperf/Makefile.in @@ -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 diff --git a/src/tools/rxperf/NTMakefile b/src/tools/rxperf/NTMakefile new file mode 100644 index 0000000000..3f79180b44 --- /dev/null +++ b/src/tools/rxperf/NTMakefile @@ -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 diff --git a/src/rx/test/rxperf.c b/src/tools/rxperf/rxperf.c similarity index 94% rename from src/rx/test/rxperf.c rename to src/tools/rxperf/rxperf.c index 67f2418a2a..3367fd2909 100644 --- a/src/rx/test/rxperf.c +++ b/src/tools/rxperf/rxperf.c @@ -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 \n", __progname); - fprintf(stderr, "usage: %s client -c recv -b \n", __progname); + fprintf(stderr, "usage: %s client -c send -b \n", getprogname()); + fprintf(stderr, "usage: %s client -c recv -b \n", getprogname()); fprintf(stderr, "usage: %s client -c rpc -S -R \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 -r -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); diff --git a/src/rx/test/rxperf.rc b/src/tools/rxperf/rxperf.rc similarity index 100% rename from src/rx/test/rxperf.rc rename to src/tools/rxperf/rxperf.rc