Blame SOURCES/systemtap-example.stp

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