Blame SOURCES/systemtap-example.stp

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