systemtap/tests/Regression/python-probing/top.stp

20 lines
426 B
Plaintext
Raw Normal View History

#!/usr/bin/stap -v
global fn_calls;
probe python.function.entry
{
fn_calls[pid(), filename, funcname, lineno] += 1;
}
probe timer.ms(1000) {
foreach ([pid, filename, funcname, lineno] in fn_calls- limit 1000) {
if (filename =~ "random")
printf("%6d %80s %6d %30s %6d\n",
pid, filename, lineno, funcname,
fn_calls[pid, filename, funcname, lineno]);
}
delete fn_calls;
}