]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DAFS: Raise LogLevel for per-chain vol stats
authorAndrew Deason <adeason@sinenomine.net>
Tue, 14 Sep 2010 14:45:10 +0000 (10:45 -0400)
committerDerrick Brashear <shadow@dementia.org>
Mon, 25 Oct 2010 18:03:07 +0000 (11:03 -0700)
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 <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit e04f17704a4ceb242ea0b01abd225f89fa0979e7)
Change-Id: I86499a2d73dbcdf04445e9f4976ef81e8f2d24ab
Reviewed-on: http://gerrit.openafs.org/3037
Tested-by: Derrick Brashear <shadow@dementia.org>
src/viced/viced.c

index ce5342a4754f5132a692dd9b35a9e3158798ec74..26d99e3c950cb41721eabcc9366234abedce3f57 100644 (file)
@@ -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();