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/spawn_seeker.stp
#!/opt/rh/gcc-toolset-11/root/usr/bin/stap
# Copyright (C) 2014 Red Hat, Inc.
# Written by William Cohen <[email protected]>
#
#   spawn_seeker provides a breakdown of which processes and children
#   are spawning new processes.  To provide better information about
#   short-lived process, when a child exits the child's spawns are
#   added to its parent.
#
# control-c to exit data collection

global pid_name, fork_by_pid, fork_by_name, fork_count

probe kprocess.create {
  pid_name[pid()] = execname()
  fork_by_pid[pid()]++
  fork_by_name[execname()]++
  fork_count++
}

probe kprocess.exit {
  # take the fork count info for this pid and add it to the parent pid
  if (fork_by_pid[pid()]) {
    fork_by_pid[ppid()] += fork_by_pid[pid()]
    pid_name[ppid()] = pexecname()
    delete fork_by_pid[pid()]
    delete pid_name[pid()]
  }
}

# every minute print info
probe timer.s(60), end
{
  printf("\n%s\n", tz_ctime(gettimeofday_s()))
  if (fork_count == 0) next

  # print out the data by pid
  printf("\n%16s(%6s) %10s (percent)\n", "execname", "PID", "spawned")
  foreach (p in fork_by_pid-) {
    printf("%16s(%6d) %10d (%3d%%)\n", pid_name[p], p, fork_by_pid[p],
            (fork_by_pid[p]*100)/fork_count)
  }

  # print out the data by execname
  printf("\n%16s %10s (percent)\n", "execname", "spawned")
  foreach (n in fork_by_name-) {
    printf("%16s %10d (%3d%%)\n", n, fork_by_name[n],
           (fork_by_name[n]*100)/fork_count)
  }

  # reset for the next interval
  delete  fork_by_pid
  delete  fork_by_name
  fork_count = 0
}


Spamworldpro Mini