HEX
Server: LiteSpeed
System: Linux w5304130.sdnsbox.com 4.18.0-425.3.1.lve.el8.x86_64 #1 SMP Tue Nov 22 22:59:23 EST 2022 x86_64
User: makefitmeserver (1001)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //usr/share/systemtap/examples/general/func_time_stats.stp
#!/usr/bin/stap
/*
 * func_time_stats.stp
 * usage: func_time_stats.stp function_probe
 */

global start, intervals

probe $1 { start[tid()] = gettimeofday_us() }
probe $1.return
{
  t = gettimeofday_us() 
  old_t = start[tid()]
  if (old_t) intervals <<< t - old_t
  delete start[tid()]
}
probe end
{
  printf("intervals min:%dus avg:%dus max:%dus count:%d variance:%d\n",
         @min(intervals), @avg(intervals), @max(intervals),
         @count(intervals), @variance(intervals, 3))
  print(@hist_log(intervals));
}