之前转载了几篇介绍SystemTap的文章,以后要用到时方便查找。这不,最近就有这个需要了。于是,便开始安装。Linux下安装软件确实是件有点靠人品的事。很不幸,本人最近人品积攒不够啊,安装过程可以说是费尽周折哪!!
现在来总结以下吧:
前提:
(1)看清楚自己的操作系统版本!!!!Fedora下有两个版本:普通版本和PAE版本。通过:uname -r命令,可知道当前系统是用的什么版本;
(2)软件:kernel-版本,kernel-devel-版本,kernel-debuginfo-版本,如果是PAE版本,则是kernel-PAE-版本.........此处略去好几个字~~,还有一个软件是elfutils。
kernel:就是我们操作系统中的整个内核。官方说明:The kernel package contains the Linux kernel (vmlinuz), the core of anyLinux operating system. The kernel handles the basic functionsof the operating system: memory allocation, process allocation, deviceinput and output, etc.
kernel-devel:包含用于内核开发环境所需的内核头文件以及Makefile,不包含实现部分。主要用于一般内核模块的开发。
kernel-debuginfo:SystemTap需要通过内核调试信息来定位内核函数和变量的位置。
elfutils:SystemTap需要elfutils软件包提供的库函数来分析调试信息。
具体的软件作用还要等使用systemtap过程中慢慢体会了,这里由于能力所限,就不作深入讨论了~~本文注重systemtap安装过程,^_^
(3)此外,还要清楚自己的内核编译时是否添加了kprobes选项和compile the kernel with debuginfo选项。
参考网页:http://www.cygwin.com/ml/systemtap/2006-q1/msg00520.html
安装:
命令:yum --enablerepo=updates-debuginfo install kernel-debuginfo
参考网页:http://forums.fedoraforum.org/showthread.php?t=248478
善后:
(1) 查看是否有vmlinux文件:rpm -ql kernel-desktop-debuginfo | grep -c vmli
如果没有可不好哦~~
(2)如果在/boot目录下没有vmlinux的话,需要将vmlinuz解压为vmlinux,但是不能用gnuzip,下篇文章有转载。
参考网页:http://hi.baidu.com/fzmajian/blog/item/4636099b618e09aac9eaf4b3.html
(3)将(1)中的vmlinux文件复制到/boot目录下,并重命名为vmlinux-版本.debug。
检查:
ms.
Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s)
in 290usr/260sys/568real ms.
Pass 3: translated to C into "/tmp/stapiArgLX/
stap_e5886fa50499994e6a87aacdc43cd392_399.c" in 490usr/430sys/938real ms.
Pass 4: compiled C into "stap_e5886fa50499994e6a87aacdc43cd392_399.ko" in
3310usr/430sys/3714real ms.
Pass 5: starting run.
read performed
Pass 5: run completed in 10usr/40sys/73real ms.