]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Francesco Chemolli <kinkie@squid-cache.org>
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 3 Jul 2009 00:36:45 +0000 (12:36 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 3 Jul 2009 00:36:45 +0000 (12:36 +1200)
Bug 2092: Changed select loop call counter to 64-bit

... unsigned long int so that it won't wrap around so easily.
Changed select loops counter from int to unsigned long int.

src/comm_epoll.cc
src/comm_kqueue.cc
src/comm_poll.cc
src/comm_select.cc
src/comm_select_win32.cc
src/stat.cc
src/structs.h

index 9dccfce6d478ad4b8fc399162b804119e45a7c8d..9d9031430b7ccdb3756db0d376bc1a4055543d6c 100644 (file)
@@ -232,7 +232,7 @@ static void
 commIncomingStats(StoreEntry * sentry)
 {
     StatCounters *f = &statCounter;
-    storeAppendPrintf(sentry, "Total number of epoll(2) loops: %d\n", statCounter.select_loops);
+    storeAppendPrintf(sentry, "Total number of epoll(2) loops: %ld\n", statCounter.select_loops);
     storeAppendPrintf(sentry, "Histogram of returned filedescriptors\n");
     statHistDump(&f->select_fds_hist, sentry, statHistIntDumper);
 }
@@ -265,7 +265,7 @@ comm_select(int msec)
 
     for (;;) {
         num = epoll_wait(kdpfd, pevents, SQUID_MAXFD, msec);
-        statCounter.select_loops++;
+        ++statCounter.select_loops;
 
         if (num >= 0)
             break;
index f40a20e63dc9e7f8e384e066fabe5e946e3dc687..f0b30b18a11cd1f53f097f9844fdf9343af9746b 100644 (file)
@@ -260,7 +260,7 @@ comm_select(int msec)
 
     for (;;) {
         num = kevent(kq, kqlst, kqoff, ke, KE_LENGTH, &poll_time);
-        statCounter.select_loops++;
+        ++statCounter.select_loops;
         kqoff = 0;
 
         if (num >= 0)
index 881ee904638782359d2630885ecad6cadd9048d5..7c785a412fff3c8be3d185b34e0e916961246d39 100644 (file)
@@ -408,9 +408,9 @@ comm_select(int msec)
 
         for (;;) {
             PROF_start(comm_poll_normal);
-            statCounter.syscalls.selects++;
+            ++statCounter.syscalls.selects;
             num = poll(pfds, nfds, msec);
-            statCounter.select_loops++;
+            ++statCounter.select_loops;
             PROF_stop(comm_poll_normal);
 
             if (num >= 0 || npending >= 0)
index 6e426f05e1852c705f036ddccd7a8dd57d4131e9..d527b4227572cb66ce9226cb88d863ae57a3cff4 100644 (file)
@@ -441,7 +441,7 @@ comm_select(int msec)
             poll_time.tv_usec = (msec % 1000) * 1000;
             statCounter.syscalls.selects++;
             num = select(maxfd, &readfds, &writefds, NULL, &poll_time);
-            statCounter.select_loops++;
+            ++statCounter.select_loops;
 
             if (num >= 0 || pending > 0)
                 break;
index 041fa4e3ce50d6df5136ffa5008df7d17f51f9c2..f099f8b70dfa3e62b97f20e8c27cbd902d0c8b89 100644 (file)
@@ -439,9 +439,9 @@ comm_select(int msec)
         for (;;) {
             poll_time.tv_sec = msec / 1000;
             poll_time.tv_usec = (msec % 1000) * 1000;
-            statCounter.syscalls.selects++;
+            ++statCounter.syscalls.selects;
             num = select(maxfd, &readfds, &writefds, &errfds, &poll_time);
-            statCounter.select_loops++;
+            ++statCounter.select_loops;
 
             if (num >= 0 || pending > 0)
                 break;
index 9bc2200ad3a7f028d72cef9bb85ae2065c3ff103..3293115179d4d399e75cdac54ad343497f1efd99 100644 (file)
@@ -514,7 +514,7 @@ info_get(StoreEntry * sentry)
     storeAppendPrintf(sentry, "\tAverage ICP messages per minute since start:\t%.1f\n",
                       (statCounter.icp.pkts_sent + statCounter.icp.pkts_recv) / (runtime / 60.0));
 
-    storeAppendPrintf(sentry, "\tSelect loop called: %d times, %0.3f ms avg\n",
+    storeAppendPrintf(sentry, "\tSelect loop called: %ld times, %0.3f ms avg\n",
                       statCounter.select_loops, 1000.0 * runtime / statCounter.select_loops);
 
     storeAppendPrintf(sentry, "Cache information for %s:\n",APP_SHORTNAME);
@@ -1367,7 +1367,7 @@ statCountersDump(StoreEntry * sentry)
                       f->unlink.requests);
     storeAppendPrintf(sentry, "page_faults = %d\n",
                       f->page_faults);
-    storeAppendPrintf(sentry, "select_loops = %d\n",
+    storeAppendPrintf(sentry, "select_loops = %ld\n",
                       f->select_loops);
     storeAppendPrintf(sentry, "cpu_time = %f\n",
                       f->cputime);
index 27ffee5c973cd1503e60343596c2344f7219d44d..dd201c54dd95e2224ace58089d38470f8c2b6af8 100644 (file)
@@ -1190,7 +1190,7 @@ struct _StatCounters {
         int times_used;
     } netdb;
     int page_faults;
-    int select_loops;
+    unsigned long int select_loops;
     int select_fds;
     double select_time;
     double cputime;