# stap -e 'probe begin{printf("Hello, World"); exit();}' -v Pass 1: parsed user script and 470 library scripts using 228220virt/41276res/3348shr/38016data kb, in 350usr/10sys/355real ms. Pass 2: analyzed script: 1 probe, 1 function, 0 embeds, 0 globals using 229144virt/42328res/3536shr/38940data kb, in 0usr/0sys/6real ms. Pass 3: using cached /root/.systemtap/cache/0b/stap_0bc9e27aef7a1de50ea41889a27fc524_1010.c Pass 4: using cached /root/.systemtap/cache/0b/stap_0bc9e27aef7a1de50ea41889a27fc524_1010.ko Pass 5: starting run. ERROR: module version mismatch (#1 SMP Tue Sep 12 10:10:26 CDT 2017 vs #1 SMP Tue Sep 12 22:26:13 UTC 2017), release 3.10.0-693.2.2.el7.x86_64 WARNING: /usr/bin/staprun exited with status: 1 Pass 5: run completed in 0usr/10sys/38real ms. Pass 5: run failed. [man error::pass5]
因为中间生成的C文件和ko模块都是用的cache (蓝色标注的部分),我们把上面的cache文件删除,再重新运行,这次可以成功了。
# stap -e 'probe begin{printf("Hello, World"); exit();}' Hello, World
参考ERROR: module version mismatch
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx