1f7923656Sespie #ifndef STAT_H 2f7923656Sespie #define STAT_H 3*bb4544dfSespie /* $OpenBSD: stats.h,v 1.6 2010/07/19 19:46:44 espie Exp $ */ 404ed836eSespie 504ed836eSespie /* 604ed836eSespie * Copyright (c) 1999 Marc Espie. 704ed836eSespie * 804ed836eSespie * Code written for the OpenBSD project. 904ed836eSespie * 1004ed836eSespie * Redistribution and use in source and binary forms, with or without 1104ed836eSespie * modification, are permitted provided that the following conditions 1204ed836eSespie * are met: 1304ed836eSespie * 1. Redistributions of source code must retain the above copyright 1404ed836eSespie * notice, this list of conditions and the following disclaimer. 1504ed836eSespie * 2. Redistributions in binary form must reproduce the above copyright 1604ed836eSespie * notice, this list of conditions and the following disclaimer in the 1704ed836eSespie * documentation and/or other materials provided with the distribution. 1804ed836eSespie * 1904ed836eSespie * THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT AND CONTRIBUTORS 2004ed836eSespie * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2104ed836eSespie * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 2204ed836eSespie * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBSD 2304ed836eSespie * PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2404ed836eSespie * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2504ed836eSespie * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2604ed836eSespie * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2704ed836eSespie * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2804ed836eSespie * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2904ed836eSespie * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3004ed836eSespie */ 3104ed836eSespie 3204ed836eSespie /* statistical information gathering */ 3304ed836eSespie 3404ed836eSespie #if defined(STATS_VAR_LOOKUP) || \ 3504ed836eSespie defined(STATS_GN_CREATION) || \ 3604ed836eSespie defined(STATS_BUF) || \ 378fe18cbdSespie defined(STATS_HASH) || \ 3855491c75Sespie defined(STATS_GROW) || \ 3955491c75Sespie defined(STATS_SUFF) 4004ed836eSespie #define HAS_STATS 4104ed836eSespie #endif 4204ed836eSespie 4304ed836eSespie #ifdef HAS_STATS 44f7923656Sespie extern void Init_Stats(void); 45f7923656Sespie 4604ed836eSespie extern unsigned long *statarray; 4704ed836eSespie #define STAT_INVOCATIONS statarray[0] 4804ed836eSespie #define STAT_VAR_SEARCHES statarray[1] 4904ed836eSespie #define STAT_VAR_COUNT statarray[2] 5004ed836eSespie #define STAT_VAR_MAXCOUNT statarray[3] 5104ed836eSespie #define STAT_GN_COUNT statarray[4] 5204ed836eSespie #define STAT_TOTAL_BUFS statarray[5] 5304ed836eSespie #define STAT_DEFAULT_BUFS statarray[6] 5404ed836eSespie #define STAT_WEIRD_BUFS statarray[7] 5504ed836eSespie #define STAT_BUFS_EXPANSION statarray[8] 5604ed836eSespie #define STAT_WEIRD_INEFFICIENT statarray[9] 5704ed836eSespie #define STAT_VAR_HASH_CREATION statarray[10] 5804ed836eSespie #define STAT_VAR_FROM_ENV statarray[11] 5904ed836eSespie #define STAT_VAR_CREATION statarray[12] 6004ed836eSespie #define STAT_VAR_FIND statarray[13] 6104ed836eSespie #define STAT_HASH_CREATION statarray[14] 6204ed836eSespie #define STAT_HASH_ENTRIES statarray[15] 6304ed836eSespie #define STAT_HASH_EXPAND statarray[16] 6404ed836eSespie #define STAT_HASH_LOOKUP statarray[17] 6504ed836eSespie #define STAT_HASH_LENGTH statarray[18] 6604ed836eSespie #define STAT_HASH_SIZE statarray[19] 6704ed836eSespie #define STAT_HASH_POSITIVE statarray[20] 6804ed836eSespie #define STAT_USER_SECONDS statarray[21] 6904ed836eSespie #define STAT_USER_MS statarray[22] 7004ed836eSespie #define STAT_SYS_SECONDS statarray[23] 7104ed836eSespie #define STAT_SYS_MS statarray[24] 7204ed836eSespie #define STAT_VAR_HASH_MAXSIZE statarray[25] 7304ed836eSespie #define STAT_VAR_GHASH_MAXSIZE statarray[26] 7404ed836eSespie #define STAT_VAR_POWER statarray[27] 758fe18cbdSespie #define STAT_GROWARRAY statarray[28] 7655491c75Sespie #define STAT_SUFF_LOOKUP_NAME statarray[29] 7755491c75Sespie #define STAT_TRANSFORM_LOOKUP_NAME statarray[30] 7804ed836eSespie 7955491c75Sespie #define STAT_NUMBER 32 8004ed836eSespie 81f7923656Sespie #else 82f7923656Sespie #define Init_Stats() 8304ed836eSespie #endif 8404ed836eSespie 85f7923656Sespie #endif 86