Debug support
Richard Sharpe
sharpe at ns.aus.com
Sat Nov 21 22:29:06 GMT 1998
Hi folks,
for the multithreaded SMB server I am writing, I have adopted a slightly
different approach than Samba, but have copied ideas liberally from Samba.
I trust that presents no problems.
My approach is that I will have a debug level and several modules, for
example:
DEBUG_MAIN
DEBUG_MEM
DEBUG_THREAD
DEBUG_RFC1001
DEBUG_NETBEUI
DEBUG_SMB
and each debug statement nominates which module it relates to.
After I get my command line parsing code done, I will then be able to
specify which module I am interested in seeing the DEBUG statements from.
So, if I only want to see the debug statements from memory management, I
simply specify on the command line:
-dMEM:4
This has already allowed me to simply see that I have quite a lot of memory
leaks (in one test run, 9000 allocates versus 3000 frees).
This approach allows me to concentrate on one area rather than seeing heaps
of debugging statements from all over the code.
Regards
-------
Richard Sharpe, sharpe at ns.aus.com, NIC-Handle:RJS96
NS Computer Software and Services P/L,
Ph: +61-8-8281-0063, FAX: +61-8-8250-2080,
Samba, Linux, Apache, Digital UNIX, AIX, Netscape, Stronghold, C, ...
More information about the samba-technical
mailing list