From: Andrew Deason Date: Tue, 14 Sep 2010 14:45:10 +0000 (-0400) Subject: DAFS: Raise LogLevel for per-chain vol stats X-Git-Tag: upstream/1.8.0_pre1^2~4738 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e04f17704a4ceb242ea0b01abd225f89fa0979e7;p=packages%2Fo%2Fopenafs.git 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. Change-Id: Iceb38e29ab40958e05f3cf146687f679bd0f061c Reviewed-on: http://gerrit.openafs.org/2759 Reviewed-by: Derrick Brashear Tested-by: BuildBot --- diff --git a/src/viced/viced.c b/src/viced/viced.c index 632e6d48a..015091d04 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -714,6 +714,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; @@ -722,9 +725,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();