Home
Installing SystemTap on Ubuntu
This article is from http://posulliv.github.com/2010/02/26/installing-stap.html
I’m presenting at the MySQL user’s conference this year and one of my talks is on using SystemTap and DTrace with MySQL and Drizzle. I’m also doing a tutorial with Jay Pipes on developing replication plugins for Drizzle and that should be a lot of fun. I wanted to write some posts before the conference that I can reference within my talk which detail how to install SystemTap and configure Drizzle and MySQL for use with SystemTap. Thus, this post is on how to install SystemTap on Ubuntu while my next post will go in to details about how to configure MySQL and Drizzle for use with SystemTap. Before starting, its worth noting that this post is specific to Ubuntu 9.10. The procedure to follow may be different on other versions so its worth keeping that in my mind. The first thing we do is install systemtap and some associated packages which will be needed by Drizzle and MySQL:
Now, being used to Ubuntu, you would think you are good to go now. Unfortunately, attempting to run SystemTap will probably give you the following error:
The above error occurs because SystemTap needs to have a debug version of the kernel available. Unfortunately, installing the debug information for a kernel on ubuntu is not a trivial operation to perform. In fact, there is a bug on Launchpad about this issue. Thus, we will build a kernel debug package from source ourselves. This can be done as follows:
This builds a debug image of the kernel and so will take quite a while. Once we have the above completed, we can try running our hello world example with SystemTap again. In order to get some output, you should open or create some file on the system in another terminal window. In this example, I backgrounded the stap process and created a file:
Installing SystemTap on CentOS is significantly easier since it is primarily developed by Red Hat. A good article on how to install it on CentOS is available here. In my next post on the topic, I’ll explain how to configure MySQL and Drizzle for SystemTap and give some simple examples of using SystemTap with them.
28 Feb 2012
Aspersa --- a colletion of opensource system utilities, used for analyzing mysql and system performance.
28 Feb 2012
Spying on Apache and PHP with Strace
lsof -p pid // get open files of process#pid pidof command_name // get pid of command cut -c12-19 // only get 12-19 chars sort -rn // sort all text strace -p pid // to trace a process lsof filename // to list all processes opening this file or directory.
27 Feb 2012
Git hooks
Git hooks help you to run tasks after git commands, pretty useful when you want to apply some convention on your git management.
.git/hooks
- applypatch-msg.sample
- commit-msg.sample
- post-commit.sample
- post-receive.sample
- post-update.sample
- pre-applypatch.sample
- pre-commit.sample
- pre-rebase.sample
- prepare-commit-msg.sample
- update.sample
Interesting hook code
https://github.com/icefox/git-hooks
Reference
http://book.git-scm.com/5_git_hooks.html
Chinese version. http://gitbook.liuhui998.com/5_8.html
27 Feb 2012