From ee49a57bb4cf90050ad0734647a1aa25cac5f1d9 Mon Sep 17 00:00:00 2001 From: Mark Vitale Date: Wed, 1 Apr 2020 14:48:37 -0400 Subject: [PATCH] afs: export internal stats for afs_CacheTruncateDaemon In preparation for a future commit, redefine CTD_stats so they can be reported externally. While here, move and rename the struct. While here, also remove an old comment concerning AIX. No functional change is incurred by this commit. Change-Id: If68e44f9dfae5a227d3a24f9fe34932ead1972d1 Reviewed-on: https://gerrit.openafs.org/14198 Reviewed-by: Cheyenne Wills Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk Reviewed-by: Michael Meffie Tested-by: BuildBot --- src/afs/afs_dcache.c | 15 +++------------ src/afs/afs_stats.h | 11 +++++++++++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index 7f9dc63396..72242172a3 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -428,19 +428,10 @@ afs_MaybeWaitForCacheDrain(void) } } -/*! - * /struct CTD_stats - * - * Keep statistics on run time for afs_CacheTruncateDaemon. This is a - * struct so we need only export one symbol for AIX. +/* + * Keep statistics on run time for afs_CacheTruncateDaemon. */ -static struct CTD_stats { - osi_timeval32_t CTD_beforeSleep; - osi_timeval32_t CTD_afterSleep; - osi_timeval32_t CTD_sleepTime; - osi_timeval32_t CTD_runTime; - int CTD_nSleeps; -} CTD_stats; +struct afs_CTD_stats CTD_stats; u_int afs_min_cache = 0; diff --git a/src/afs/afs_stats.h b/src/afs/afs_stats.h index 6c9dc29f93..e19ad14e30 100644 --- a/src/afs/afs_stats.h +++ b/src/afs/afs_stats.h @@ -1170,6 +1170,17 @@ struct afs_stats_CMFullPerf { struct afs_stats_AuthorInfo author; /*Authorship stats */ }; +/* + * Statistics on run time for afs_CacheTruncateDaemon. + */ +struct afs_CTD_stats { + osi_timeval32_t CTD_beforeSleep; + osi_timeval32_t CTD_afterSleep; + osi_timeval32_t CTD_sleepTime; + osi_timeval32_t CTD_runTime; + int CTD_nSleeps; +}; + #ifndef AFS_NOSTATS /* * We define routines to keep running counts and means. For the