系统是centos7,内核是3.10.0-327.18.2.el7.x86_64
把rpm包装在主机上,docker挂载/lib和/sys/kernel/debug
容器内安装systemtap,然后运行stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'
最后测试输出:
Pass 1: parsed user script and 110 library script(s) using 116404virt/37308res/2996shr/34824data kb, in 180usr/10sys/316real ms.
Pass 2: analyzed script: 1 probe(s), 1 function(s), 4 embed(s), 0 global(s) using 242920virt/163036res/2144shr/161340data kb, in 1580usr/590sys/5989real ms.
Pass 3: using cached /root/.systemtap/cache/95/stap_950c338b7b83d7b479c4b9227ccc8621_1659.c
Pass 4: using cached /root/.systemtap/cache/95/stap_950c338b7b83d7b479c4b9227ccc8621_1659.ko
Pass 5: starting run.
ERROR: Couldn't insert module '/tmp/stapfYXduB/stap_950c338b7b83d7b479c4b9227ccc8621_1659.ko': Operation not permitted
WARNING: /usr/bin/staprun exited with status: 1
Pass 5: run completed in 0usr/0sys/166real ms.
Pass 5: run failed. [man error::pass5]
权限是:
drwxrwxrwx. 7 root root 4096 May 17 23:29 tmp
不知道我安装的方法是不是有问题,求正确的安装方法!