![]() 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/profiling/ |
#!/opt/rh/gcc-toolset-11/root/usr/bin/stap # # Copyright (C) 2018 Red Hat, Inc. # By William Cohen, Red Hat Inc. # [email protected] # # USAGE: stap syscallbypid.stp --suppress-handler-errors # # The "--suppress-handler-errors" option allows the script to continue # run when probes are skipped. The probe skips make the data less accurate, # but are otherwise harmless. global arr%[20000] global procname% probe syscall_any { arr[pid(), syscall_nr]++ procname[pid()] = execname() } probe scheduler.process_exit { delete arr[pid(),*] delete procname[pid()] } function process_name(pid) { return sprintf("%s[%d]", procname[pid], pid) } probe prometheus { @prometheus_dump_array2_map(arr, "syscall_count", "pid", "name", sprint, process_name, syscall_name ) }