This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: incorrect perf counters
riyakhanna1983 wrote:
> Is is possible to enable/disable counters on a function entry/exit?
Enabling/disabling is a relatively large amount of work. If you just
want a *delta* between function entry/exit, you could accumulate that
thusly:
stap -e '
global counts
probe perf.sw.cpu_clock.counter("foo") {}
probe process.function("*").return { counts <<< @perf("foo") - @entry(@perf("foo")) }
' -c /bin/ls
... but actually it seems we're not implementing @entry(@perf(...))
correctly just now, so you may need to do this instead:
global counts, zoo%
probe perf.sw.cpu_clock.counter("foo") {}
probe process.function("main").call { zoo[tid()] = @perf("foo") }
probe process.function("main").return { counts <<< @perf("foo") - zoo[tid()] }
' -c /bin/ls
- FChE