churchyard / rpms / python3

Forked from rpms/python3 6 years ago
Clone

Blame systemtap-example.stp

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