churchyard / rpms / python2

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