Tuesday, 26 July 2011

Startup Optimisation with Bootcharts (Ubuntu kde and Gnome)

The Sok project looks far from completion, I am certain that the project wont' get completed or wouldn't achieve results that I thought it would achieve, before I started the Project. Clearly I didn't have much Idea or thought before starting the project, and my mentor too was clueless at some points, like the part where I had to find the time spent in each of the starting programs and modules. He had suggested using a function like clock(), in each of the classes and then subsequently finding the difference between each script. Something line clock(arg1) - clock(arg2). Clearly it is a Herculean task in magnitude as well as complexity. So I have resorted back to using the good old bootchart. Well its true that it wont give me a very clear time difference, but atleast it would give me a rough idea. So I installed the bootchart application. From :-
                                  http://www.bootchart.org/download.html
Apparently there is a newer version
                                  https://www.ohloh.net/p/bootchart2

Sadly I didn't find any difference in their working. For anyone still wondering what is a Bootchart, a Bootchart is a tool for performance analysis and visualization of the GNU/Linux boot process. Resource utilization and process information are collected during the boot process and are later rendered in a PNG, SVG or EPS encoded chart. Bootchart provides a shell script to be run by the kernel in the init phase. The script will run in background and collect process information, CPU statistics and disk usage statistics from the /proc file system. The performance data are stored in memory and are written to disk once the boot process completes.

Obviously you can't optimise or reduce the time spent by the events unless you know where the time is spent, hence bootchart gives you some idea. On having downloaded the bootchart files from either of the above sources. Browse to the extracted directories and nstall them by :-

---> make
---> sudo make install

Or a sudo Command like :-

aaditya@ubuntu:~$ sudo apt-get install bootchart
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gcj-jre gcj-4.4-jre libgcj10-awt
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  pybootchartgui
The following NEW packages will be installed:
  pybootchartgui
The following packages will be upgraded:
  bootchart
1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 34.2kB of archives.
After this operation, 90.1kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ maverick/universe bootchart i386 0.90.2-7 [12.5kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ maverick/universe pybootchartgui i386 0+r141-0ubuntu2 [21.7kB]

Having downloaded and installed the files, you just need to reboot your system. When you restart your system next time, browse to /var/log/bootchart and you will find a nice png image showing your boot chart lying there.

Here is my boot chart for my Gnome Desktop system

title = Boot chart for ubuntu (Tue Jul 26 17:53:32 IST 2011)
system.uname = Linux 2.6.35-30-generic #54-Ubuntu SMP Tue Jun 7 18:40:23 UTC 2011 i686
system.release = Ubuntu 10.10
system.cpu = model name    : Intel(R) Core(TM) i3 CPU       M 370  @ 2.40GHz
model name    : Intel(R) Core(TM) i3 CPU       M 370  @ 2.40GHz
model name    : Intel(R) Core(TM) i3 CPU       M 370  @ 2.40GHz
model name    : Intel(R) Core(TM) i3 CPU       M 370  @ 2.40GHz (4)
system.kernel.options = BOOT_IMAGE=/boot/vmlinuz-2.6.35-30-generic root=UUID=C010D42210D42168 loop=/ubuntu/disks/root.disk ro i8042.reset i8042.nomux i8042.nopnp i8042.noloop quiet splash

You will have to download/save the above image and zoom it to accurately view the events.

Here is my boot chart for my kde Desktop system 


You will have to download/save the image and zoom it to accurately view the events.

I guess this is the all important bootchart, and a lot of the future progress will depend on the findings from this bootchart. The upcoming time and may be a future post will be derived from my findings from this post.

2 comments:

  1. Dude , Your blog is AWESUM...keep it up :)

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete