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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/17567/root/usr/share/systemtap/examples/process/semop-watch.stp
global threads;
global times;

probe syscall.{semop,semtimedop}
{
  sembuf_sz = @cast_sizeof("struct sembuf");
  res = sprintf("set %d sems", semid)

  %( systemtap_v < "2.3" %? 
     if (tsops_uaddr != 0) sops_uaddr = tsops_uaddr;
     /* ignore warning for semtimedop's 'tsops_uaddr never-assigned'. */
  %)

  for(i = 0; i < nsops; i++) {
    offset = i * sembuf_sz;
    pointer = sops_uaddr + offset;
    num_addr = & @cast(pointer, "struct sembuf")->sem_num;
    num = user_short(num_addr);

    res = sprintf("%s %d", res, num);
  }
  res = sprintf("%s\n", res);

  threads[tid()] = res;
  times[tid()] = gettimeofday_us();
}

probe syscall.{semop,semtimedop}.return
{
  printf("Thread %d took %dus to operate on %s\n", tid(),
         gettimeofday_us() - times[tid()], threads[tid()]);
}

haha - 2025