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