Annotation of src/usr.bin/make/stats.h, Revision 1.6
1.2 espie 1: #ifndef STAT_H
2: #define STAT_H
1.6 ! espie 3: /* $OpenBSD: stats.h,v 1.5 2010/07/19 19:30:37 espie Exp $ */
1.1 espie 4:
5: /*
6: * Copyright (c) 1999 Marc Espie.
7: *
8: * Code written for the OpenBSD project.
9: *
10: * Redistribution and use in source and binary forms, with or without
11: * modification, are permitted provided that the following conditions
12: * are met:
13: * 1. Redistributions of source code must retain the above copyright
14: * notice, this list of conditions and the following disclaimer.
15: * 2. Redistributions in binary form must reproduce the above copyright
16: * notice, this list of conditions and the following disclaimer in the
17: * documentation and/or other materials provided with the distribution.
18: *
19: * THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT AND CONTRIBUTORS
20: * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBSD
23: * PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30: */
31:
32: /* statistical information gathering */
33:
34: #if defined(STATS_VAR_LOOKUP) || \
35: defined(STATS_GN_CREATION) || \
36: defined(STATS_BUF) || \
1.3 espie 37: defined(STATS_HASH) || \
1.4 espie 38: defined(STATS_GROW) || \
39: defined(STATS_SUFF)
1.1 espie 40: #define HAS_STATS
41: #endif
42:
43: #ifdef HAS_STATS
1.2 espie 44: extern void Init_Stats(void);
45:
1.1 espie 46: extern unsigned long *statarray;
47: #define STAT_INVOCATIONS statarray[0]
48: #define STAT_VAR_SEARCHES statarray[1]
49: #define STAT_VAR_COUNT statarray[2]
50: #define STAT_VAR_MAXCOUNT statarray[3]
51: #define STAT_GN_COUNT statarray[4]
52: #define STAT_TOTAL_BUFS statarray[5]
53: #define STAT_DEFAULT_BUFS statarray[6]
54: #define STAT_WEIRD_BUFS statarray[7]
55: #define STAT_BUFS_EXPANSION statarray[8]
56: #define STAT_WEIRD_INEFFICIENT statarray[9]
57: #define STAT_VAR_HASH_CREATION statarray[10]
58: #define STAT_VAR_FROM_ENV statarray[11]
59: #define STAT_VAR_CREATION statarray[12]
60: #define STAT_VAR_FIND statarray[13]
61: #define STAT_HASH_CREATION statarray[14]
62: #define STAT_HASH_ENTRIES statarray[15]
63: #define STAT_HASH_EXPAND statarray[16]
64: #define STAT_HASH_LOOKUP statarray[17]
65: #define STAT_HASH_LENGTH statarray[18]
66: #define STAT_HASH_SIZE statarray[19]
67: #define STAT_HASH_POSITIVE statarray[20]
68: #define STAT_USER_SECONDS statarray[21]
69: #define STAT_USER_MS statarray[22]
70: #define STAT_SYS_SECONDS statarray[23]
71: #define STAT_SYS_MS statarray[24]
72: #define STAT_VAR_HASH_MAXSIZE statarray[25]
73: #define STAT_VAR_GHASH_MAXSIZE statarray[26]
74: #define STAT_VAR_POWER statarray[27]
1.3 espie 75: #define STAT_GROWARRAY statarray[28]
1.4 espie 76: #define STAT_SUFF_LOOKUP_NAME statarray[29]
77: #define STAT_TRANSFORM_LOOKUP_NAME statarray[30]
1.1 espie 78:
1.4 espie 79: #define STAT_NUMBER 32
1.1 espie 80:
1.2 espie 81: #else
82: #define Init_Stats()
1.1 espie 83: #endif
84:
1.2 espie 85: #endif