/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/last_100_frees.stp (803B)
#!/usr/bin/stap global bt%[100] probe process("/lib*/libc.so.*").function("free") { // we use @defined($mem) here because on 64 bit systems, the // wildcard search takes us through both 64 bit and 32 bit // libc (which doesn't have debuginfo), this means the probe // point resolved from the 32 bit library has no context info if (@defined($mem)) { bt[execname(),tid(),$mem,sprint_ubacktrace()] <<< local_clock_ns() } // Any monotonically increasing expression would do. // With some arbitrary expression or constant instead, // at worst we get the last 100ish results out of order. } probe end,error { foreach ([e,t,p,b] in bt @max+) // iterate in increasing index order printf("free #%d: %s[%d], pointer %p:\n%s\n\n", @max(bt[e,t,p,b]), e, t, p, b) }