diff -ruN imap-4.6.BETA.orig/Makefile imap-4.6.BETA/Makefile --- imap-4.6.BETA.orig/Makefile Wed Apr 21 10:42:32 1999 +++ imap-4.6.BETA/Makefile Sat May 1 21:22:24 1999 @@ -161,7 +161,7 @@ # gradually-increasing intervals, starting at 2800-2900, and becoming # permanent at 48,300. -EXTRACFLAGS= +EXTRACFLAGS=-DVERBOSELOG # Extra linker flags (additional/alternative libraries, etc.) diff -ruN imap-4.6.BETA.orig/src/imapd/imapd.c imap-4.6.BETA/src/imapd/imapd.c --- imap-4.6.BETA.orig/src/imapd/imapd.c Fri Mar 26 09:11:29 1999 +++ imap-4.6.BETA/src/imapd/imapd.c Sat May 1 21:37:52 1999 @@ -58,6 +58,11 @@ #include #include "misc.h" +#ifdef VERBOSELOG +#include +#include +#include +#endif /* Timeouts and timers */ @@ -209,6 +214,11 @@ char *lastid = NIL; /* last fetched body id for this message */ SIZEDTEXT lastst = {NIL,0}; /* last sizedtext */ +#ifdef VERBOSELOG +time_t *timer; /* timer */ +time_t starttime; /* record start time of process */ +double uutime,sstime; /* user and system time */ +#endif /* Response texts which appear in multiple places */ @@ -235,6 +245,9 @@ int main (int argc,char *argv[]) { +#ifdef VERBOSELOG + struct rusage sysinfo; +#endif unsigned long i,j,k,m,uid; long f; char *s,*t,*u,*v,tmp[MAILTMPLEN]; @@ -264,6 +277,9 @@ default: fatal ("Unknown state from myusername_full()"); } +#ifdef VERBOSELOG + starttime = time(timer); +#endif PSOUT ("* "); PSOUT (t); PBOUT (' '); @@ -1114,6 +1130,34 @@ } while (state != LOGOUT); /* until logged out */ syslog (LOG_INFO,"Logout user=%.80s host=%.80s",user ? user : "???", tcp_clienthost ()); +#ifdef VERBOSELOG + /* This is for additional logging information so that we can do analysis */ + getrusage(RUSAGE_SELF,&sysinfo); + + uutime = (double) sysinfo.ru_utime.tv_sec + + sysinfo.ru_utime.tv_usec / 1000000.0; + sstime = (double) sysinfo.ru_stime.tv_sec + + sysinfo.ru_stime.tv_usec / 1000000.0; + + syslog (LOG_INFO,"u %s from %s start %d et %d ut %.3f st %.3f mss %ld iss %ld minf %ld majf %ld sw %ld bi %ld bo %ld mi %ld mo %ld nsig %ld vcs %ld ics %ld", user ? user : "???", + tcp_clienthost (), + starttime, + time(timer) - starttime, + uutime, + sstime, + sysinfo.ru_maxrss, + sysinfo.ru_idrss, + sysinfo.ru_minflt, + sysinfo.ru_majflt, + sysinfo.ru_nswap, + sysinfo.ru_inblock, + sysinfo.ru_oublock, + sysinfo.ru_msgrcv, + sysinfo.ru_msgsnd, + sysinfo.ru_nsignals, + sysinfo.ru_nvcsw, + sysinfo.ru_nivcsw); +#endif return 0; /* all done */ } @@ -1339,12 +1383,43 @@ void clkint (void) { +#ifdef VERBOSELOG + struct rusage sysinfo; +#endif alarm (0); /* disable all interrupts */ server_init (NIL,NIL,NIL,NIL,SIG_IGN,SIG_IGN,SIG_IGN,SIG_IGN); if (!quell_events) PSOUT ("* BYE Autologout; idle for too long\015\012"); syslog (LOG_INFO,"Autologout user=%.80s host=%.80s",user ? user : "???", tcp_clienthost ()); +#ifdef VERBOSELOG + /* This is for additional logging information so that we can do analysis */ + getrusage(RUSAGE_SELF,&sysinfo); + + uutime = (double) sysinfo.ru_utime.tv_sec + + sysinfo.ru_utime.tv_usec / 1000000.0; + sstime = (double) sysinfo.ru_stime.tv_sec + + sysinfo.ru_stime.tv_usec / 1000000.0; + + syslog (LOG_INFO,"u %s from %s start %d et %d ut %.3f st %.3f mss %ld iss %ld minf %ld majf %ld sw %ld bi %ld bo %ld mi %ld mo %ld nsig %ld vcs %ld ics %ld", user ? user : "???", + tcp_clienthost (), + starttime, + time(timer) - starttime, + uutime, + sstime, + sysinfo.ru_maxrss, + sysinfo.ru_idrss, + sysinfo.ru_minflt, + sysinfo.ru_majflt, + sysinfo.ru_nswap, + sysinfo.ru_inblock, + sysinfo.ru_oublock, + sysinfo.ru_msgrcv, + sysinfo.ru_msgsnd, + sysinfo.ru_nsignals, + sysinfo.ru_nvcsw, + sysinfo.ru_nivcsw); +#endif PFLUSH; /* make sure output blatted */ if (critical) state = LOGOUT; /* badly hosed if in critical code */ else { /* try to gracefully close the stream */