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:
父節點
1a02b3d2e6
當前提交
2660f78477
@ -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>
|
||||
|
||||
* timer.c, timer.h, httperf.c: Fixed memory leak associated with timers not being
|
||||
|
@ -32,10 +32,13 @@
|
||||
02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <conn.h>
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <conn.h>
|
||||
|
||||
|
@ -58,6 +58,7 @@
|
||||
#include <netinet/tcp.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <core.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
# what flags you want to pass to the C compiler & linker
|
||||
AM_CFLAGS = -I$(srcdir)/..
|
||||
AM_CFLAGS = -I$(srcdir)/.. -I$(srcdir)/../lib
|
||||
AM_LDFLAGS =
|
||||
|
||||
noinst_LIBRARIES = libgen.a
|
||||
|
@ -34,8 +34,11 @@
|
||||
|
||||
/* Issue a sequence of calls on a connection. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <core.h>
|
||||
|
@ -35,9 +35,12 @@
|
||||
/* Creates connections at the fixed rate PARAM.RATE or sequentially if
|
||||
PARAM.RATE is zero. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <core.h>
|
||||
#include <localevent.h>
|
||||
|
@ -41,6 +41,8 @@
|
||||
--method Sets the method to be used when performing a
|
||||
call. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
@ -48,6 +50,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <localevent.h>
|
||||
|
@ -32,10 +32,13 @@
|
||||
02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <localevent.h>
|
||||
#include <object.h>
|
||||
|
@ -40,6 +40,8 @@
|
||||
that may be present in the set-cookie header
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
@ -47,6 +49,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <conn.h>
|
||||
|
@ -60,11 +60,14 @@
|
||||
matches this failure status.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <conn.h>
|
||||
|
@ -35,10 +35,13 @@
|
||||
/* Causes calls to make a request to the fixed URI specified by
|
||||
PARAM.URI. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <localevent.h>
|
||||
|
@ -66,6 +66,8 @@
|
||||
Any comment on this module contact eranian@hpl.hp.com or
|
||||
davidm@hpl.hp.com. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
@ -75,8 +77,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <core.h>
|
||||
|
@ -35,11 +35,14 @@
|
||||
/* 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. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <localevent.h>
|
||||
|
@ -34,6 +34,8 @@
|
||||
|
||||
/* Creates sessions at the fixed rate PARAM.RATE. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
@ -41,6 +43,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <conn.h>
|
||||
|
@ -73,6 +73,8 @@
|
||||
|
||||
Any comment on this module contact carter@hpl.hp.com. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
@ -80,6 +82,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <conn.h>
|
||||
#include <core.h>
|
||||
|
@ -39,6 +39,8 @@
|
||||
This is NOT a high performance workload generator! Use it only for
|
||||
non-performance critical tests. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
@ -46,6 +48,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <conn.h>
|
||||
|
@ -32,6 +32,8 @@
|
||||
02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
@ -39,8 +41,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <http.h>
|
||||
#include <call.h>
|
||||
|
@ -72,6 +72,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <core.h>
|
||||
#include <localevent.h>
|
||||
#include <httperf.h>
|
||||
|
@ -37,32 +37,11 @@
|
||||
|
||||
#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 TV_TO_SEC(tv) ((tv).tv_sec + 1e-6*(tv).tv_usec)
|
||||
|
||||
#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
|
||||
{
|
||||
DETERMINISTIC, /* also called fixed-rate */
|
||||
|
@ -2,5 +2,5 @@
|
||||
AM_LDFLAGS =
|
||||
|
||||
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
|
||||
|
||||
|
52
httperf/src/lib/generic_types.h
Normal file
52
httperf/src/lib/generic_types.h
Normal 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 */
|
@ -32,9 +32,12 @@
|
||||
02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <localevent.h>
|
||||
|
||||
|
@ -32,12 +32,15 @@
|
||||
02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <conn.h>
|
||||
|
@ -31,6 +31,10 @@
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <localevent.h>
|
||||
#include <sess.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
# 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
|
||||
libstat_a_SOURCES = basic.c sess_stat.c print_reply.c stats.h
|
||||
|
@ -40,7 +40,9 @@
|
||||
#include <errno.h>
|
||||
#include <float.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <localevent.h>
|
||||
|
@ -35,11 +35,14 @@
|
||||
/* This statistics collector simply prints the replies received from
|
||||
the server. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <conn.h>
|
||||
|
@ -34,12 +34,15 @@
|
||||
|
||||
/* Session statistics collector. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <float.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <call.h>
|
||||
#include <localevent.h>
|
||||
|
@ -30,6 +30,8 @@
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
@ -38,6 +40,7 @@
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <generic_types.h>
|
||||
#include <httperf.h>
|
||||
#include <timer.h>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user