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