lib/generic_types.h: New File - Migrate various generic types out of httperf.h in preparation for a generic queue data structure and other code cleanups

This commit is contained in:
tedbullock 2007-07-15 21:14:22 +00:00
parent 1a02b3d2e6
commit 2660f78477
30 changed files with 129 additions and 28 deletions

View File

@ -1,3 +1,11 @@
2007-07-15 Ted Bullock <tbullock@canada.com>
* lib/generic_types.h: New File - Migrate various generic types
out of httperf.h in preparation for a generic queue data structure
* httperf.h: Removed unneccessary #include commands to minimize
header inclusion blocks and duplicates
* *.c: Added #include statements to use new generic_types.h
2007-07-15 Ted Bullock <tbullock@canada.com> 2007-07-15 Ted Bullock <tbullock@canada.com>
* timer.c, timer.h, httperf.c: Fixed memory leak associated with timers not being * timer.c, timer.h, httperf.c: Fixed memory leak associated with timers not being

View File

@ -32,10 +32,13 @@
02110-1301, USA 02110-1301, USA
*/ */
#include "config.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <conn.h> #include <conn.h>

View File

@ -39,6 +39,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <conn.h> #include <conn.h>

View File

@ -58,6 +58,7 @@
#include <netinet/tcp.h> #include <netinet/tcp.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <core.h> #include <core.h>

View File

@ -1,5 +1,5 @@
# what flags you want to pass to the C compiler & linker # what flags you want to pass to the C compiler & linker
AM_CFLAGS = -I$(srcdir)/.. AM_CFLAGS = -I$(srcdir)/.. -I$(srcdir)/../lib
AM_LDFLAGS = AM_LDFLAGS =
noinst_LIBRARIES = libgen.a noinst_LIBRARIES = libgen.a

View File

@ -34,8 +34,11 @@
/* Issue a sequence of calls on a connection. */ /* Issue a sequence of calls on a connection. */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <core.h> #include <core.h>

View File

@ -35,9 +35,12 @@
/* Creates connections at the fixed rate PARAM.RATE or sequentially if /* Creates connections at the fixed rate PARAM.RATE or sequentially if
PARAM.RATE is zero. */ PARAM.RATE is zero. */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <core.h> #include <core.h>
#include <localevent.h> #include <localevent.h>

View File

@ -41,6 +41,8 @@
--method Sets the method to be used when performing a --method Sets the method to be used when performing a
call. */ call. */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
@ -48,6 +50,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <localevent.h> #include <localevent.h>

View File

@ -32,10 +32,13 @@
02110-1301, USA 02110-1301, USA
*/ */
#include "config.h"
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <localevent.h> #include <localevent.h>
#include <object.h> #include <object.h>

View File

@ -40,6 +40,8 @@
that may be present in the set-cookie header that may be present in the set-cookie header
*/ */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
@ -47,6 +49,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <conn.h> #include <conn.h>

View File

@ -60,11 +60,14 @@
matches this failure status. matches this failure status.
*/ */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <conn.h> #include <conn.h>

View File

@ -35,10 +35,13 @@
/* Causes calls to make a request to the fixed URI specified by /* Causes calls to make a request to the fixed URI specified by
PARAM.URI. */ PARAM.URI. */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <localevent.h> #include <localevent.h>

View File

@ -66,6 +66,8 @@
Any comment on this module contact eranian@hpl.hp.com or Any comment on this module contact eranian@hpl.hp.com or
davidm@hpl.hp.com. */ davidm@hpl.hp.com. */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
@ -75,8 +77,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <core.h> #include <core.h>

View File

@ -35,11 +35,14 @@
/* Causes accesses to a fixed set of files (working set) in such a way /* Causes accesses to a fixed set of files (working set) in such a way
that is likely to cause disk I/O with a certain probability. */ that is likely to cause disk I/O with a certain probability. */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <localevent.h> #include <localevent.h>

View File

@ -34,6 +34,8 @@
/* Creates sessions at the fixed rate PARAM.RATE. */ /* Creates sessions at the fixed rate PARAM.RATE. */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
@ -41,6 +43,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <conn.h> #include <conn.h>

View File

@ -73,6 +73,8 @@
Any comment on this module contact carter@hpl.hp.com. */ Any comment on this module contact carter@hpl.hp.com. */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
@ -80,6 +82,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <conn.h> #include <conn.h>
#include <core.h> #include <core.h>

View File

@ -39,6 +39,8 @@
This is NOT a high performance workload generator! Use it only for This is NOT a high performance workload generator! Use it only for
non-performance critical tests. */ non-performance critical tests. */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
@ -46,6 +48,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <conn.h> #include <conn.h>

View File

@ -32,6 +32,8 @@
02110-1301, USA 02110-1301, USA
*/ */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
@ -39,8 +41,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <http.h> #include <http.h>
#include <call.h> #include <call.h>

View File

@ -72,6 +72,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <generic_types.h>
#include <core.h> #include <core.h>
#include <localevent.h> #include <localevent.h>
#include <httperf.h> #include <httperf.h>

View File

@ -37,32 +37,11 @@
#include "config.h" #include "config.h"
#include <sys/time.h>
#include <sys/types.h>
#include <sys/resource.h>
typedef double Time;
#define NELEMS(a) ((sizeof (a)) / sizeof ((a)[0])) #define NELEMS(a) ((sizeof (a)) / sizeof ((a)[0]))
#define TV_TO_SEC(tv) ((tv).tv_sec + 1e-6*(tv).tv_usec) #define TV_TO_SEC(tv) ((tv).tv_sec + 1e-6*(tv).tv_usec)
#define NUM_RATES 16 #define NUM_RATES 16
typedef union
{
char c;
int i;
long l;
u_char uc;
u_int ui;
u_long ul;
float f;
double d;
void *vp;
const void *cvp;
}
Any_Type;
typedef enum Dist_Type typedef enum Dist_Type
{ {
DETERMINISTIC, /* also called fixed-rate */ DETERMINISTIC, /* also called fixed-rate */

View File

@ -2,5 +2,5 @@
AM_LDFLAGS = AM_LDFLAGS =
noinst_LIBRARIES = libutil.a noinst_LIBRARIES = libutil.a
libutil_a_SOURCES = getopt.c getopt.h getopt1.c ssl_writev.c libutil_a_SOURCES = getopt.c getopt.h getopt1.c ssl_writev.c generic_types.h

View File

@ -0,0 +1,52 @@
/*
* Copyright (C) 2007 Ted Bullock <tbullock@canada.com>
*
* This file is part of httperf, a web server performance measurment tool.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* In addition, as a special exception, the copyright holders give permission
* to link the code of this work with the OpenSSL project's "OpenSSL" library
* (or with modified versions of it that use the same license as the "OpenSSL"
* library), and distribute linked combinations including the two. You must
* obey the GNU General Public License in all respects for all of the code
* used other than "OpenSSL". If you modify this file, you may extend this
* exception to your version of the file, but you are not obligated to do so.
* If you do not wish to do so, delete this exception statement from your
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef generic_types_h
#define generic_types_h
#include <sys/types.h>
typedef union {
char c;
int i;
long l;
u_char uc;
u_int ui;
u_long ul;
u_wide uw;
float f;
double d;
void *vp;
const void *cvp;
} Any_Type;
typedef double Time;
#endif /* generic_types_h */

View File

@ -32,9 +32,12 @@
02110-1301, USA 02110-1301, USA
*/ */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <localevent.h> #include <localevent.h>

View File

@ -32,12 +32,15 @@
02110-1301, USA 02110-1301, USA
*/ */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <conn.h> #include <conn.h>

View File

@ -31,6 +31,10 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA 02110-1301, USA
*/ */
#include "config.h"
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <localevent.h> #include <localevent.h>
#include <sess.h> #include <sess.h>

View File

@ -1,5 +1,5 @@
# what flags you want to pass to the C compiler & linker # what flags you want to pass to the C compiler & linker
AM_CFLAGS = -I$(srcdir)/.. -I$(srcdir)/../gen AM_CFLAGS = -I$(srcdir)/.. -I$(srcdir)/../gen -I$(srcdir)/../lib
noinst_LIBRARIES = libstat.a noinst_LIBRARIES = libstat.a
libstat_a_SOURCES = basic.c sess_stat.c print_reply.c stats.h libstat_a_SOURCES = basic.c sess_stat.c print_reply.c stats.h

View File

@ -40,7 +40,9 @@
#include <errno.h> #include <errno.h>
#include <float.h> #include <float.h>
#include <stdio.h> #include <stdio.h>
#include <sys/resource.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <localevent.h> #include <localevent.h>

View File

@ -35,11 +35,14 @@
/* This statistics collector simply prints the replies received from /* This statistics collector simply prints the replies received from
the server. */ the server. */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <conn.h> #include <conn.h>

View File

@ -34,12 +34,15 @@
/* Session statistics collector. */ /* Session statistics collector. */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <float.h> #include <float.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <call.h> #include <call.h>
#include <localevent.h> #include <localevent.h>

View File

@ -30,6 +30,8 @@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
@ -38,6 +40,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <generic_types.h>
#include <httperf.h> #include <httperf.h>
#include <timer.h> #include <timer.h>