stap on a simple script: probe kernel.function("*@drivers/net/ibmveth.c") { printf("%s\n", probefunc()); } fails with the following error: ERROR: probe kernel.function("ibmveth_probe@drivers/net/ibmveth.c:1103") registration error (rc -22) stapio:stp_main_loop:301 probe_start() returned -1 stapio:cleanup_and_exit:216 CLEANUP AND EXIT closed=1 This is because ibmveth_probe is annotated __devinit and as such will be discarded after device initialization. Similarly for __devexit functions also. Like is currently done with __init and __exit section symbols, SystemTap must recognize and not probe __devinit/__devexit section symbols too.
Created attachment 2712 [details] Patch to disallow probing __devinit/exit,__cpuint/exit,__meminit/exit section symbols. This patch disallows user from probing __dev,__cpu,__mem(init/exit) functions and solves the problem. Thanks Srinivasa DS
The patch looks good to me, though in my x86-64 machines, I can find no such sections/symbols anyway.
(In reply to comment #2) > The patch looks good to me, though in my x86-64 machines, I can find no such > sections/symbols anyway. Frank Thanks for the review. I could see this, in my ppc system, [root@llm27lp1 ~]# readelf --sections /boot/vmlinux-2.6.25-rc7 | grep init [ 3] .cpuinit.text PROGBITS c000000000401b58 00411b58 [ 4] .devinit.text PROGBITS c00000000040506c 0041506c [ 5] .meminit.text PROGBITS c0000000004212e4 004312e4
commit f90f926