![]() 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 : /proc/self/root/opt/rh/gcc-toolset-11/root/usr/share/systemtap/examples/general/ |
#!/opt/rh/gcc-toolset-11/root/usr/bin/stap /* * watchdog.stp * usage: stap watchdog.stp start_event stop_event time_ms */ global active, count function trigger(p:long) { /* may want to change the action here */ event=sprintf("/usr/bin/pstack %d", p); system(event); } probe $1 { active[pid()]=1 } probe $2 { delete active[pid()]; delete count[pid()]} probe timer.ms($3) { foreach (p in active) { count[p]++ if (count[p] == 2) trigger(p) } }