From 2660f78477e4a8cfa30f12d9ae6403a46e7d3f4c Mon Sep 17 00:00:00 2001 From: tedbullock Date: Sun, 15 Jul 2007 21:14:22 +0000 Subject: [PATCH] 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 --- httperf/ChangeLog | 8 +++++ httperf/src/call.c | 3 ++ httperf/src/conn.c | 1 + httperf/src/core.c | 1 + httperf/src/gen/Makefile.am | 2 +- httperf/src/gen/call_seq.c | 3 ++ httperf/src/gen/conn_rate.c | 3 ++ httperf/src/gen/misc.c | 3 ++ httperf/src/gen/rate.c | 3 ++ httperf/src/gen/sess_cookie.c | 3 ++ httperf/src/gen/session.c | 3 ++ httperf/src/gen/uri_fixed.c | 3 ++ httperf/src/gen/uri_wlog.c | 5 ++-- httperf/src/gen/uri_wset.c | 3 ++ httperf/src/gen/wsess.c | 3 ++ httperf/src/gen/wsesslog.c | 3 ++ httperf/src/gen/wsesspage.c | 3 ++ httperf/src/http.c | 5 ++-- httperf/src/httperf.c | 1 + httperf/src/httperf.h | 21 ------------- httperf/src/lib/Makefile.am | 2 +- httperf/src/lib/generic_types.h | 52 +++++++++++++++++++++++++++++++++ httperf/src/localevent.c | 3 ++ httperf/src/object.c | 3 ++ httperf/src/sess.c | 4 +++ httperf/src/stat/Makefile.am | 2 +- httperf/src/stat/basic.c | 2 ++ httperf/src/stat/print_reply.c | 3 ++ httperf/src/stat/sess_stat.c | 3 ++ httperf/src/timer.c | 3 ++ 30 files changed, 129 insertions(+), 28 deletions(-) create mode 100644 httperf/src/lib/generic_types.h diff --git a/httperf/ChangeLog b/httperf/ChangeLog index e827b82..b640b59 100755 --- a/httperf/ChangeLog +++ b/httperf/ChangeLog @@ -1,3 +1,11 @@ +2007-07-15 Ted Bullock + + * 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 * timer.c, timer.h, httperf.c: Fixed memory leak associated with timers not being diff --git a/httperf/src/call.c b/httperf/src/call.c index 5181b89..c26a740 100755 --- a/httperf/src/call.c +++ b/httperf/src/call.c @@ -32,10 +32,13 @@ 02110-1301, USA */ +#include "config.h" + #include #include #include +#include #include #include #include diff --git a/httperf/src/conn.c b/httperf/src/conn.c index 94a2d74..a850e27 100755 --- a/httperf/src/conn.c +++ b/httperf/src/conn.c @@ -39,6 +39,7 @@ #include #include +#include #include #include diff --git a/httperf/src/core.c b/httperf/src/core.c index 816a540..8defc9b 100755 --- a/httperf/src/core.c +++ b/httperf/src/core.c @@ -58,6 +58,7 @@ #include #include +#include #include #include #include diff --git a/httperf/src/gen/Makefile.am b/httperf/src/gen/Makefile.am index 740f27e..21d79de 100755 --- a/httperf/src/gen/Makefile.am +++ b/httperf/src/gen/Makefile.am @@ -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 diff --git a/httperf/src/gen/call_seq.c b/httperf/src/gen/call_seq.c index acc393d..27dc995 100755 --- a/httperf/src/gen/call_seq.c +++ b/httperf/src/gen/call_seq.c @@ -34,8 +34,11 @@ /* Issue a sequence of calls on a connection. */ +#include "config.h" + #include +#include #include #include #include diff --git a/httperf/src/gen/conn_rate.c b/httperf/src/gen/conn_rate.c index 77a3820..6f6d9b7 100755 --- a/httperf/src/gen/conn_rate.c +++ b/httperf/src/gen/conn_rate.c @@ -35,9 +35,12 @@ /* Creates connections at the fixed rate PARAM.RATE or sequentially if PARAM.RATE is zero. */ +#include "config.h" + #include #include +#include #include #include #include diff --git a/httperf/src/gen/misc.c b/httperf/src/gen/misc.c index dee428d..f040af5 100755 --- a/httperf/src/gen/misc.c +++ b/httperf/src/gen/misc.c @@ -41,6 +41,8 @@ --method Sets the method to be used when performing a call. */ +#include "config.h" + #include #include #include @@ -48,6 +50,7 @@ #include #include +#include #include #include #include diff --git a/httperf/src/gen/rate.c b/httperf/src/gen/rate.c index ad6a589..9b3d54b 100755 --- a/httperf/src/gen/rate.c +++ b/httperf/src/gen/rate.c @@ -32,10 +32,13 @@ 02110-1301, USA */ +#include "config.h" + #include #include #include +#include #include #include #include diff --git a/httperf/src/gen/sess_cookie.c b/httperf/src/gen/sess_cookie.c index 129d3ad..9c947b2 100755 --- a/httperf/src/gen/sess_cookie.c +++ b/httperf/src/gen/sess_cookie.c @@ -40,6 +40,8 @@ that may be present in the set-cookie header */ +#include "config.h" + #include #include #include @@ -47,6 +49,7 @@ #include #include +#include #include #include #include diff --git a/httperf/src/gen/session.c b/httperf/src/gen/session.c index 85b1b3b..e3ef87a 100755 --- a/httperf/src/gen/session.c +++ b/httperf/src/gen/session.c @@ -60,11 +60,14 @@ matches this failure status. */ +#include "config.h" + #include #include #include #include +#include #include #include #include diff --git a/httperf/src/gen/uri_fixed.c b/httperf/src/gen/uri_fixed.c index b2d7960..3f8206f 100755 --- a/httperf/src/gen/uri_fixed.c +++ b/httperf/src/gen/uri_fixed.c @@ -35,10 +35,13 @@ /* Causes calls to make a request to the fixed URI specified by PARAM.URI. */ +#include "config.h" + #include #include #include +#include #include #include #include diff --git a/httperf/src/gen/uri_wlog.c b/httperf/src/gen/uri_wlog.c index ada0eb0..ca97345 100755 --- a/httperf/src/gen/uri_wlog.c +++ b/httperf/src/gen/uri_wlog.c @@ -66,6 +66,8 @@ Any comment on this module contact eranian@hpl.hp.com or davidm@hpl.hp.com. */ +#include "config.h" + #include #include #include @@ -75,8 +77,7 @@ #include #include -#include - +#include #include #include #include diff --git a/httperf/src/gen/uri_wset.c b/httperf/src/gen/uri_wset.c index cd29a11..2a9af52 100755 --- a/httperf/src/gen/uri_wset.c +++ b/httperf/src/gen/uri_wset.c @@ -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 #include #include #include +#include #include #include #include diff --git a/httperf/src/gen/wsess.c b/httperf/src/gen/wsess.c index 9b050ad..a0fe8df 100755 --- a/httperf/src/gen/wsess.c +++ b/httperf/src/gen/wsess.c @@ -34,6 +34,8 @@ /* Creates sessions at the fixed rate PARAM.RATE. */ +#include "config.h" + #include #include #include @@ -41,6 +43,7 @@ #include #include +#include #include #include #include diff --git a/httperf/src/gen/wsesslog.c b/httperf/src/gen/wsesslog.c index faf9c65..94a6e9d 100755 --- a/httperf/src/gen/wsesslog.c +++ b/httperf/src/gen/wsesslog.c @@ -73,6 +73,8 @@ Any comment on this module contact carter@hpl.hp.com. */ +#include "config.h" + #include #include #include @@ -80,6 +82,7 @@ #include #include +#include #include #include #include diff --git a/httperf/src/gen/wsesspage.c b/httperf/src/gen/wsesspage.c index fa4e9fd..c63047b 100755 --- a/httperf/src/gen/wsesspage.c +++ b/httperf/src/gen/wsesspage.c @@ -39,6 +39,8 @@ This is NOT a high performance workload generator! Use it only for non-performance critical tests. */ +#include "config.h" + #include #include #include @@ -46,6 +48,7 @@ #include #include +#include #include #include #include diff --git a/httperf/src/http.c b/httperf/src/http.c index 3acbb9d..4dba674 100755 --- a/httperf/src/http.c +++ b/httperf/src/http.c @@ -32,6 +32,8 @@ 02110-1301, USA */ +#include "config.h" + #include #include #include @@ -39,8 +41,7 @@ #include #include -#include - +#include #include #include #include diff --git a/httperf/src/httperf.c b/httperf/src/httperf.c index 4c5356a..c545ef8 100755 --- a/httperf/src/httperf.c +++ b/httperf/src/httperf.c @@ -72,6 +72,7 @@ #include #include +#include #include #include #include diff --git a/httperf/src/httperf.h b/httperf/src/httperf.h index b5edc62..639cd46 100755 --- a/httperf/src/httperf.h +++ b/httperf/src/httperf.h @@ -37,32 +37,11 @@ #include "config.h" -#include -#include -#include - -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 */ diff --git a/httperf/src/lib/Makefile.am b/httperf/src/lib/Makefile.am index cefeb30..cca8762 100755 --- a/httperf/src/lib/Makefile.am +++ b/httperf/src/lib/Makefile.am @@ -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 diff --git a/httperf/src/lib/generic_types.h b/httperf/src/lib/generic_types.h new file mode 100644 index 0000000..e9b4d6c --- /dev/null +++ b/httperf/src/lib/generic_types.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2007 Ted Bullock + * + * 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 + +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 */ diff --git a/httperf/src/localevent.c b/httperf/src/localevent.c index 54f292e..d8d5868 100755 --- a/httperf/src/localevent.c +++ b/httperf/src/localevent.c @@ -32,9 +32,12 @@ 02110-1301, USA */ +#include "config.h" + #include #include +#include #include #include diff --git a/httperf/src/object.c b/httperf/src/object.c index f8155f1..d1d7258 100755 --- a/httperf/src/object.c +++ b/httperf/src/object.c @@ -32,12 +32,15 @@ 02110-1301, USA */ +#include "config.h" + #include #include #include #include #include +#include #include #include #include diff --git a/httperf/src/sess.c b/httperf/src/sess.c index cb79d30..fb75e86 100755 --- a/httperf/src/sess.c +++ b/httperf/src/sess.c @@ -31,6 +31,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ + +#include "config.h" + +#include #include #include #include diff --git a/httperf/src/stat/Makefile.am b/httperf/src/stat/Makefile.am index 08498aa..bfcefb0 100755 --- a/httperf/src/stat/Makefile.am +++ b/httperf/src/stat/Makefile.am @@ -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 diff --git a/httperf/src/stat/basic.c b/httperf/src/stat/basic.c index 14700a7..ee5390f 100755 --- a/httperf/src/stat/basic.c +++ b/httperf/src/stat/basic.c @@ -40,7 +40,9 @@ #include #include #include +#include +#include #include #include #include diff --git a/httperf/src/stat/print_reply.c b/httperf/src/stat/print_reply.c index d976377..3151abf 100755 --- a/httperf/src/stat/print_reply.c +++ b/httperf/src/stat/print_reply.c @@ -35,11 +35,14 @@ /* This statistics collector simply prints the replies received from the server. */ +#include "config.h" + #include #include #include #include +#include #include #include #include diff --git a/httperf/src/stat/sess_stat.c b/httperf/src/stat/sess_stat.c index cbf9205..246764d 100755 --- a/httperf/src/stat/sess_stat.c +++ b/httperf/src/stat/sess_stat.c @@ -34,12 +34,15 @@ /* Session statistics collector. */ +#include "config.h" + #include #include #include #include #include +#include #include #include #include diff --git a/httperf/src/timer.c b/httperf/src/timer.c index 93b8484..7031952 100755 --- a/httperf/src/timer.c +++ b/httperf/src/timer.c @@ -30,6 +30,8 @@ * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" + #include #include #include @@ -38,6 +40,7 @@ #include +#include #include #include