/usr/share/systemtap/examples/memory
NameSizeModeActions
cachestat.meta5450644editdlrm
cachestat.stp13180755editdlrm
glibc-malloc.meta3810644editdlrm
glibc-malloc.stp24860755editdlrm
hugepage_clear_delays.meta9460644editdlrm
hugepage_clear_delays.stp4830755editdlrm
hugepage_collapse.meta7180644editdlrm
hugepage_collapse.stp1590755editdlrm
hugepage_cow_delays.meta11060644editdlrm
hugepage_cow_delays.stp4750755editdlrm
hugepage_split.meta7560644editdlrm
hugepage_split.stp1530755editdlrm
hw_watch_addr.meta7870644editdlrm
hw_watch_addr.stp1670755editdlrm
hw_watch_addr.tcl970644editdlrm
hw_watch_sym.meta7150644editdlrm
hw_watch_sym.stp1670755editdlrm
hw_watch_sym.tcl970644editdlrm
kmalloc-top38880755editdlrm
kmalloc-top.meta6950644editdlrm
last_100_frees.meta4200644editdlrm
last_100_frees.stp8030755editdlrm
last_100_frees.tcl790644editdlrm
last_100_frees.txt7740644editdlrm
mmanonpage.meta12250644editdlrm
mmanonpage.stp18160755editdlrm
mmfilepage.meta10330644editdlrm
mmfilepage.stp35370755editdlrm
mmreclaim.meta6060644editdlrm
mmreclaim.stp52320755editdlrm
mmwriteback.meta11140644editdlrm
mmwriteback.stp19000755editdlrm
numa_faults.meta7020644editdlrm
numa_faults.stp9730755editdlrm
numa_faults.txt17100644editdlrm
overcommit.meta5840644editdlrm
overcommit.stp2170755editdlrm
pfaults.meta7440644editdlrm
pfaults.stp8750755editdlrm
pfaults.txt5580644editdlrm
vm.tracepoints.meta6080644editdlrm
vm.tracepoints.stp4140755editdlrm
vm.tracepoints.txt5570644editdlrm
Edit: /usr/share/systemtap/examples/memory/cachestat.stp (1318B)
#!/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) } }