summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2010-03-19 14:57:45 -0400
committerFrank Ch. Eigler <fche@elastic.org>2010-03-19 14:57:45 -0400
commit8890a74f7c6b71b0346f7fca8ce43674f706d247 (patch)
treef0c20659ae1b97a1a40ed2777c49b334af8ccebc
parenta5d8d92a7c3b1ad18d6da416d4bb08922578f502 (diff)
downloadsystemtap-steved-8890a74f7c6b71b0346f7fca8ce43674f706d247.tar.gz
systemtap-steved-8890a74f7c6b71b0346f7fca8ce43674f706d247.tar.xz
systemtap-steved-8890a74f7c6b71b0346f7fca8ce43674f706d247.zip
tapset: port addr_to_node() to rhel4
-rw-r--r--tapset/memory.stp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tapset/memory.stp b/tapset/memory.stp
index c170c5c7..bc3883cd 100644
--- a/tapset/memory.stp
+++ b/tapset/memory.stp
@@ -93,9 +93,13 @@ probe vm.pagefault.return = kernel.function("__handle_mm_fault@mm/memory.c").ret
*
*/
function addr_to_node:long(addr:long) %{ /* pure */
- int nid;
int pfn = __pa(THIS->addr) >> PAGE_SHIFT;
+ int nid;
+#ifdef for_each_online_node
for_each_online_node(nid)
+#else
+ for (nid=0; nid<MAX_NUMNODES; nid++) /* if (node_online(nid)) */
+#endif
if ( NODE_DATA(nid)->node_start_pfn <= pfn &&
pfn < (NODE_DATA(nid)->node_start_pfn +
NODE_DATA(nid)->node_spanned_pages) )