From 8d486ba36d09071998e11a46323120cb1feb6e33 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Tue, 14 Sep 2010 10:45:10 -0400 Subject: [PATCH] DAFS: Raise LogLevel for per-chain vol stats Only report detailed per-chain volume statistics on shutdown/SIGXCPU if LogLevel is 125 (or 25 for smaller per-chain stats). If a fileserver is configured with a large -vhashsize, printing out stats for each chain can take awhile and use up a nontrivial amount of disk space for logging, so only print out these stats if we're asked for them. Reviewed-on: http://gerrit.openafs.org/2759 Reviewed-by: Derrick Brashear Tested-by: BuildBot (cherry picked from commit e04f17704a4ceb242ea0b01abd225f89fa0979e7) Change-Id: I86499a2d73dbcdf04445e9f4976ef81e8f2d24ab Reviewed-on: http://gerrit.openafs.org/3037 Tested-by: Derrick Brashear --- src/viced/viced.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/viced/viced.c b/src/viced/viced.c index ce5342a47..26d99e3c9 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -716,6 +716,9 @@ PrintCounters(void) int workstations, activeworkstations, delworkstations; int processSize = 0; char tbuffer[32]; +#ifdef AFS_DEMAND_ATTACH_FS + int stats_flags = 0; +#endif FT_GetTimeOfDay(&tpl, 0); Statistics = 1; @@ -724,9 +727,12 @@ PrintCounters(void) afs_ctime(&StartTime, tbuffer, sizeof(tbuffer)))); #ifdef AFS_DEMAND_ATTACH_FS - /* XXX perhaps set extended stats verbosity flags - * based upon LogLevel ?? */ - VPrintExtendedCacheStats(VOL_STATS_PER_CHAIN2); + if (LogLevel >= 125) { + stats_flags = VOL_STATS_PER_CHAIN2; + } else if (LogLevel >= 25) { + stats_flags = VOL_STATS_PER_CHAIN; + } + VPrintExtendedCacheStats(stats_flags); #endif VPrintCacheStats(); VPrintDiskStats(); -- 2.39.5