Submit Search
Upload
dbug in mysql
•
3 likes
•
857 views
Tim Chou
Follow
www.saw-unix.com
Read less
Read more
Technology
Report
Share
Report
Share
1 of 7
Download now
Download to read offline
Recommended
那些年,我們一起看的例外
那些年,我們一起看的例外
kao kuo-tung
Free Marker中文文档
Free Marker中文文档
yiditushe
Ch7
Ch7
Alisha Smile
Python 入门
Python 入门
kuco945
Moodle 项目帮助手册:程序编写准则
Moodle 项目帮助手册:程序编写准则
YUCHENG HU
LazyRecord: The Fast ORM for PHP
LazyRecord: The Fast ORM for PHP
Lin Yo-An
《Java程序设计》期末考试试题 (六)
《Java程序设计》期末考试试题 (六)
jane2006
Test
Test
datsuen.church
Recommended
那些年,我們一起看的例外
那些年,我們一起看的例外
kao kuo-tung
Free Marker中文文档
Free Marker中文文档
yiditushe
Ch7
Ch7
Alisha Smile
Python 入门
Python 入门
kuco945
Moodle 项目帮助手册:程序编写准则
Moodle 项目帮助手册:程序编写准则
YUCHENG HU
LazyRecord: The Fast ORM for PHP
LazyRecord: The Fast ORM for PHP
Lin Yo-An
《Java程序设计》期末考试试题 (六)
《Java程序设计》期末考试试题 (六)
jane2006
Test
Test
datsuen.church
nodeMCU IOT教學02 - Lua語言
nodeMCU IOT教學02 - Lua語言
吳錫修 (ShyiShiou Wu)
Python串列資料應用
Python串列資料應用
吳錫修 (ShyiShiou Wu)
cfm to php training
cfm to php training
Chonpin HSU
Python入門:5大概念初心者必備 2021/11/18
Python入門:5大概念初心者必備 2021/11/18
Derek Lee
Python入門:5大概念初心者必備
Python入門:5大概念初心者必備
Derek Lee
網頁設計 - 資料庫存取
網頁設計 - 資料庫存取
Vincent Chi
Mongodb
Mongodb
bj
Uc home二次开发参考手册
Uc home二次开发参考手册
charleenchen1990
Python元組,字典,集合
Python元組,字典,集合
吳錫修 (ShyiShiou Wu)
第十一章解答
第十一章解答
jiannrong
那 Angular 那 AJAX 那 RESTful
那 Angular 那 AJAX 那 RESTful
功豪 魏
Mastering Mustache
Mastering Mustache
tinyhill
Node.js开发体验
Node.js开发体验
QLeelulu
Bash shell script 教學
Bash shell script 教學
Ming-Sian Lin
PHP & MySQL 教學
PHP & MySQL 教學
Bo-Yi Wu
PHP Coding Standard and 50+ Programming Skills
PHP Coding Standard and 50+ Programming Skills
Ho Kim
Python 3-條件判斷
Python 3-條件判斷
阿Samn的物理課本
Mysql 高级优化之 理解查询执行
Mysql 高级优化之 理解查询执行
nigel889
Php for fe
Php for fe
jay li
PHP
PHP
Ht Wang
The power of networks power point
The power of networks power point
Nathaniel D. Horowitz
The way to work
The way to work
Nathaniel D. Horowitz
More Related Content
What's hot
nodeMCU IOT教學02 - Lua語言
nodeMCU IOT教學02 - Lua語言
吳錫修 (ShyiShiou Wu)
Python串列資料應用
Python串列資料應用
吳錫修 (ShyiShiou Wu)
cfm to php training
cfm to php training
Chonpin HSU
Python入門:5大概念初心者必備 2021/11/18
Python入門:5大概念初心者必備 2021/11/18
Derek Lee
Python入門:5大概念初心者必備
Python入門:5大概念初心者必備
Derek Lee
網頁設計 - 資料庫存取
網頁設計 - 資料庫存取
Vincent Chi
Mongodb
Mongodb
bj
Uc home二次开发参考手册
Uc home二次开发参考手册
charleenchen1990
Python元組,字典,集合
Python元組,字典,集合
吳錫修 (ShyiShiou Wu)
第十一章解答
第十一章解答
jiannrong
那 Angular 那 AJAX 那 RESTful
那 Angular 那 AJAX 那 RESTful
功豪 魏
Mastering Mustache
Mastering Mustache
tinyhill
Node.js开发体验
Node.js开发体验
QLeelulu
Bash shell script 教學
Bash shell script 教學
Ming-Sian Lin
PHP & MySQL 教學
PHP & MySQL 教學
Bo-Yi Wu
PHP Coding Standard and 50+ Programming Skills
PHP Coding Standard and 50+ Programming Skills
Ho Kim
Python 3-條件判斷
Python 3-條件判斷
阿Samn的物理課本
Mysql 高级优化之 理解查询执行
Mysql 高级优化之 理解查询执行
nigel889
Php for fe
Php for fe
jay li
PHP
PHP
Ht Wang
What's hot
(20)
nodeMCU IOT教學02 - Lua語言
nodeMCU IOT教學02 - Lua語言
Python串列資料應用
Python串列資料應用
cfm to php training
cfm to php training
Python入門:5大概念初心者必備 2021/11/18
Python入門:5大概念初心者必備 2021/11/18
Python入門:5大概念初心者必備
Python入門:5大概念初心者必備
網頁設計 - 資料庫存取
網頁設計 - 資料庫存取
Mongodb
Mongodb
Uc home二次开发参考手册
Uc home二次开发参考手册
Python元組,字典,集合
Python元組,字典,集合
第十一章解答
第十一章解答
那 Angular 那 AJAX 那 RESTful
那 Angular 那 AJAX 那 RESTful
Mastering Mustache
Mastering Mustache
Node.js开发体验
Node.js开发体验
Bash shell script 教學
Bash shell script 教學
PHP & MySQL 教學
PHP & MySQL 教學
PHP Coding Standard and 50+ Programming Skills
PHP Coding Standard and 50+ Programming Skills
Python 3-條件判斷
Python 3-條件判斷
Mysql 高级优化之 理解查询执行
Mysql 高级优化之 理解查询执行
Php for fe
Php for fe
PHP
PHP
Viewers also liked
The power of networks power point
The power of networks power point
Nathaniel D. Horowitz
The way to work
The way to work
Nathaniel D. Horowitz
Alapítsunk iskolát!
Alapítsunk iskolát!
VAdrika9014
สารสนเทศกับการท่องเที่ยว
สารสนเทศกับการท่องเที่ยว
nongmai06027
The way to work
The way to work
Nathaniel D. Horowitz
99 Francs
99 Francs
Nathaniel D. Horowitz
interkultural communication
interkultural communication
Nathaniel D. Horowitz
Quadern de problemes1
Quadern de problemes1
lcervel2
Szabadidős tevékenységek vizsgálata a Berzsenyi Dániel Gimnáziumban
Szabadidős tevékenységek vizsgálata a Berzsenyi Dániel Gimnáziumban
VAdrika9014
The 2007-8 Writers' Strike
The 2007-8 Writers' Strike
Nathaniel D. Horowitz
99 francs
99 francs
Nathaniel D. Horowitz
ดอกไม้ในจีน
ดอกไม้ในจีน
nongmai06027
Les 7 cabretes i el llop
Les 7 cabretes i el llop
lcervel2
Comprensio lectora
Comprensio lectora
lcervel2
Ayahuasca: its preparation and effects
Ayahuasca: its preparation and effects
Nathaniel D. Horowitz
ELT Methodology Differences bet l1 and l2
ELT Methodology Differences bet l1 and l2
Geoffrey Geography
Sun safety – skin safety, sunburn prevention, sun safety, sunscreen advice ip...
Sun safety – skin safety, sunburn prevention, sun safety, sunscreen advice ip...
AppsolutelyiPhone
Viewers also liked
(17)
The power of networks power point
The power of networks power point
The way to work
The way to work
Alapítsunk iskolát!
Alapítsunk iskolát!
สารสนเทศกับการท่องเที่ยว
สารสนเทศกับการท่องเที่ยว
The way to work
The way to work
99 Francs
99 Francs
interkultural communication
interkultural communication
Quadern de problemes1
Quadern de problemes1
Szabadidős tevékenységek vizsgálata a Berzsenyi Dániel Gimnáziumban
Szabadidős tevékenységek vizsgálata a Berzsenyi Dániel Gimnáziumban
The 2007-8 Writers' Strike
The 2007-8 Writers' Strike
99 francs
99 francs
ดอกไม้ในจีน
ดอกไม้ในจีน
Les 7 cabretes i el llop
Les 7 cabretes i el llop
Comprensio lectora
Comprensio lectora
Ayahuasca: its preparation and effects
Ayahuasca: its preparation and effects
ELT Methodology Differences bet l1 and l2
ELT Methodology Differences bet l1 and l2
Sun safety – skin safety, sunburn prevention, sun safety, sunscreen advice ip...
Sun safety – skin safety, sunburn prevention, sun safety, sunscreen advice ip...
Similar to dbug in mysql
由一个简单的程序谈起――之二
由一个简单的程序谈起――之二
yiditushe
Php应用程序常见安全问题解析
Php应用程序常见安全问题解析
mysqlops
Learning python in the motion picture industry by will zhou
Learning python in the motion picture industry by will zhou
Will Zhou
Oraliux+mysql5单机多实例安装文档
Oraliux+mysql5单机多实例安装文档
xuebao_zx
mysql dbug
mysql dbug
Tim Chou
Php
Php
paitoubing
[系列活動] 手把手教你R語言資料分析實務
[系列活動] 手把手教你R語言資料分析實務
台灣資料科學年會
Practical data analysis in R: from data collection to data insight
Practical data analysis in R: from data collection to data insight
Chun-Min Chang
Practical Data Analysis in R
Practical Data Analysis in R
Chun-Ming Chang
Spring 2.x 中文
Spring 2.x 中文
Guo Albert
Django development
Django development
loveyudu
六步教你学会简单Rmi
六步教你学会简单Rmi
yiditushe
Lucene 全文检索实践
Lucene 全文检索实践
yiditushe
希望科技研发部变量命名及编码规范
希望科技研发部变量命名及编码规范
Hongjian Wang
Aisanux安装光盘分析
Aisanux安装光盘分析
Guangyao Cheng
Mongo db技术交流
Mongo db技术交流
liuts
Ch1 系统启动
Ch1 系统启动
guest4d1b8c
MySQL源码分析.01.代码结构与基本流程
MySQL源码分析.01.代码结构与基本流程
Lixun Peng
HITCON CTF 2014 BambooFox 解題心得分享
HITCON CTF 2014 BambooFox 解題心得分享
Chong-Kuan Chen
Django
Django
Tao He
Similar to dbug in mysql
(20)
由一个简单的程序谈起――之二
由一个简单的程序谈起――之二
Php应用程序常见安全问题解析
Php应用程序常见安全问题解析
Learning python in the motion picture industry by will zhou
Learning python in the motion picture industry by will zhou
Oraliux+mysql5单机多实例安装文档
Oraliux+mysql5单机多实例安装文档
mysql dbug
mysql dbug
Php
Php
[系列活動] 手把手教你R語言資料分析實務
[系列活動] 手把手教你R語言資料分析實務
Practical data analysis in R: from data collection to data insight
Practical data analysis in R: from data collection to data insight
Practical Data Analysis in R
Practical Data Analysis in R
Spring 2.x 中文
Spring 2.x 中文
Django development
Django development
六步教你学会简单Rmi
六步教你学会简单Rmi
Lucene 全文检索实践
Lucene 全文检索实践
希望科技研发部变量命名及编码规范
希望科技研发部变量命名及编码规范
Aisanux安装光盘分析
Aisanux安装光盘分析
Mongo db技术交流
Mongo db技术交流
Ch1 系统启动
Ch1 系统启动
MySQL源码分析.01.代码结构与基本流程
MySQL源码分析.01.代码结构与基本流程
HITCON CTF 2014 BambooFox 解題心得分享
HITCON CTF 2014 BambooFox 解題心得分享
Django
Django
dbug in mysql
1.
DBUG a c program
debugging package, by Fred Fish. http://sourceforge.net/projects/dbug mysql 使用 dbug 来调试跟踪源代码
2.
Section 1:dbug 的基本介绍 dbug
example: #include <dbug.h> int main () { int result, i; DBUG_ENTER ("main"); for (i=0,result=0; i != 100; i++) { DBUG_PRINT ("info", ("i : %dn", i); result += i; } DBUG_RETURN (0); }
3.
dbug package提供的一些方法(仅列出最常用的): 1. DBUG_ENTER
进入函数时调用,参数是一个字符串.且必须要有一个 DBUG_RETURN相配对. EX: DBUG_ENTER ("main"); 2. DBUG_RETURN 退出某个函数时调用,参数是返回值. EX: DBUG_RETURN (value); EX:DBUG_VOID_RETURN; (无返回值时) 3. DBUG_PRINT 最常用,输出信息.两个参数,第一个参数是一个keyword,第二个参 数是printf的format string. EX: DBUG_PRINT ("eof", ("end of file found")); EX: DBUG_PRINT ("type", ("type is %x", type)); EX: DBUG_PRINT ("stp", ("%x -> %s", stp, stp -> name));
4.
Section 2:mysql 中使用
dbug mysql 中如何使用 debug 跟踪调试代码. 1. 编译的时候加上—debug 参数: ./configure –with-debug 2. mysql 默认已经在代码中的很多地方都加上了 DBUG_XXX 了,而且 很详细.比如在很多函数的入口加上了 DBUG_ENTER(“函数名”),在 一些地方 DBUG_PRINT()打印输入重要变量的值.当然你也可以自己 在需要的地方添加 DBUG_XX,来观察你所关心的信息.(添加完了记 得重新 make) 3. 启动 mysql 的时候加上参数:mysqld_safe --debug& 4. 启动后,mysql 默认在/tmp/下生成 mysqld.trace 文件,记录了所有的 dbug 跟踪信息.这个文件是会动态更新的.
5.
trace 文件示例: T@1
: >init_tmpdir T@1 : | enter: pathlist: NULL T@1 : | >init_dynamic_array T@1 : | | >my_malloc T@1 : | | | my: size: 8 my_flags: 0 T@1 : | | | exit: ptr: 0x6aed620 T@1 : | | <my_malloc T@1 : | <init_dynamic_array T@1 : | >cleanup_dirname T@1 : | | enter: from: '/tmp' T@1 : | | exit: to: '/tmp' T@1 : | <cleanup_dirname T@1 : | >my_malloc T@1 : | | my: size: 5 my_flags: 16 T@1 : | | exit: ptr: 0x6aed640 T@1 : | <my_malloc T@1 : <init_tmpdir
6.
注: 1. T@n 的意思是表明这是在第
n 个线程中. 2. >init_tmpdir 中的>的意思是进入函数. 3. <init_tmpdir 中的<的意思是退出函数. 4. 树形结构,清晰 5. mysqld_safe& --debug 会产生很多的信息,可以加上命令关注我们 所关心的: mysqld_safe --debug=d,info,error,query,general,where,taobao:O,/tmp/mysqld.trac e& 上面的 infoerror 等是一些 tag,表明我们只需要查看这些 tag 标记 的输出.比如我在某个地方: DBUG_PRINT( “taobao” , (”x is : %d” , x) ); 这个 DBUG 的 tag 是 taobao,那么我们用上面的方法启动 mysqld 后, 就可以在 mysqld.trace 文件中看到这个 DBUG_PRINT 了.
7.
参考: DBUG User Manual Creating
Trace Files : http://dev.mysql.com/doc/refman/5.0/en/making-trace-files.html 周旻钧@taobao http://www.sa-unix.com 2010.9.19
Download now