This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: proposed perf.counter enhancement



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]