2022-01-21 12:51:15 +00:00
|
|
|
#!/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) {
|
2022-05-26 09:05:48 +00:00
|
|
|
if (filename =~ "random")
|
2022-01-21 12:51:15 +00:00
|
|
|
printf("%6d %80s %6d %30s %6d\n",
|
|
|
|
pid, filename, lineno, funcname,
|
|
|
|
fn_calls[pid, filename, funcname, lineno]);
|
|
|
|
}
|
|
|
|
|
|
|
|
delete fn_calls;
|
|
|
|
}
|