RFC: maybe add two Systemtap scripts that instrument gencache and winbindd?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RFC: maybe add two Systemtap scripts that instrument gencache and winbindd?

Samba - samba-technical mailing list
Hi all!

Over the last few days, after realizing how damn simple it is to instrument code
with Systemtap with DWARF debug symbols present, I quickly implemented the
attached two Systemtap scripts.

The first one, maybe less interesting, but it's the one that started the
journey, instrument gencaches -- in arbitrary processes, can be smbd, winbindd,
whatever.

# stap gencache.stp winbindd
Collecting data, press ctrl-C to stop... ^C
gencache_set_data_blob         count:525 sum:159500us (min:7us avg:303us max:56280us)
gencache_parse                 count:1002 sum:505368us (min:3us avg:504us max:56248us)
gencache_get_data_blob         count:579 sum:397779us (min:6us avg:687us max:52464us)
gencache_del                   count:6 sum:142us (min:8us avg:23us max:36us)
gencache_stabilize             count:1 sum:47083us (min:47083us avg:47083us max:47083us)

gencache_set_data_blob time distribution histogram:
 value |-------------------------------------------------- count
     1 |                                                     0
     2 |                                                     0
     4 |@@@@@@@@@@@                                         77
     8 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@       311
    16 |@@@@@@@@@@@@@@@@@@                                 129
    32 |                                                     4
    64 |                                                     1
   128 |                                                     0
   256 |                                                     0
       ~
  8192 |                                                     0
 16384 |                                                     0
 32768 |                                                     3
 65536 |                                                     0
131072 |                                                     0

...
histogram for each function
...

The second script instruments winbindd in all its beauty:

# stap winbindd.stp
Collecting data, press ctrl-C to stop... ^C

Winbind request service time
============================
winbindd_getpwnam_send                   count:    99, sum:   6229 ms (min:   2669 us, avg:  62921 us, max: 157907 us)

Winbind request runtime
=======================
winbindd_getpwnam_send                   count:    99, sum:      3 ms (min:     21 us, avg:     36 us, max:     77 us)

Winbind domain-child request service time
=========================================
_wbint_LookupName                        count:    99, sum:   1403 ms (min:    619 us, avg:  14181 us, max: 136613 us)
_wbint_GetNssInfo                        count:    99, sum:      0 ms (min:      2 us, avg:      3 us, max:      6 us)
_wbint_LookupSid                         count:   102, sum:     49 ms (min:     13 us, avg:    481 us, max:   6315 us)
_wbint_Sids2UnixIDs                      count:   101, sum:      2 ms (min:     18 us, avg:     29 us, max:     49 us)
_wbint_LookupSids                        count:   101, sum:     84 ms (min:    411 us, avg:    838 us, max:   3524 us)

Winbind domain-child AD-backend service time
============================================
sid_to_name                              count:    56, sum:     45 ms (min:    431 us, avg:    816 us, max:   6275 us)
sequence_number                          count:    12, sum:   1209 ms (min:  46618 us, avg: 100803 us, max: 131439 us)
name_to_sid                              count:    99, sum:    176 ms (min:    547 us, avg:   1781 us, max:   9866 us)

Winbind request service time distributions (us)
===============================================
winbindd_getpwnam_send:
 value |-------------------------------------------------- count
   512 |                                                    0
  1024 |                                                    0
  2048 |@@@@@@@@@@@@@@                                     14
  4096 |@@@@                                                4
  8192 |                                                    0
 16384 |@@                                                  2
 32768 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@            39
 65536 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                  33
131072 |@@@@@@@                                             7
262144 |                                                    0
524288 |                                                    0

...
again histogram for each function
...

The requierements to run this is basically just Systemtap and Samba with debug
symbols, so on a distro you would install the systemtap package and probably
samba-debug or similar. That's it.

Do others find this useful? Attached patchset puts them into "script/", is there
a better place?

Btw, I have smbd on my list as well.

Cheerio!
-slow

look (106K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH] two Systemtap scripts that instrument gencache and winbindd (was: RFC: maybe add two Systemtap scripts that instrument gencache and winbindd?)

Samba - samba-technical mailing list
Hi all,

On Fri, Jul 07, 2017 at 06:59:46PM +0200, Ralph Böhme via samba-technical wrote:
> Over the last few days, after realizing how damn simple it is to instrument code
> with Systemtap with DWARF debug symbols present, I quickly implemented the
> attached two Systemtap scripts.
>
> ...

updated patchset attached that moves the scripts from script/ to
examples/systemtap/. Seems like a better place for them to live.

Cheerio!
-slow

look (106K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] two Systemtap scripts that instrument gencache and winbindd

Samba - samba-technical mailing list
Hi all,

On Fri, Jul 14, 2017 at 01:48:18PM +0200, Ralph Böhme via samba-technical wrote:
> On Fri, Jul 07, 2017 at 06:59:46PM +0200, Ralph Böhme via samba-technical wrote:
> > Over the last few days, after realizing how damn simple it is to instrument code
> > with Systemtap with DWARF debug symbols present, I quickly implemented the
> > attached two Systemtap scripts.
> >
> > ...
>
> updated patchset attached that moves the scripts from script/ to
> examples/systemtap/. Seems like a better place for them to live.

fixed some whitespace vs tabs indentation.

Please review&push if ok. Thanks!

Cheerio!
-slow

look (105K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] two Systemtap scripts that instrument gencache and winbindd

Samba - samba-technical mailing list
On Sat, Jul 15, 2017 at 06:54:27PM +0200, Ralph Böhme via samba-technical wrote:

> Hi all,
>
> On Fri, Jul 14, 2017 at 01:48:18PM +0200, Ralph Böhme via samba-technical wrote:
> > On Fri, Jul 07, 2017 at 06:59:46PM +0200, Ralph Böhme via samba-technical wrote:
> > > Over the last few days, after realizing how damn simple it is to instrument code
> > > with Systemtap with DWARF debug symbols present, I quickly implemented the
> > > attached two Systemtap scripts.
> > >
> > > ...
> >
> > updated patchset attached that moves the scripts from script/ to
> > examples/systemtap/. Seems like a better place for them to live.
>
> fixed some whitespace vs tabs indentation.
>
> Please review&push if ok. Thanks!

reviewed by metze and pushed. Unfortunately I messed up the reviewed-by tag and
put my name there instead of metze's. Sorry!

Cheerio!
-slow

Loading...