One Hat Cyber Team
Your IP :
216.73.216.115
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
systemtap
/
examples
/
memory
/
View File Name :
cachestat.stp
#!/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) } }