// memory related tapset // Copyright (C) 2005, 2006 IBM Corp. // // This file is part of systemtap, and is free software. You can // redistribute it and/or modify it under the terms of the GNU General // Public License (GPL); either version 2, or (at your option) any // later version. /* Record the page fault event */ probe pagefault = kernel.function(%( kernel_v >= "2.6.13" %? "__handle_mm_fault" %: "handle_mm_fault" %)) { write_access = $write_access address = $address } /* Return which node the given address belongs to in a NUMA system */ function addr_to_node:long(addr:long) /* pure */ %{ int nid; int pfn = __pa(THIS->addr) >> PAGE_SHIFT; for_each_online_node(nid) if ( node_start_pfn(nid) <= pfn && pfn < (node_start_pfn(nid) + NODE_DATA(nid)->node_spanned_pages) ) { THIS->__retvalue = nid; break; } %}