PHP 8.2.30
Preview: pyfuntop.stp Size: 537 B
/opt/alt/python34/share/doc/alt-python34-libs/pyfuntop.stp

#!/usr/bin/stap 

global fn_calls;

probe python.function.entry
{ 
  fn_calls[pid(), filename, funcname, lineno] += 1;
}

probe timer.ms(1000) {
    printf("\033[2J\033[1;1H") /* clear screen */
    printf("%6s %80s %6s %30s %6s\n",
           "PID", "FILENAME", "LINE", "FUNCTION", "CALLS")
    foreach ([pid, filename, funcname, lineno] in fn_calls- limit 20) {
        printf("%6d %80s %6d %30s %6d\n",
            pid, filename, lineno, funcname,
            fn_calls[pid, filename, funcname, lineno]);
    }

    delete fn_calls;
}

Directory Contents

Dirs: 0 × Files: 4

Name Size Perms Modified Actions
12.49 KB lrw-r--r-- 2019-03-18 16:51:26
Edit Download
537 B lrw-r--r-- 2024-04-17 17:02:21
Edit Download
7.40 KB lrw-r--r-- 2019-03-18 16:51:26
Edit Download
613 B lrw-r--r-- 2024-04-17 17:02:21
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).