Blame SOURCES/systemtap-example.stp

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