Browse Source

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

ahc_fix_select
tedbullock 17 years ago
parent
commit
2660f78477
30 changed files with 129 additions and 28 deletions
  1. +8
    -0
      httperf/ChangeLog
  2. +3
    -0
      httperf/src/call.c
  3. +1
    -0
      httperf/src/conn.c
  4. +1
    -0
      httperf/src/core.c
  5. +1
    -1
      httperf/src/gen/Makefile.am
  6. +3
    -0
      httperf/src/gen/call_seq.c
  7. +3
    -0
      httperf/src/gen/conn_rate.c
  8. +3
    -0
      httperf/src/gen/misc.c
  9. +3
    -0
      httperf/src/gen/rate.c
  10. +3
    -0
      httperf/src/gen/sess_cookie.c
  11. +3
    -0
      httperf/src/gen/session.c
  12. +3
    -0
      httperf/src/gen/uri_fixed.c
  13. +3
    -2
      httperf/src/gen/uri_wlog.c
  14. +3
    -0
      httperf/src/gen/uri_wset.c
  15. +3
    -0
      httperf/src/gen/wsess.c
  16. +3
    -0
      httperf/src/gen/wsesslog.c
  17. +3
    -0
      httperf/src/gen/wsesspage.c
  18. +3
    -2
      httperf/src/http.c
  19. +1
    -0
      httperf/src/httperf.c
  20. +0
    -21
      httperf/src/httperf.h
  21. +1
    -1
      httperf/src/lib/Makefile.am
  22. +52
    -0
      httperf/src/lib/generic_types.h
  23. +3
    -0
      httperf/src/localevent.c
  24. +3
    -0
      httperf/src/object.c
  25. +4
    -0
      httperf/src/sess.c
  26. +1
    -1
      httperf/src/stat/Makefile.am
  27. +2
    -0
      httperf/src/stat/basic.c
  28. +3
    -0
      httperf/src/stat/print_reply.c
  29. +3
    -0
      httperf/src/stat/sess_stat.c
  30. +3
    -0
      httperf/src/timer.c

+ 8
- 0
httperf/ChangeLog 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>

* timer.c, timer.h, httperf.c: Fixed memory leak associated with timers not being


+ 3
- 0
httperf/src/call.c View File

@@ -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>


+ 1
- 0
httperf/src/conn.c View File

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

#include <generic_types.h>
#include <httperf.h>
#include <conn.h>



+ 1
- 0
httperf/src/core.c View File

@@ -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
- 1
httperf/src/gen/Makefile.am View File

@@ -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


+ 3
- 0
httperf/src/gen/call_seq.c View File

@@ -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>


+ 3
- 0
httperf/src/gen/conn_rate.c View File

@@ -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>


+ 3
- 0
httperf/src/gen/misc.c View File

@@ -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>


+ 3
- 0
httperf/src/gen/rate.c View File

@@ -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>


+ 3
- 0
httperf/src/gen/sess_cookie.c View File

@@ -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>


+ 3
- 0
httperf/src/gen/session.c View File

@@ -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>


+ 3
- 0
httperf/src/gen/uri_fixed.c View File

@@ -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>


+ 3
- 2
httperf/src/gen/uri_wlog.c View File

@@ -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>


+ 3
- 0
httperf/src/gen/uri_wset.c View File

@@ -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>


+ 3
- 0
httperf/src/gen/wsess.c View File

@@ -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>


+ 3
- 0
httperf/src/gen/wsesslog.c View File

@@ -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>


+ 3
- 0
httperf/src/gen/wsesspage.c View File

@@ -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>


+ 3
- 2
httperf/src/http.c View File

@@ -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>


+ 1
- 0
httperf/src/httperf.c View File

@@ -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>


+ 0
- 21
httperf/src/httperf.h View File

@@ -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 */


+ 1
- 1
httperf/src/lib/Makefile.am View File

@@ -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
- 0
httperf/src/lib/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 */

+ 3
- 0
httperf/src/localevent.c View File

@@ -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>



+ 3
- 0
httperf/src/object.c View File

@@ -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>


+ 4
- 0
httperf/src/sess.c View File

@@ -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
- 1
httperf/src/stat/Makefile.am View File

@@ -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

+ 2
- 0
httperf/src/stat/basic.c View File

@@ -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>


+ 3
- 0
httperf/src/stat/print_reply.c View File

@@ -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>


+ 3
- 0
httperf/src/stat/sess_stat.c View File

@@ -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>


+ 3
- 0
httperf/src/timer.c View File

@@ -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…
Cancel
Save