--------------------- PatchSet 2144 Date: 2001/04/29 00:17:36 Author: hno Branch: chunked_mempools Tag: (none) Log: Some statistics cleanups Members: include/MemPool.h:1.1.2.6->1.1.2.7 src/protos.h:1.23.4.2->1.23.4.3 src/stat.c:1.9.8.2->1.9.8.3 Index: squid/include/MemPool.h =================================================================== RCS file: /cvsroot/squid-sf//squid/include/Attic/MemPool.h,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- squid/include/MemPool.h 26 Apr 2001 17:13:03 -0000 1.1.2.6 +++ squid/include/MemPool.h 29 Apr 2001 00:17:36 -0000 1.1.2.7 @@ -110,6 +110,7 @@ extern void memPoolCleanIdlePools(void *unused); extern void memPoolShrink(MemPool * pool, ssize_t new_limit); extern void memPoolFlushMeters(MemPool * pool); +extern size_t memPoolsTotalAllocated(void); /* MemMeter */ Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.23.4.2 retrieving revision 1.23.4.3 diff -u -r1.23.4.2 -r1.23.4.3 --- squid/src/protos.h 18 Apr 2001 18:20:22 -0000 1.23.4.2 +++ squid/src/protos.h 29 Apr 2001 00:17:36 -0000 1.23.4.3 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.23.4.2 2001/04/18 18:20:22 akroonmaa Exp $ + * $Id: protos.h,v 1.23.4.3 2001/04/29 00:17:36 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -837,7 +837,6 @@ extern void memFree32K(void *); extern void memFree64K(void *); extern int memInUse(mem_type); -extern size_t memTotalAllocated(void); extern void memDataInit(mem_type, const char *, size_t, int); extern void memCheckInit(void); Index: squid/src/stat.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/stat.c,v retrieving revision 1.9.8.2 retrieving revision 1.9.8.3 diff -u -r1.9.8.2 -r1.9.8.3 --- squid/src/stat.c 19 Apr 2001 23:53:39 -0000 1.9.8.2 +++ squid/src/stat.c 29 Apr 2001 00:17:36 -0000 1.9.8.3 @@ -1,6 +1,6 @@ /* - * $Id: stat.c,v 1.9.8.2 2001/04/19 23:53:39 akroonmaa Exp $ + * $Id: stat.c,v 1.9.8.3 2001/04/29 00:17:36 hno Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -573,12 +573,12 @@ mp.fordblks >> 10); t = mp.uordblks + mp.usmblks + mp.hblkhd; storeAppendPrintf(sentry, "\tTotal in use: %6d KB %d%%\n", - t >> 10, percent(t, mp.arena)); + t >> 10, percent(t, mp.arena + mp.hblkhd)); t = mp.fsmblks + mp.fordblks; storeAppendPrintf(sentry, "\tTotal free: %6d KB %d%%\n", - t >> 10, percent(t, mp.arena)); - t = mp.uordblks + mp.usmblks + mp.hblkhd + mp.fsmblks + mp.fordblks; - storeAppendPrintf(sentry, "\tTotal holding: %6d KB\n", + t >> 10, percent(t, mp.arena + mp.hblkhd)); + t = mp.arena + mp.hblkhd; + storeAppendPrintf(sentry, "\tTotal size: %6d KB\n", t >> 10); #if HAVE_EXT_MALLINFO storeAppendPrintf(sentry, "\tmax size of small blocks:\t%d\n", mp.mxfast); @@ -594,10 +594,13 @@ #endif /* HAVE_EXT_MALLINFO */ #endif /* HAVE_MALLINFO */ storeAppendPrintf(sentry, "Memory accounted for:\n"); +#if !(HAVE_MSTATS && HAVE_GNUMALLOC_H) && HAVE_MALLINFO && HAVE_STRUCT_MALLINFO + storeAppendPrintf(sentry, "\tTotal accounted: %6d KB %3d%%\n", + statMemoryAccounted() >> 10, percent(statMemoryAccounted(), t)); +#else storeAppendPrintf(sentry, "\tTotal accounted: %6d KB\n", statMemoryAccounted() >> 10); - storeAppendPrintf(sentry, "\tmemPool accounted: %6d KB %3d%%\n", - memTotalAllocated() >> 10, percent(memTotalAllocated(), t)); +#endif storeAppendPrintf(sentry, "\tmemPoolAlloc calls: %9d\n", mem_pool_alloc_calls); storeAppendPrintf(sentry, "\tmemPoolFree calls: %9d\n", @@ -1527,7 +1530,7 @@ int statMemoryAccounted(void) { - memTotalAllocated(); + memPoolsTotalAllocated(); } #endif /* STAT_GRAPHS */