I've just noticed these other issues:
1) epoll is enabled
2) xprof is not used
3) delay pools are not enabled

Attached is a proposal for this (supersedes my previous patch).

Regards,

On 5/29/06, Gonzalo Arana <[EMAIL PROTECTED]> wrote:
Hi,

I believe there is a little problem with this.  If store digest is not
enabled.  I get:
store_digest.cc: In function `void
   storeDigestRegisterWithCacheManager(CacheManager&)':
store_digest.cc:135: error: `registerAction' undeclared (first use this
   function)
store_digest.cc:135: error: (Each undeclared identifier is reported only once
   for each function it appears in.)

Attached is my proposal fix for this.

Regards,

On 5/28/06, Robert Collins <[EMAIL PROTECTED]> wrote:
> I hadn't heard anything back, so I've committed what I think is a
> tasteful implementation of the second option. This has allowed removing
> the stub_cache_manager.cc test suite file, as well as making a bunch of
> modules' init simpler.
>
> Cheers,
> Rob
>
> On Sun, 2006-05-28 at 00:18 +1000, Robert Collins wrote:
> > I'd like to make the cachemgrRegister calls in various of our fooInit()
> > calls not require dragging in the whole squid to the binary, this is
> > part of the blow-out on linked in objects for squid.
> >
> > Secondly, I'd like to remove the idea of the cachemanager being a global
> > object and make it be explicitly passed in when it exists.
> >
> > We discussed this somewhat on irc.
> >
> > Some possibilities:
> >
> > Assuming we have a CacheManager class with 'register' and 'unregister'
> > virtual methods, we could:
> >
> > * add that as a parameter to the Init calls where this is desirable.
> > * Have a separate call from Init in modules which asks the module to
> > register all its menu items with a supplied CacheManager.
> >
> > I prefer the second option, as it makes the behaviour of init more
> > occupied with 'what is required to use a module' rather than 'do
> > everything that /squid/ needs done before running that is related to
> > this module.' Henrik is concerned that this will increase the
> > maintenance cost of main(), which is possibly true, but I think we can
> > address that in future if needed, i.e. by a registry of the modules with
> > a few functions like 'init', 'registerWithCacheManger' etc.
> >
> > Thoughts?
> >
> > Rob
> --
> GPG key available at: <http://www.robertcollins.net/keys.txt>.
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
>
> iD8DBQBEej3JM4BfeEKYx2ERAoPWAJ4lSy5Rff8itOhm5WfyLcs06CA63ACgluZb
> OcntB2Y7OpvtYHxqh/MxQPk=
> =XJhV
> -----END PGP SIGNATURE-----
>
>
>


--
Gonzalo A. Arana





--
Gonzalo A. Arana
Index: src/comm_epoll.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/comm_epoll.cc,v
retrieving revision 1.11
diff -U6 -p -r1.11 comm_epoll.cc
--- src/comm_epoll.cc	29 May 2006 00:50:18 -0000	1.11
+++ src/comm_epoll.cc	29 May 2006 14:05:54 -0000
@@ -191,20 +191,36 @@ commSetSelect(int fd, unsigned int type,
     }
 
     if (timeout)
         F->timeout = squid_curtime + timeout;
 }
 
+
+static void commIncomingStats(StoreEntry * sentry);
+
+void
+commEPollRegisterWithCacheManager(CacheManager& manager)
+{
+    manager.registerAction("comm_select_incoming",
+                           "comm_incoming() stats",
+                           commIncomingStats, 0, 1);
+}
+static void
+commIncomingStats(StoreEntry * sentry)
+{
+    StatCounters *f = &statCounter;
+    storeAppendPrintf(sentry, "Total number of epoll(2) loops: %d\n", statCounter.select_loops);
+    storeAppendPrintf(sentry, "Histogram of returned filedescriptors\n");
+    statHistDump(&f->select_fds_hist, sentry, statHistIntDumper);
+}
+
 /*
+ * comm_select
  * Check all connections for new connections and input data that is to be
  * processed. Also check for connections with data queued and whether we can
  * write it out.
- */
-
-/*
- * comm_select
  *
  * Called to do the new-style IO, courtesy of of squid (like most of this
  * new IO code). This routine handles the stuff we've hidden in
  * comm_setselect and fd_table[] and calls callbacks for IO ready
  * events.
  */
Index: src/main.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/main.cc,v
retrieving revision 1.62
diff -U6 -p -r1.62 main.cc
--- src/main.cc	29 May 2006 00:50:18 -0000	1.62
+++ src/main.cc	29 May 2006 14:05:55 -0000
@@ -864,13 +864,15 @@ mainInitialize(void)
 #ifdef USE_SELECT
 
         commSelectRegisterWithCacheManager(manager);
 #endif
 
         clientdbRegisterWithCacheManager(manager);
+#if DELAY_POOLS
         DelayPools::RegisterWithCacheManager(manager);
+#endif
         DiskIOModule::RegisterAllModulesWithCacheManager(manager);
 #if USE_DNSSERVERS
 
         dnsRegisterWithCacheManager(manager);
 #endif
 
@@ -892,13 +894,15 @@ mainInitialize(void)
         storeRegisterWithCacheManager(manager);
 #if DEBUGSTRINGS
 
         StringRegistry::Instance().registerWithCacheManager(manager);
 #endif
 
+#if	USE_XPROF_STATS
         xprofRegisterWithCacheManager(manager);
+#endif
     }
 
 #if USE_WCCP
     wccpInit();
 
 #endif
Index: src/store_digest.cc
===================================================================
RCS file: /cvsroot/squid/squid3/src/store_digest.cc,v
retrieving revision 1.15
diff -U6 -p -r1.15 store_digest.cc
--- src/store_digest.cc	29 May 2006 00:50:18 -0000	1.15
+++ src/store_digest.cc	29 May 2006 14:05:55 -0000
@@ -38,15 +38,15 @@
  * TODO: We probably do not track all the cases when
  *       storeDigestNoteStoreReady() must be called; this may prevent
  *       storeDigestRebuild/write schedule to be activated
  */
 
 #include "squid.h"
+#include "CacheManager.h"
 #if USE_CACHE_DIGESTS
 
-#include "CacheManager.h"
 #include "Store.h"
 #include "HttpRequest.h"
 #include "HttpReply.h"
 #include "MemObject.h"
 #include "SquidTime.h"
 #include "StoreSearch.h"

Reply via email to