verbose debugs of socket messages

David Lee T.D.Lee at
Thu May 10 09:01:34 GMT 2001

On Wed, 9 May 2001, Jeremy Allison wrote:

> Andrew Tridgell wrote:
> > 
> > fine by me.
> > 
> > I'd also like to start removing some of our DEBUG() statements
> > sometime. They tend to get added when debugging code then not ever
> > removed, and they add a lot to the size of the binaries.
> I really don't want to do this. They get added as debugging
> code, and become essential when tracking down problems.
> I don't mind making them conditional on compile, but they
> have saved me on many occasions when tracking down 'impossible'
> problems.

I sympathise with Andrew's view, but I would urge caution before removing
the debug stuff.

Size:  My Solaris-compiled binary file for smbd is a mere 1.5MB.  That's
peanuts.  More accurately it is a single, shared peanut.  The real killer
with size is the per-process data area.  On a machine with, say, 800
simultaneous connections, even a mere 0.5MB change per process would be
huge.  But that's per-process data, not shared code.  The code size is
pales into insignificance in that context.  (Does the debug code
contribute significantly to pre-process _data_ area?)

Use frequency: The debug statements may not get used often.  But when they
do get used, they can be worth their bit-weight in gold.  So let's keep
the debugging statements.

Usefulness:  Ah!  This is where there is great scope for improvement.  The
current debugging is a large hammer, but the problems are rarely nails. 
If the debugging stuff could be re-worked to be selective, it would be
much better.  For example, sendmail's "m.n" technique to debug topic "m" 
at level "n".  (Note that I'm not commenting on sendmail's implementation,
simply its model for selecting a topic as well as a level.)  Just needs
someone (else!) to volunteer... 

Hope that helps.


:  David Lee                                I.T. Service          :
:  Systems Programmer                       Computer Centre       :
:                                           University of Durham  :
:            South Road            :
:                                           Durham                :
:  Phone: +44 191 374 2882                  U.K.                  :

More information about the samba-technical mailing list