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