在Ubuntu上使用SystemTap
来源:互联网 发布:网络电视有翡翠台吗 编辑:程序博客网 时间:2024/06/04 21:16
http://www.ningoo.net/html/2010/use_systemtap_on_ubuntu.html
虽然很早以前听说过,但基本没用过,最近褚霸同学的介绍,勾起了我对这个东西的兴趣。最近在工作笔记本上装了个Ubuntu10.10做为主操作系统,因此正好在上面也实验学习下SystemTap。
安装systemtap
sudo apt-get install systemtap
Ubuntu Desktop默认没有安装kernel debug info的包,systemtap无法追踪内核信息。查看内核版本
ningoo@ning:~/stap$ uname -r2.6.35-22-generic
从这里下载对应的kernel debug info包,安装
sudo dpkg -i linux-image-2.6.35-22-generic-dbgsym_2.6.35-22.35_i386.ddeb
至此内核追踪已经可以执行,但module的信息还需要多做些工作
sudo apt-get install elfutilsfor file in `find /usr/lib/debug -name '*.ko' -print`do buildid=`eu-readelf -n $file| grep Build.ID: | awk '{print $3}'` dir=`echo $buildid | cut -c1-2` fn=`echo $buildid | cut -c3-` mkdir -p /usr/lib/debug/.build-id/$dir ln -s $file /usr/lib/debug/.build-id/$dir/$fn ln -s $file /usr/lib/debug/.build-id/$dir/${fn}.debugdone
Hello world
ningoo@ning:~/stap$ sudo stap -ve 'probe begin { log("hello world") exit() }'Pass 1: parsed user script and 72 library script(s) using 18896virt/12868res/1880shr kb, in 130usr/20sys/150real ms.Pass 2: analyzed script: 1 probe(s), 2 function(s), 0 embed(s), 0 global(s) using 19160virt/13132res/1908shr kb, in 10usr/0sys/5real ms.Pass 3: using cached /home/ningoo/.systemtap/cache /f1/stap_f10ab2aeba4f2da2c03646b27b4d3627_757.cPass 4: using cached /home/ningoo/.systemtap/cache /f1/stap_f10ab2aeba4f2da2c03646b27b4d3627_757.koPass 5: starting run.hello worldPass 5: run completed in 0usr/30sys/297real ms.
参考:
http://sourceware.org/systemtap/documentation.html
http://sourceware.org/systemtap/wiki/SystemtapOnUbuntu
- 在Ubuntu上使用SystemTap
- 在Ubuntu上使用SystemTap
- 在Ubuntu上安装使用Systemtap
- systemtap 在Ubuntu上安装
- Ubuntu上systemtap安装
- 如何在ubuntu上基于自定义内核安装systemtap
- systemtap在android、pandaboard上的移植
- 在ubuntu12.04上安装systemtap
- 在Red Hat Enterprise Linux 5.8上安装systemtap
- 在Ubuntu上使用Bochs
- 在ubuntu上使用FTP
- 在Ubuntu上使用amule
- 在Ubuntu 上使用git
- 在ubuntu上使用git
- ubuntu 11.10 安装systemtap
- ubuntu 11.10 安装systemtap
- ubuntu 11.10 安装systemtap
- ubuntu 13.10安装systemtap
- MyEclipse快捷键设置
- JDBC连接数据库
- rundll32.exe使用
- java开发规范手册(必须修改的部分)
- 程序员的发展方向
- 在Ubuntu上使用SystemTap
- android适配各种分辨率的问题
- c#里获取checkboxlist所有选中项【原创】
- C++11 理解 (十三) 之 角括号
- js和java变量互传
- keygenme3
- (step 5.1.1)hdu 1232(畅通工程——并查集)
- 命令提示窗口输出汉字
- HDU 3001 Travelling (三进制状态压缩DP+BFS)