![]() 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/process/ |
#!/opt/rh/gcc-toolset-11/root/usr/bin/stap function time () { return gettimeofday_ms() } global time_name = "ms" global boredom = 10 # in time units global name, back, backtime, bored /* Note: the order that the probes are listed should not matter. However, the following order for probe kernel.function("wait_for_completion").return and probe kernel.function("wait_for_completion").call avoids have the kretprobe stuff in the backtrace. for more information see: http://sourceware.org/bugzilla/show_bug.cgi?id=6436 */ probe kernel.function("wait_for_completion").return { if ([tid()] in bored) { patience = time() - backtime[tid()] printf ("thread %d (%s) bored for %d %s\n", tid(), name[tid()], patience, time_name) } delete bored[tid()] delete back[tid()] delete name[tid()] delete backtime[tid()] } probe kernel.function("wait_for_completion").call { back[tid()]=backtrace() name[tid()]=execname() backtime[tid()]=time() delete bored[tid()] } probe timer.profile { foreach (tid+ in back) { if ([tid] in bored) continue patience = time() - backtime[tid] if (patience >= boredom) { printf ("thread %d (%s) impatient after %d %s\n", tid, name[tid], patience, time_name) print_syms (back[tid]) printf ("\n") bored[tid] = 1 # defer further reports to wakeup } } }