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 :  /opt/rh/gcc-toolset-11/root/usr/share/systemtap/examples/memory/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/rh/gcc-toolset-11/root/usr/share/systemtap/examples/memory/cachestat.stp
#!/opt/rh/gcc-toolset-11/root/usr/bin/stap

/* Monitors hits and misses to the page cache and reports a count
 every 5 seconds. Based on a bpftrace tool by David Valin. */

// XXX: Rewrite after adding statistical aggregates, new printf to stapbpf.

global active
global hits, misses, total_hits, total_misses

probe begin {
  printf("%12s%12s%12s\n", "Hits", "Misses", "% Hits")
}

probe kernel.function("pagecache_get_page") {
  active[tid()] = 1
}

probe kernel.function("pagecache_get_page").return {
  active[tid()] = 0
}

probe kernel.function("find_get_entry").return {
  if (active[tid()]) {
    if ($return != 0) hits++ else misses++
  }
}

probe timer.s(5) {
  h = hits; m = misses
  hits = 0; misses = 0
  if (h + m > 0) {
    percent_hits = h*10000 / (h + m)
    printf("%12d%12d", h, m)
    printf("%8d.%02d%%\n", percent_hits/100, percent_hits%100)
  } else {
    printf("%12d%12d", 0, 0)
    printf("%8d.%02d%%\n", 0, 0)
  }

  total_hits += h
  total_misses += m
}

probe end {
  printf("\nSummary\n")
  printf("===\n")
  printf("total hits: %12d\n", total_hits)
  printf("total misses: %10d\n", total_misses)
  if (total_hits+total_misses > 0) {
    total_hit_percentage = total_hits*10000/(total_hits+total_misses)
    printf("hit percentage: %4d.%02d%%\n",
           total_hit_percentage/100, total_hit_percentage%100)
  }
}

Spamworldpro Mini