Blame systemtap-example.stp

e32ce18
/*
e32ce18
    Example usage of the Python systemtap tapset to show a nested view of all
e32ce18
    Python function calls (and returns) across the whole system.
e32ce18
e32ce18
    Run this using
e32ce18
        stap systemtap-example.stp
e32ce18
    to instrument all Python processes on the system, or (for example) using
e32ce18
        stap systemtap-example.stp -c COMMAND
e32ce18
    to instrument a specific program (implemented in Python)
e32ce18
*/
e32ce18
probe python.function.entry
e32ce18
{
e32ce18
  printf("%s => %s in %s:%d\n", thread_indent(1), funcname, filename, lineno);
e32ce18
}
e32ce18
e32ce18
probe python.function.return
e32ce18
{
e32ce18
  printf("%s <= %s in %s:%d\n", thread_indent(-1), funcname, filename, lineno);
e32ce18
}