proposed perf.counter enhancement

Stan Cox scox@redhat.com
Fri Nov 2 18:54:00 GMT 2012


> By contrast, here's how I might imagine a similar scenario looking:
>
> probe perf.type(0).config(0).per_thread("y") { }  # y implicit special local
> global history
> probe process("foobar").function("*").return {
>        index = tid() # or probefunc()
>        history[index] <<< y-@entry(y)
> }
> # let implicit global printing take care of [history] stats printing


Here is a slightly tweaked version of the above that I have partially 
implemented.  bench.c is src/scripts/probe_perf/bench.c with -DLOOP=10


global A

probe perf.type(0).config(0).thread("z") {
}

probe process("./bench.x").statement("main@bench.c:1140")
{
   A <<< @perf("z")
}

probe process("./bench.x").statement("main@bench.c:1144")
{
   A <<< @perf("z")
}

probe end
{
   print (@hist_log(A))
}

-----------------------------------------------------------------------------

      value |-------------------------------------------------- count
       2048 |                                                   0
       4096 |                                                   0
       8192 |@                                                  1
      16384 |                                                   0
      32768 |                                                   0
            ~
    4194304 |                                                   0
    8388608 |                                                   0
   16777216 |@                                                  1
   33554432 |@@                                                 2
   67108864 |@@@                                                3
  134217728 |@@@@@@                                             6
  268435456 |@@@@@                                              5
  536870912 |@@@@                                               4



More information about the Systemtap mailing list