LINUX block I/O --systemtap
http://hushi55.github.io/2015/10/16/Block-Input-Output/
http://myaut.github.io/dtrace-stap-book/kernel/bio.html
http://blog.itpub.net/15480802/viewspace-762765/
http://blog.163.com/digoal@126/blog/static/1638770402013101993142404/
http://www.searchtb.com/2013/02/iowait_why_and_optimization.html
http://blog.yufeng.info/ppt
----------------------------------------------------------------------------------------------------------
systemtap 提供的io tracepoint
ioblock.end
ioblock.request
ioblock_trace.bounce
ioblock_trace.end
ioblock_trace.request
ioscheduler.elv_add_request
ioscheduler.elv_add_request.kp
ioscheduler.elv_add_request.tp
ioscheduler.elv_completed_request
ioscheduler.elv_next_request
ioscheduler.elv_next_request.return
ioscheduler_trace.elv_abort_request
ioscheduler_trace.elv_completed_request
ioscheduler_trace.elv_issue_request
ioscheduler_trace.elv_requeue_request
ioscheduler_trace.plug
ioscheduler_trace.unplug_io
ioscheduler_trace.unplug_timer
---------------------------------------------------------------
[root@localhost ~]# mount -t debugfs none /sys/kernel/debug/
[root@localhost ~]# blktrace /dev/sda
^CDevice: /dev/sda
CPU 0: 0 events, 524 KiB data
CPU 1: 0 events, 830 KiB data
Total: 0 events (dropped 0), 1353 KiB data
----------------------------------------------------------------------------------------------------------------
[root@localhost ~]# stap -l 'ioblock.*'
ioblock.end
ioblock.request
[root@localhost ~]# stap -L 'ioblock.*'
ioblock.end
name:string devname:string ino:long bytes_done:long error:long sector:long flags:long rw:long vcnt:long
idx:long phys_segments:long hw_segments:long size:long $bio:struct bio* $error:int
ioblock.request
name:string devname:string ino:long sector:long flags:long rw:long vcnt:long idx:long phys_segments:long
hw_segments:long size:long bdev:long bdev_contains:long p_start_sect:long $bio:struct bio*
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[root@localhost ~]# stap -l 'ioscheduler.*'
ioscheduler.elv_add_request
ioscheduler.elv_completed_request
ioscheduler.elv_next_request
[root@localhost ~]# stap -L 'ioscheduler.*'
ioscheduler.elv_add_request
__tracepoint_arg_q:long __tracepoint_arg_rq:long name:string q:long elevator_name:string rq:long disk_major:long disk_minor:long rq_flags:long $q:struct request_queue* $rq:struct request*
ioscheduler.elv_completed_request
name:string elevator_name:string disk_major:long disk_minor:long rq:long rq_flags:long $q:struct request_queue* $rq:struct request*
ioscheduler.elv_next_request
name:string elevator_name:string $q:struct request_queue* $__func__:char[] const
-------------------------------------------------------------------------------------------------------------
[root@localhost linux-2.6.32]# stap -l 'kernel.trace("block_*")'
kernel.trace("block:block_bio_backmerge")
kernel.trace("block:block_bio_bounce")
kernel.trace("block:block_bio_complete")
kernel.trace("block:block_bio_frontmerge")
kernel.trace("block:block_bio_queue")
kernel.trace("block:block_getrq")
kernel.trace("block:block_plug")
kernel.trace("block:block_remap")
kernel.trace("block:block_rq_abort")
kernel.trace("block:block_rq_complete")
kernel.trace("block:block_rq_insert")
kernel.trace("block:block_rq_issue")
kernel.trace("block:block_rq_remap")
kernel.trace("block:block_rq_requeue")
kernel.trace("block:block_sleeprq")
kernel.trace("block:block_split")
kernel.trace("block:block_unplug_io")
kernel.trace("block:block_unplug_timer")
----------------------------------------------------------------------------------
[root@localhost linux-2.6.32]# stap -L 'kernel.trace("block_*")'
kernel.trace("block:block_bio_backmerge") $q:struct request_queue* $bio:struct bio*
kernel.trace("block:block_bio_bounce") $q:struct request_queue* $bio:struct bio*
kernel.trace("block:block_bio_complete") $q:struct request_queue* $bio:struct bio*
kernel.trace("block:block_bio_frontmerge") $q:struct request_queue* $bio:struct bio*
kernel.trace("block:block_bio_queue") $q:struct request_queue* $bio:struct bio*
kernel.trace("block:block_getrq") $q:struct request_queue* $bio:struct bio* $rw:int
kernel.trace("block:block_plug") $q:struct request_queue*
kernel.trace("block:block_remap") $q:struct request_queue* $bio:struct bio* $dev:dev_t $from:sector_t
kernel.trace("block:block_rq_abort") $q:struct request_queue* $rq:struct request*
kernel.trace("block:block_rq_complete") $q:struct request_queue* $rq:struct request*
kernel.trace("block:block_rq_insert") $q:struct request_queue* $rq:struct request*
kernel.trace("block:block_rq_issue") $q:struct request_queue* $rq:struct request*
kernel.trace("block:block_rq_remap") $q:struct request_queue* $rq:struct request* $dev:dev_t $from:sector_t
kernel.trace("block:block_rq_requeue") $q:struct request_queue* $rq:struct request*
kernel.trace("block:block_sleeprq") $q:struct request_queue* $bio:struct bio* $rw:int
kernel.trace("block:block_split") $q:struct request_queue* $bio:struct bio* $new_sector:unsigned int
kernel.trace("block:block_unplug_io") $q:struct request_queue*
kernel.trace("block:block_unplug_timer") $q:struct request_queue*
--------------------------------------------------------------------------------------------
[root@localhost linux-2.6.32]# stap -l 'kernel.function("congestion_wait")'
kernel.function("congestion_wait@mm/backing-dev.c:752")
--------------------------------------------------------------------------------------------------
[root@localhost /]# cd /usr/share/systemtap/tapset
root@localhost tapset]# grep -e 'ioblock.request' -R * // 在当前目录下文件中搜索 ioblock.request 字符串
ioblock.stp: * probe ioblock.request - Fires whenever making a generic block I/O request.
ioblock.stp:probe ioblock.request = kernel.function ("generic_make_request")
ioblock.stp: name = "ioblock.request"
[root@localhost tapset]# stap -l 'kernel.function ("generic_make_request")'
kernel.function("generic_make_request@block/blk-core.c:1502")
[root@localhost tapset]# grep -e 'ioblock.end' -R *
ioblock.stp: * probe ioblock.end - Fires whenever a block I/O transfer is complete.
ioblock.stp:probe ioblock.end = kernel.function("bio_endio")
ioblock.stp: name = "ioblock.end"
[root@localhost tapset]# stap -l 'kernel.function("bio_endio")'
kernel.function("bio_endio@fs/bio.c:1411")
ioblock.request:是内核函数 generic_make_request 的别名
ioblock.end:是内核函数 bio_endio 的别名
我这是使用的源码安装的 systemtap,
使用 yum 安装的 systemtap 的两个重要位置在
/usr/share/doc/systemtap-client-2.6/examples:systemtap 自带示例脚本的目录
/usr/share/systemtap/:systemtap 运行时的一些脚本,包括一些别名的定义
-----------------------------------------------------------------------------------------------------------------------------------
用tgpt
(gdb) trace generic_make_request
(gdb) list 1502 //直接显示第 1502行函数generic_make_request 源代码
也可进行实时调试
LINUX block I/O --systemtap的更多相关文章
- linux系统分析工具续-SystemTap和火焰图(Flame Graph)
本文为网上各位大神文章的综合简单实践篇,参考文章较多,有些总结性东西,自认暂无法详细写出,建议读文中列出的参考文档,相信会受益颇多.下面开始吧(本文出自 “cclo的博客” 博客,请务必保留此出处ht ...
- Linux: Block Port With IPtables
由Internet和其他网络协议识别端口号,使计算机能够与其他人进行交互.每个Linux服务器都有一个端口号(参见/ etc / services文件) Block Incoming Port The ...
- Linux block(1k) block(4k) 换算 gb
输入 df 显示1k blocks 大小 再输入 df -h 显示 gb换算大小 结论 block(1k) 计算公式为: block(1k) /1024/1000 = xx gb ...
- 【SystemTap】 Linux下安装使用SystemTap源码安装SystemTap
转自 http://blog.csdn.net/zklth/article/details/6248558 文章 http://blog.csdn.net/zklth/archive/2010/09/ ...
- linux 内核分析+使用SystemTap调试新增内核模块
http://blog.chinaunix.net/uid/14528823/list/1.html?cid=189394
- Linux Block模块之deadline调度算法代码解析
1 总体说明 Deadline调度器对一个请求的多方面特性进行权衡来进行调度,以期望既能满足块设备扇区的顺序访问又能兼顾到一个请求不会在队列中等待太久导致饿死.Deadline调度器为了兼顾这两个方面 ...
- Linux Block模块之IO合并代码解析
1 IO路径 从内核角度看,进程产生的IO路径主要有三条: 缓存IO:系统绝大部分IO走的这种形式,充分利用文件系统层的page cache所带来的优势.应用程序产生的IO经系统调用落入page ca ...
- 转 -Linux 自检和 SystemTap (强大的内核调试工具)---包含下载地址
下载: http://www.oschina.net/p/systemtap/ https://sourceware.org/systemtap/ftp/releases/ Linux 自检和 S ...
- Linux基础命令(四)
作业一:1) 开启Linux系统前添加一块大小为15G的SCSI硬盘 [root@bogon ~]# fdisk -l Disk /dev/sda: 21.5 GB, 21474836480 byte ...
随机推荐
- Luogu P1750 【出栈序列】
一眼(万年)贪心minn设小调不出来祭 首先要保证更靠前的输出更小那么容易想到,对于之后可能入栈的元素(即栈的剩余空间仍能装下的所有元素),我们可以取其中的最小值minn,和栈顶元素$top$比较,如 ...
- 【[国家集训队]小Z的袜子】
对于L,R的询问.设其中颜色为x,y,z的袜子的个数为a,b,c...那么答案即为(a*(a-1)/2+b*(b-1)/2+c*(c-1)/2....)/((R-L+1)*(R-L)/2)化简得:(a ...
- SQL2008关于权限的解释
在SQL2008中我自己创建的一个登录名,可是那个登录名只可以用来登录,对数据库的操作什么都不能,连读取数据库都不可以.因为权限不够,只要把登录名的属性打开点击“服务器角色”,把public和sysa ...
- MySQL学习笔记:concat、concat_ws、group_concat —— 字符串连接
在MySQL中,实现字符串拼接主要有以下3种函数: concat(x,y,...) concat_ws(分隔符,x,y,...) group_concat(distinct xxx order by ...
- 关于文件格式Fuzzing测试与漏洞挖掘的学习
最近对于文件的漏洞挖掘比较感兴趣,所以在找资料来看.顺带记录笔记,把这些笔记贴在博客中分享一下.最近打算把精力放在mp3格式的漏洞发掘上,一来这是常见的文件格式格式也比较清晰.二来这也是学长推荐的入手 ...
- RabbitMQ系列之RabbitMQ单机安装
安装epel源 rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm #ht ...
- Dubbo中多协议
Dubbo 允许配置多协议,在不同服务上支持不同协议或者同一服务上同时支持多种协议 1.不同服务不同协议配置 不同服务在性能上适用不同协议进行传输,比如大数据用短连接协议,小数据大并发用长连接协议 & ...
- Spring Boot 教程demo
https://github.com/ityouknow/spring-boot-examples
- 2018年全国多校算法寒假训练营练习比赛(第二场)F - 德玛西亚万岁
链接:https://www.nowcoder.com/acm/contest/74/F来源:牛客网 题目描述 德玛西亚是一个实力雄厚.奉公守法的国家,有着功勋卓著的光荣军史. 这里非常重视正义.荣耀 ...
- vue 组件使用中的细节点
1.is属性 有些 HTML 元素,诸如 <ul>.<ol>.<table> 和 <select>,对于哪些元素可以出现在其内部是有严格限制的.而有些元 ...