第一范文网 - 专业文章范例文档资料分享平台

Systemtap 调试内核

来源:用户分享 时间:2025/5/24 19:15:34 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

实验三 (提高2) Systemtap 调试内核

姓名:刘志红 学号:SA11226351 实验os为Ubuntu10.10 参考链接

http://sourceware.org/systemtap/

http://blog.csdn.net/lzuzhp06/article/details/6933525

http://www.ibm.com/developerworks/cn/linux/l-systemtap/#scripting

安装systemtap

sudo apt-get install systemtap

sudo stap -ve 'probe begin { log(\

下载 debug内核版本

先查看本系统的uname –r 内核版本

再下载,还是不行

查看http://sourceware.org/systemtap/wiki/SystemtapOnUbuntu

文章后 http://ddebs.ubuntu.com/pool/main/l/linux/ 找到了debug版内核 并手动下载下来 安装该内核 dpkg –i

或用命令 Wget

http://ddebs.ubuntu.com/pool/main/l/linux/linux-image-2.6.32-33-generic-dbgsym_2.6.32-33.72_i386.ddeb

擦 下了三个小时,下错版本了 重新下 Wget

http://ddebs.ubuntu.com/pool/main/l/linux/linux-image-2.6.32-33-generic-dbgsym_2.6.32-33.70_i386.ddeb

sudo dpkg -i linux-image-2.6.32-33-generic-dbgsym_2.6.32-33.70_i386.ddeb

1学会使用embedded-c.stp,查看进程的对应的应用程序

%{

#include #include %}

function task_execname_by_pid:string (pid:long) %{ struct task_struct *p; struct list_head *_p, *_n;

list_for_each_safe(_p, _n, ¤t->tasks) { p = list_entry(_p, struct task_struct, tasks); if (p->pid == (int)THIS->pid)

snprintf(THIS->__retvalue, MAXSTRINGLEN, \} %}

probe begin {

printf(\exit() }

2 打印所有运行的进程

%{

#include

#include

%}

function process_list ()

%{

struct task_struct *p;

struct list_head *_p,*_n;

for_each_process(p){

_stp_printf(\

}

%}

probe begin

{

process_list();

exit() }

3 监控所有系统调用 (test2.c)

global syscalllist

probe begin {

搜索更多关于: Systemtap 调试内核 的文档
Systemtap 调试内核.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c510ow3k3e31xep036oeg_1.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top