churchyard / rpms / python2

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