output: sorted-list
scope: system-wide
description: The mmanonpage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, user space frees, page ins, copy on writes and unmaps for anonymous pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. This script displays the anonymous page statistics for each process that ran while the script is active. It's useful in debugging leaks in the anonymous regions of a process.
-test_support: stap -l 'kernel.trace("mm_page_allocation")' && stap -l 'kernel.trace("mm_page_free")' && stap -l 'kernel.trace("mm_anon_fault")' && stap -l 'kernel.trace("mm_anon_pgin")' && stap -l 'kernel.trace("mm_anon_cow")' && stap -l 'kernel.trace("mm_anon_unmap")' && stap -l 'kernel.trace("mm_anon_userfree")'
+test_support: (stap -l 'kernel.trace("mm_page_alloc")' || stap -l 'kernel.trace("mm_page_allocation")') && (stap -l 'kernel.trace("mm_page_free")' || stap -l 'kernel.trace("mm_page_free_direct")') && stap -l 'kernel.trace("mm_anon_fault")' && stap -l 'kernel.trace("mm_anon_pgin")' && stap -l 'kernel.trace("mm_anon_cow")' && stap -l 'kernel.trace("mm_anon_unmap")' && stap -l 'kernel.trace("mm_anon_userfree")'
test_check: stap -p4 mmanonpage.stp
test_installcheck: stap mmanonpage.stp -c "sleep 0.2"
return (!traced_pid || traced_pid == pid())
}
-probe kernel.trace("mm_page_allocation") {
+probe kernel.trace("mm_page_alloc")!, kernel.trace("mm_page_allocation") {
if (!log_event()) next
allocation[pid()] <<< 1
command[pid()] = execname()
}
-probe kernel.trace("mm_page_free") {
+probe kernel.trace("mm_page_free")!, kernel.trace("mm_page_free_direct") {
if (!log_event()) next
free[pid()] <<< 1
}
output: sorted-list
scope: system-wide
description: The mmfilepage.stp script uses the virtual memory tracepoints available in some kernels to track the number of faults, copy on writes mapping, and unmapping operations for file backed pages. When the script is terminated the counts are printed for each process that allocated pages while the script was running. The mmfilepage.stp script is useful in debugging leaks in the mapped file regions of a process.
-test_support: stap -l 'kernel.trace("mm_page_allocation")' && stap -l 'kernel.trace("mm_page_free")' && stap -l 'kernel.trace("mm_filemap_fault")' && stap -l 'kernel.trace("mm_filemap_cow")' && stap -l 'kernel.trace("mm_filemap_unmap")' && stap -l 'kernel.trace("mm_filemap_userunmap")'
+test_support: (stap -l 'kernel.trace("mm_page_alloc")' || stap -l 'kernel.trace("mm_page_allocation")') && (stap -l 'kernel.trace("mm_page_free")' || stap -l 'kernel.trace("mm_page_free_direct")') && stap -l 'kernel.trace("mm_filemap_fault")' && stap -l 'kernel.trace("mm_filemap_cow")' && stap -l 'kernel.trace("mm_filemap_unmap")' && stap -l 'kernel.trace("mm_filemap_userunmap")'
test_check: stap -p4 mmfilepage.stp
test_installcheck: stap mmfilepage.stp -c "sleep 0.2"
return (!traced_pid || traced_pid == pid())
}
-probe kernel.trace("mm_page_allocation") {
+probe kernel.trace("mm_page_alloc")!, kernel.trace("mm_page_allocation") {
if (!log_event()) next
allocation[pid()] <<< 1
command[pid()] = execname()
}
-probe kernel.trace("mm_page_free") {
+probe kernel.trace("mm_page_free")!, kernel.trace("mm_page_free_direct") {
if (!log_event()) next
free[pid()] <<< 1
}
output: sorted-list
scope: system-wide
description: The mmwriteback.stp script uses the virtual memory tracepoints available in some kernels to report all of the file writebacks that occur form kupdate, pdflush and kjournald while the script is running. It's useful in determining where writes are coming from on a supposedly idle system that is experiencing unexpected IO.
-test_support: stap -l 'kernel.trace("mm_pdflush_bgwriteout")' && stap -l 'kernel.trace("mm_pdflush_kupdate")' && stap -l 'kernel.trace("mm_pagereclaim_pgout")'
+test_support: (stap -l 'kernel.trace("balance_dirty_pages")' || stap -l 'kernel.trace("mm_balancedirty_writeout")' || stap -l 'kernel.trace("mm_pdflush_bgwriteout")') && (stap -l 'kernel.trace("writeback_pages_written")' || stap -l 'kernel.trace("mm_pdflush_kupdate")') && (stap -l 'kernel.trace("mm_vmscan_writepage")' || stap -l 'kernel.trace("mm_pagereclaim_pgout")')
test_check: stap -p4 mmwriteback.stp
test_installcheck: stap mmwriteback.stp -c "sleep 0.2"
return (!traced_pid || traced_pid == pid())
}
-probe kernel.trace("mm_pdflush_bgwriteout") {
+probe kernel.trace("balance_dirty_pages") !, # v3.2+
+ kernel.trace("mm_balancedirty_writeout") !, # RHEL6(2.6.32)
+ kernel.trace("mm_pdflush_bgwriteout") # RHEL5(2.6.18)
+{
if (!log_event()) next
- bgwriteout[pid()] <<< $count
+ bgwriteout[pid()] <<< (@defined($dirtied) ? $dirtied
+ : (@defined($written) ? $written : $count))
command[pid()] = execname()
}
-probe kernel.trace("mm_pdflush_kupdate") {
+probe kernel.trace("writeback_pages_written") !, # v2.6.36+
+ # & RHEL6(2.6.32)
+ kernel.trace("mm_pdflush_kupdate") # RHEL5(2.6.18)
+{
if (!log_event()) next
- kupdate[pid()] <<< $count
+ kupdate[pid()] <<< (@defined($pages_written) ? $pages_written : $count)
command[pid()] = execname()
}
-probe kernel.trace("mm_pagereclaim_pgout") {
+probe kernel.trace("mm_vmscan_writepage") !, # v2.6.36+
+ # & RHEL6(2.6.32)
+ kernel.trace("mm_pagereclaim_pgout") # RHEL5(2.6.18)
+ # & RHEL6(2.6.32)
+{
if (!log_event()) next
pgout[pid()] <<< 1
command[pid()] = execname()