Olga.Kornievskaia wrote:
> [...] say there are two tracepoints �foobar_enter� and
> �foobar_exit�. Each tracepoint logs a timestamp. I�d like to be able
> to say that on average it takes that many time-units between �enter�
> and �exit� tracepoints. [...]
For completeness, a complete systemtap implementation of this could look like:
# stap -e '
global s, t%
probe kernel.trace("foobar_enter") {
t[tid()]=gettimeofday_us()
}
probe kernel.trace("foobar_exit") {
if (tid() in t) { s <<< gettimeofday_us() - t[tid()] }
}
probe timer.s(5),end {
printf("cumulative average us: %d\n", @avg(s))
}
'
- FChE
--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html