This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: proposed perf.counter enhancement
- From: Stan Cox <scox at redhat dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: systemtap at sourceware dot org
- Date: Fri, 02 Nov 2012 14:56:35 -0400
- Subject: Re: proposed perf.counter enhancement
- References: <50859301.6060409@redhat.com> <y0mobjs7w2m.fsf@fche.csb>
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