Fedora下的SystemTap安装

         之前转载了几篇介绍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。

        检查:      

        要检测是否安装正常,可运行如下命令:
        stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'
       如果输出结果如下,那么安装成功:
       Pass 1: parsed user script and 45 library script(s) in 340usr/0sys/358real
       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.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值