![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /opt/rh/gcc-toolset-11/root/usr/share/systemtap/examples/general/ |
#!/opt/rh/gcc-toolset-11/root/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)); }