In his comment to my announcement of the previous post, Shane Bester kindly suggested to consider pretty printing the information about user variables from gdb. I tried to do this tonight, after a long working day, while working with the same Percona server 5.7.x on CentOS 6.9, and found several interesting details to share even before getting to the pretty printing part (that I'd surely try to avoid doing with Python anyway, as I am lazy and not in a mood to use that programming language for a decade already). So, I decided to share them in a separate …[Read more]
8 Older Entries »
Last time I had to use gdb to check what's going on in
MySQL server and found something useful with it to share in the
blog post it was April 2017, and I miss this
kind of experience already. So, today I decided to try it again
in a hope to get some insights in cases when other tools may not
apply or may not be as helpful as one could expect. Here is the
long enough story, based on recent customer issue I worked on
* * * Had you seen anything like this output of SHOW PROCESSLIST statement:
Id User Host db Command Time State[Read more]
28 someuser01 xx.xx.xx.xx:39644 somedb001 Sleep 247
29 someuser01 xx.xx.xx.yy:44100 somedb001 Query 276
Waiting for table level lock DELETE FROM t1 WHERE (some_id = 'NNNNN') AND ... 0.000 …
Welcome to MySQL QA Episode 3: “Debugging: GDB, Backtraces, Frames and Library Dependencies”
In this episode you’ll learn how to use debugging tool GDB. The following debugging topics are covered:
1. GDB Introduction
2. Backtrace, Stack trace
4. Commands & Logging
6. Library dependencies
8. Handy references
– GDB Cheat sheet (page #2): https://goo.gl/rrmB9i
– From Crash to testcase: https://goo.gl/3aSvVW
Also expands on live debugging & more. In HD quality (set your player to 720p!)
The post MySQL QA Episode 3: How to use the debugging tool GDB appeared …[Read more]
Section 6: "Profile a real case" 6.1 INTRODUCTION
Profiling & Debugging is an argument that would require an entire book, the aim of this(and the others) posts of this series is to give you the basic knowledge on how to work with these tools and techniques withing Eclipse. For instance if you want to learn to profile with OProfile you should study on the abundant and separate resources, you may start from: http://OProfile.sourceforge.net
6.2 ABOUT NAMING THE PROJECT
Section 5: "Prepare Eclipse for profiling" 5.1 INTRODUCTION
In this part we will prepare Eclipse to profile our recently
compiled(see Part 3) MariaDB(or MySQL).
Profiling means basically measuring where the time is spent by the application.
You may be interested in knowing how much time is spent in a specific function execution,
or you may want to know statistics about the dustribution of function calls, that is operating a data aggregation.
To run MariaDB from Eclipse we will actually create and install the tar.gz package resulting from compilation(See Part 2) in a separate directory, this will allow us to have MariaDB cleanly installed on a separate location and so it will be also easily possible to run it independently from Eclipse.
In these Blog posts series we assume:
yoda as developer user
Section 2: "COMPILE MARIADB IN ECLIPSE"
2.1 Download and prepare sources folder/>
We will need a directory to use as our playground, if you create
yoda in Section 1:
$ su - yoda
$ mkdir -p ~/playground
Download latest MariaDB 10 sources tar.gz and copy the archive into the above directory, you can latest sources from:
This guide will help you in compiling and debugging MariaDB (MySQL, Percona) within the Eclipse IDE on Linux and using cmake for source project preparation. It will be split in parts to keep each post lightweight and with a finite objective. At the end of reading this series of blog posts you should be able to:
- Prepare for compilation any MariaDB (MySQL, Percona) source release based on cmake framework.
rdebug will be released as part of common_schema, free and open sourced.
In this sneak preview I present:
- Compiling multiple routines with debug info
- Starting/stopping a debug session
- Step-over, step-in, step-out
- Showing stack trace
- Showing the next-statement to execute
- Viewing and manipulating local routine variables
- Misc. meta routines
The quick technical overview
rdebug is a server-side mechanism, itself …[Read more]
This is a sneak peek video introduction/preview of an in-development free and open source server side debugger & debugging API for MySQL stored routines.
MySQL does not provide server side debugging capabilities for stored routines. Some tools exist, including MySQL's own, that assist in stored routine debugging. These are all GUI based and, to the best of my knowledge, MS Windows based. There is one solution in alpha stage that is developed for Java/eclipse; I did not look at the code. See discussion here and here.
An ideal solution would be to have debugging API in the server itself - independently of your client, programming language or operating system. To the best of my knowledge, nothing like that is being developed. …[Read more]
8 Older Entries »