From 2f5b128e60509545a72df25629e1b8c93918f64d Mon Sep 17 00:00:00 2001 From: Frank Lahm Date: Tue, 2 Nov 2010 10:10:45 +0100 Subject: [PATCH] Move logging of dircache stats to dsi_close and reload request --- etc/afpd/afp_dsi.c | 9 ++++----- etc/afpd/dircache.c | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/etc/afpd/afp_dsi.c b/etc/afpd/afp_dsi.c index 277e412b..c2823ef1 100644 --- a/etc/afpd/afp_dsi.c +++ b/etc/afpd/afp_dsi.c @@ -84,8 +84,9 @@ static void afp_dsi_close(AFPObj *obj) if (obj->logout) (*obj->logout)(); - LOG(log_info, logtype_afpd, "%.2fKB read, %.2fKB written", + LOG(log_info, logtype_afpd, "AFP statistics: %.2f KB read, %.2f KB written", dsi->read_count/1024.0, dsi->write_count/1024.0); + log_dircache_stat(); dsi_close(dsi); } @@ -174,8 +175,7 @@ static void afp_dsi_timedown(int sig _U_) /* --------------------------------- * SIGHUP reload configuration file - * FIXME here or we wait ? -*/ + */ volatile int reload_request = 0; static void afp_dsi_reload(int sig _U_) @@ -214,8 +214,6 @@ static void alarm_handler(int sig _U_) * may use alarm() */ setitimer(ITIMER_REAL, &dsi->timer, NULL); - log_dircache_stat(); - /* we got some traffic from the client since the previous timer * tick. */ if ((child.flags & CHILD_DATA)) { @@ -390,6 +388,7 @@ void afp_over_dsi(AFPObj *obj) reload_request = 0; load_volumes(child.obj); dircache_dump(); + log_dircache_stat(); } /* The first SIGINT enables debugging, the next restores the config */ diff --git a/etc/afpd/dircache.c b/etc/afpd/dircache.c index 41635beb..44378c64 100644 --- a/etc/afpd/dircache.c +++ b/etc/afpd/dircache.c @@ -567,7 +567,7 @@ int dircache_init(int reqsize) */ void log_dircache_stat(void) { - LOG(log_debug, logtype_afpd, "dircache_stat: " + LOG(log_info, logtype_afpd, "dircache statistics: " "entries: %lu, lookups: %llu, hits: %llu, misses: %llu, added: %llu, removed: %llu, expunged: %llu, evicted: %llu", queue_count, dircache_stat.lookups, -- 2.39.2