diff options
author | guanglei <guanglei> | 2006-07-04 03:57:49 +0000 |
---|---|---|
committer | guanglei <guanglei> | 2006-07-04 03:57:49 +0000 |
commit | 6b6427637595a0386674a51c65449f3004115a91 (patch) | |
tree | 7c982bd7443ca111c0c6a0af3ad268b716c7c0f5 | |
parent | ae0025b3661fafdddfe0a24695f385accc7c2cbf (diff) | |
download | systemtap-steved-6b6427637595a0386674a51c65449f3004115a91.tar.gz systemtap-steved-6b6427637595a0386674a51c65449f3004115a91.tar.xz systemtap-steved-6b6427637595a0386674a51c65449f3004115a91.zip |
add addr_to_node() from Jose Santos
-rw-r--r-- | stapfuncs.5.in | 5 | ||||
-rw-r--r-- | tapset/ChangeLog | 6 | ||||
-rw-r--r-- | tapset/memory.stp | 16 | ||||
-rw-r--r-- | tapset/syscalls.stp | 4 |
4 files changed, 29 insertions, 2 deletions
diff --git a/stapfuncs.5.in b/stapfuncs.5.in index 6406cf00..9934fa5f 100644 --- a/stapfuncs.5.in +++ b/stapfuncs.5.in @@ -250,6 +250,11 @@ system (cmd:string) Runs a command on the system. The command will run in the background when the current probe completes. +.SS NUMA +.TP +addr_to_node:long(addr:long) +Return which node the given address belongs to in a NUMA system. + .SH FILES .nh .IR /usr/share/systemtap/tapset diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 986f423d..ee7252f7 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,9 @@ +2006-07-04 Li Guanglei <guanglei@cn.ibm.com> + + * memory.stp: add addr_to_node() from Jose R. Santos + (jrs@us.ibm.com) + * syscalls.stp: typo for syscall.lstat + 2006-06-30 Martin Hunt <hunt@redhat.com> * conversions.stp (user_string): Don't generate errors diff --git a/tapset/memory.stp b/tapset/memory.stp index 9289ae5e..2682b5a7 100644 --- a/tapset/memory.stp +++ b/tapset/memory.stp @@ -14,3 +14,19 @@ probe pagefault 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; + } + +%} diff --git a/tapset/syscalls.stp b/tapset/syscalls.stp index d4be4941..7a1616d8 100644 --- a/tapset/syscalls.stp +++ b/tapset/syscalls.stp @@ -1648,7 +1648,7 @@ probe kernel.syscall.lsetxattr.return = # long sys_lstat(char __user * filename, struct __old_kernel_stat __user * statbuf) probe syscall.lstat = kernel.function("sys_lstat") ?, - kernel.function("cpmpat_sys_newlstat") ? + kernel.function("compat_sys_newlstat") ? { name = "lstat" file_name = user_string($filename) @@ -1657,7 +1657,7 @@ probe syscall.lstat = } probe syscall.lstat.return = kernel.function("sys_lstat").return ?, - kernel.function("cpmpat_sys_newlstat").return ? + kernel.function("compat_sys_newlstat").return ? { name = "lstat" retstr = returnstr(1) |