rock’n roll

September 11, 2006

What is my process doing ?

Filed under: book, software — dinhviethoa @ 2:45 am

1. Process profiler

This week-end, I worked on a tool to discover what a process is doing.

1.1. What is it ?

This tool will show the stack trace of the part the process is spending time in. This is mostly like gprofile and friends but in this case, you don’t need to recompile your tool to do measures.
Here some example where it is useful :
- when the CPU is used,
- when the UI of the process is not refreshing,
- when the UI is not responsive.
binutils development package is needed to build it.
download here.

Example of use :

I sampled etpanX for 3 seconds when I clicked on a folder.

See the output here.
Though, a user interface will be needed.

1.2. How it works

Sometimes when people want to know what their process is doing on Linux, they stop it by attaching with gdb and they look at the stack trace. I automated that and improved that by repeating the operation automatically a number of time chosen by the user. Currently, the user choose the delay in seconds and the stack trace is reported every 10 ms.
This works exclusively on Linux/x86. There are a few parts that are linux/x86 dependent. They need to be ported for other systems. This tool was inspired from an exisiting tool on Mac OS X.

2. Reading

Elisabeth Badinter – Fausse Route
ISBN: 273811265X

Darwin – Origin of Species
ISBN: 0517123207

« Newer Posts

Blog at WordPress.com.