Blame SOURCES/systemtap-example.stp

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