mysql ext4 hack抓取IO 函式
前景:分析底層mysql sync的IO資料大小,用於條帶化分析和最佳化
安裝kernel debug info
yum install kernel-debuginfo kernel-debuginfo-common
- probe module("ext4").function("ext4_sync_file")
- {
- if( execname()=="mysqld") {
- printf("%s , %s, %d %u \n",pp(),tz_ctime(gettimeofday_s()),cpu(),gettimeofday_ns())
- printf("%s , %ld, %ld, %d \n",kernel_string($file->f_path->dentry->d_name->name),$start,$end,$datasync)
- }
- }
- probe kernel.function("filemap_write_and_wait_range")
- {
- if( execname()=="mysqld")
- printf(" %ld, %ld, %ld \n",$lstart, $lend, ($lend - $lstart))
- print_backtrace()
- }
sudo stap -v ext4_sync.stp
可以看到logfile都是按16k寫出:
module("ext4").function("ext4_sync_file@fs/ext4/fsync.c:88") , Thu Mar 16 21:52:18 2017 CST, 13 1489672338942480490 ib_logfile1 , 0, 9223372036854775807, 0 0, 9223372036854775807, 9223372036854775807 0xffffffff811677c0 : filemap_write_and_wait_range+0x0/0x70 [kernel] 0xffffffffa032b7aa : ext4_sync_file+0xba/0x320 [ext4] 0xffffffff8120dee2 : vfs_fsync_range+0x42/0xb0 [kernel] 0xffffffff8120dfc0 : do_fsync+0x50/0x90 [kernel] 0xffffffff8120e2e0 : SyS_fsync+0x10/0x20 [kernel] 0xffffffff81641fc9 : system_call_fastpath+0x16/0x1b [kernel] 35439378432, 35439394815, 16383 0xffffffff811677c0 : filemap_write_and_wait_range+0x0/0x70 [kernel] 0xffffffff81168015 : generic_file_direct_write+0x95/0x190 [kernel] 0xffffffff8116842c : __generic_file_aio_write+0x31c/0x3e0 [kernel] 0xffffffffa032ad5c : ext4_file_write+0x2ac/0x460 [ext4] 0xffffffff811dbaed : do_sync_write+0x8d/0xd0 [kernel] 0xffffffff811dc30d : vfs_write+0xbd/0x1e0 [kernel] 0xffffffff811dcf62 : sys_pwrite64+0x92/0xc0 [kernel] 0xffffffff81641fc9 : system_call_fastpath+0x16/0x1b [kernel] 5346672640, 5346689023, 16383 0xffffffff811677c0 : filemap_write_and_wait_range+0x0/0x70 [kernel] 0xffffffff81168015 : generic_file_direct_write+0x95/0x190 [kernel] 0xffffffff8116842c : __generic_file_aio_write+0x31c/0x3e0 [kernel] 0xffffffffa032ad5c : ext4_file_write+0x2ac/0x460 [ext4] 0xffffffff811dbaed : do_sync_write+0x8d/0xd0 [kernel] 0xffffffff811dc30d : vfs_write+0xbd/0x1e0 [kernel] 0xffffffff811dcf62 : sys_pwrite64+0x92/0xc0 [kernel] 0xffffffff81641fc9 : system_call_fastpath+0x16/0x1b [kernel] 35553755136, 35553771519, 16383 0xffffffff811677c0 : filemap_write_and_wait_range+0x0/0x70 [kernel] 0xffffffff81168015 : generic_file_direct_write+0x95/0x190 [kernel] 0xffffffff8116842c : __generic_file_aio_write+0x31c/0x3e0 [kernel] 0xffffffffa032ad5c : ext4_file_write+0x2ac/0x460 [ext4] 0xffffffff811dbaed : do_sync_write+0x8d/0xd0 [kernel] 0xffffffff811dc30d : vfs_write+0xbd/0x1e0 [kernel] 0xffffffff811dcf62 : sys_pwrite64+0x92/0xc0 [kernel] 0xffffffff81641fc9 : system_call_fastpath+0x16/0x1b [kernel] 46601191424, 46601207807, 16383 0xffffffff811677c0 : filemap_write_and_wait_range+0x0/0x70 [kernel] 0xffffffff81168015 : generic_file_direct_write+0x95/0x190 [kernel] 0xffffffff8116842c : __generic_file_aio_write+0x31c/0x3e0 [kernel] 0xffffffffa032ad5c : ext4_file_write+0x2ac/0x460 [ext4] 0xffffffff811dbaed : do_sync_write+0x8d/0xd0 [kernel] 0xffffffff811dc30d : vfs_write+0xbd/0x1e0 [kernel] 0xffffffff811dcf62 : sys_pwrite64+0x92/0xc0 [kernel] 0xffffffff81641fc9 : system_call_fastpath+0x16/0x1b [kernel] 60283502592, 60283518975, 16383 0xffffffff811677c0 : filemap_write_and_wait_range+0x0/0x70 [kernel] 0xffffffff81168015 : generic_file_direct_write+0x95/0x190 [kernel] 0xffffffff8116842c : __generic_file_aio_write+0x31c/0x3e0 [kernel] 0xffffffffa032ad5c : ext4_file_write+0x2ac/0x460 [ext4] 0xffffffff811dbaed : do_sync_write+0x8d/0xd0 [kernel] 0xffffffff811dc30d : vfs_write+0xbd/0x1e0 [kernel] 0xffffffff811dcf62 : sys_pwrite64+0x92/0xc0 [kernel] 0xffffffff81641fc9 : system_call_fastpath+0x16/0x1b [kernel] 63991283712, 63991300095, 16383 0xffffffff811677c0 : filemap_write_and_wait_range+0x0/0x70 [kernel] 0xffffffff81168015 : generic_file_direct_write+0x95/0x190 [kernel] 0xffffffff8116842c : __generic_file_aio_write+0x31c/0x3e0 [kernel] 0xffffffffa032ad5c : ext4_file_write+0x2ac/0x460 [ext4] 0xffffffff811dbaed : do_sync_write+0x8d/0xd0 [kernel] 0xffffffff811dc30d : vfs_write+0xbd/0x1e0 [kernel] 0xffffffff811dcf62 : sys_pwrite64+0x92/0xc0 [kernel] 0xffffffff81641fc9 : system_call_fastpath+0x16/0x1b [kernel] 89684754432, 89684770815, 16383 0xffffffff811677c0 : filemap_write_and_wait_range+0x0/0x70 [kernel] 0xffffffff81168015 : generic_file_direct_write+0x95/0x190 [kernel] 0xffffffff8116842c : __generic_file_aio_write+0x31c/0x3e0 [kernel] 0xffffffffa032ad5c : ext4_file_write+0x2ac/0x460 [ext4] 0xffffffff811dbaed : do_sync_write+0x8d/0xd0 [kernel] 0xffffffff811dc30d : vfs_write+0xbd/0x1e0 [kernel] 0xffffffff811dcf62 : sys_pwrite64+0x92/0xc0 [kernel] 0xffffffff81641fc9 : system_call_fastpath+0x16/0x1b [kernel] 19488227328, 19488243711, 16383 0xffffffff811677c0 : filemap_write_and_wait_range+0x0/0x70 [kernel] 0xffffffff81168015 : generic_file_direct_write+0x95/0x190 [kernel] 0xffffffff8116842c : __generic_file_aio_write+0x31c/0x3e0 [kernel] 0xffffffffa032ad5c : ext4_file_write+0x2ac/0x460 [ext4] 0xffffffff811dbaed : do_sync_write+0x8d/0xd0 [kernel] 0xffffffff811dc30d : vfs_write+0xbd/0x1e0 [kernel] 0xffffffff811dcf62 : sys_pwrite64+0x92/0xc0 [kernel] 0xffffffff81641fc9 : system_call_fastpath+0x16/0x1b [kernel] 75220402176, 75220418559, 16383 0xffffffff811677c0 : filemap_write_and_wait_range+0x0/0x70 [kernel] 0xffffffff81168015 : generic_file_direct_write+0x95/0x190 [kernel] 0xffffffff8116842c : __generic_file_aio_write+0x31c/0x3e0 [kernel] 0xffffffffa032ad5c : ext4_file_write+0x2ac/0x460 [ext4] 0xffffffff811dbaed : do_sync_write+0x8d/0xd0 [kernel] 0xffffffff811dc30d : vfs_write+0xbd/0x1e0 [kernel] 0xffffffff811dcf62 : sys_pwrite64+0x92/0xc0 [kernel] 0xffffffff81641fc9 : system_call_fastpath+0x16/0x1b [kernel] |
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30088583/viewspace-2136681/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- jbd2 IO 100%處理 (mysql ext4)MySql
- 標準IO常用函式介面函式
- MySQL 函式MySql函式
- MySQL函式MySql函式
- MySQL(四)日期函式 NULL函式 字串函式MySql函式Null字串
- Mysql 常用函式(15)- upper 函式MySql函式
- 【Mysql 學習】日期函式函式MySql函式
- MySQL 常用函式MySql函式
- MySQL 常用函式。MySql函式
- MySQL函式(一)MySql函式
- MySQL常用函式MySql函式
- mysql拼接函式MySql函式
- mysql函式大全MySql函式
- 14 mysql 函式MySql函式
- MySQL函式大全(字串函式,數學函式,日期函式,系統級函式,聚合函式)MySql函式字串
- MySQL函式學習(一)-----字串函式MySql函式字串
- MySQL函式-條件判斷函式MySql函式
- Mysql 常用函式(1)- 常用函式彙總MySql函式
- mysql FIND_IN_SET函式、INSTR函式MySql函式
- python IO模組【二】:open函式詳解Python函式
- MySQL 內建函式MySql函式
- Mysql視窗函式MySql函式
- Mysql內建函式MySql函式
- Mysql 的trim() 函式MySql函式
- 7mysql函式MySql函式
- MySQL時間函式MySql函式
- MYSQL的字串函式MySql字串函式
- MySQL 聚合函式大全MySql函式
- MySQL 控制流函式MySql函式
- MySQL 字串函式大全MySql字串函式
- 《MySQL 入門教程》第 16 篇 MySQL 常用函式之日期函式MySql函式
- Mysql 常用函式(20)- ceiling 函式MySql函式
- mysql 自定義分析函式 least 及 日期函式MySql函式AST
- MySQL:MySQL層比較函式呼叫MySql函式
- 轉MySQL--mysql常用函式打全MySql函式
- MySQL1:MySQL函式彙總MySql函式
- 《MySQL 入門教程》第 14 篇 MySQL 常用函式之數學函式MySql函式
- 探索MySQL高階語句(數學函式、聚合函式、字串函式、日期時間函式)MySql函式字串