From: Ondřej Surý Date: Thu, 19 Jan 2023 10:55:00 +0000 (+0100) Subject: Remove the 'totalgets' memory counter X-Git-Tag: v9.19.10~18^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1ea889462629bb5fe1e853425163799a53162b10;p=thirdparty%2Fbind9.git Remove the 'totalgets' memory counter The totalgets falls into the same category as other "total" and "max" numbers - it's just a big number with no meaning to end user. --- diff --git a/lib/isc/mem.c b/lib/isc/mem.c index 63f5c4cf6e8..126add5c04d 100644 --- a/lib/isc/mem.c +++ b/lib/isc/mem.c @@ -112,7 +112,6 @@ struct element { struct stats { atomic_size_t gets; - atomic_size_t totalgets; }; #define MEM_MAGIC ISC_MAGIC('M', 'e', 'm', 'C') @@ -380,7 +379,6 @@ mem_getstats(isc_mem_t *ctx, size_t size) { atomic_fetch_add_release(&ctx->inuse, size); atomic_fetch_add_relaxed(&stats->gets, 1); - atomic_fetch_add_relaxed(&stats->totalgets, 1); } /*! @@ -465,7 +463,6 @@ mem_create(isc_mem_t **ctxp, unsigned int debugging, unsigned int flags) { for (size_t i = 0; i < STATS_BUCKETS + 1; i++) { atomic_init(&ctx->stats[i].gets, 0); - atomic_init(&ctx->stats[i].totalgets, 0); } ISC_LIST_INIT(ctx->pools); @@ -802,17 +799,14 @@ isc_mem_stats(isc_mem_t *ctx, FILE *out) { MCTXLOCK(ctx); for (size_t i = 0; i <= STATS_BUCKETS; i++) { - size_t totalgets; size_t gets; struct stats *stats = &ctx->stats[i]; - totalgets = atomic_load_acquire(&stats->totalgets); gets = atomic_load_acquire(&stats->gets); - if (totalgets != 0U && gets != 0U) { - fprintf(out, "%s%5zu: %11zu gets, %11zu rem", - (i == STATS_BUCKETS) ? ">=" : " ", i, - totalgets, gets); + if (gets != 0U) { + fprintf(out, "%s%5zu: %11zu rem", + (i == STATS_BUCKETS) ? ">=" : " ", i, gets); fputc('\n', out); } }