Blame SOURCES/systemtap-example.stp

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