Blame SOURCES/systemtap-example.stp

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