profiling stats for samba

Herb Lewis herb at chomps.engr.sgi.com
Wed Oct 4 18:16:03 GMT 2000


Dave, thanks for your input. More comments below.

David Collier-Brown wrote:
> 
> Herb Lewis wrote:
> > I would appreciate feedback and suggestions from all.
> 
> > struct profile_struct {
> >         int prof_shm_magic;
> >         int prof_shm_version;
> > /* general counters */
> >         unsigned smb_count; /* how many SMB packets we have processed */
> ...
> >         unsigned syscall_read_count;
> >         unsigned syscall_read_bytes;    /* bytes read with read syscall */
> 
>         If you're able to sample this at regular intervals, and the
>         numbers are resettable (to avoid easy rollover), then
>         you could extract some meaningfull comparative graphs
>         from this data and copilot...

Have you ever used Performance Co-Pilot (PCP)? It's now available on 
linux. It allows you to specify if you want absolute numbers displayed 
or else it automatically converts counters to rates for you. You can 
also setup your agent to allow any values you like to be settable 
however this really isn't necessary in this case as on rollover you 
would lose data from one sample only. I will probably allow setting 
of values in the agent just for completeness. Your agent can also
specify that it exports aggragate or computed values if you so desire
and then just do any computation necessary in the agent - as long as
you have the application save any necessary info :-)

> 
> > /* counters for individual SMB types */
> >         unsigned SMBmkdir_count;        /* create directory */
> 
>         Hmmn: perhaps number and time taken, so as to be able
>         to provide an average time-cost in a given sampling period.
>         (Much as Jeremy seem to be asking).
> 

Maybe I'll just include a time value for each smb and syscall
then we can decide in the code which ones we actually want to 
instrument and we don't have to change the structure definition 
if we decide later to time one more. I have already included all 
the SMB's defined in smb.h even though we do not implement some 
of them right now. The total structure size will still be under
2K.

To keep it simple I think I'll just keep a single set of numbers.
We can use Andrew's messaging scheme to turn profiling on or off
for a single PID or all smbd's. I think I'll reset all values when
a profile start message is received and default to profile off.

I haven't even thought about nmbd. Is there any info people would
like to see from that?

Comments?
-- 
======================================================================
Herb Lewis                               Silicon Graphics 
Networking Engineer                      1600 Amphitheatre Pkwy MS-510
Strategic Software Organization          Mountain View, CA  94043-1351
herb at sgi.com                             Tel: 650-933-2177
http://www.sgi.com                       Fax: 650-932-2177          
======================================================================




More information about the samba-technical mailing list