Blame SOURCES/systemtap-example.stp

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