do_mmap fails to work on RHEL5.1GA

baiwd baiwd@cn.fujitsu.com
Tue Dec 18 00:58:00 GMT 2007


Hello:
     When I test with the newest stp on RHEL5.1GA, I  found that probe 
for do_mmap in memory.stp
cannot work correctly. It reported:
Pass 1: parsed user script and 38 library script(s) in 
306usr/4sys/325real ms.
Pass 2: analyzed script: 14 probe(s), 0 function(s), 0 embed(s), 0 
global(s) in 1076usr/97sys/1172real ms.
Pass 3: translated to C into 
"/tmp/stapLlRNuv/stap_5a545779c7b8d4c8da640eed3f8c78f8_2314.c" in 
1usr/0sys/1real ms.
Pass 4: compiled C into "stap_5a545779c7b8d4c8da640eed3f8c78f8_2314.ko" 
in 4715usr/245sys/4710real ms.
Pass 5: starting run.
ERROR: probe kernel.function("do_mmap@include/linux/mm.h:1001") 
registration error (rc -22)
      By looking through the elf file of linux kernel debug and the 
source codes, I think do_mmap and do_mmap2
are inlined functions, and they maybe inlined in optimization. But I 
find that do_mmap and do_mmap2 in all the
versions use do_mmap_pgoff which is not inlined and use almost the same 
arguments as do_mmap and do_mmap2.
So I wondered whether memory.stp can be changed as following:

--- memory.stp.old 2007-12-12 14:14:46.000000000 +0900
+++ memory.stp 2007-12-12 14:40:52.000000000 +0900
@@ -112,7 +112,7 @@ probe vm.write_shared_copy = kernel.func
* address - the requested address
* length - the length of the memory segment
*/
-probe vm.mmap = kernel.function("do_mmap"), kernel.function("do_mmap2")? {
+probe vm.mmap = kernel.function("do_mmap_pgoff") {
address = $addr
length = $len
}


 From Bai Weidong <baiwd@cn.fujitsu.com>
Best Regards



More information about the Systemtap mailing list