BlogJamun – Thinks Aloud

thinking feverishly for a tagline..

Sneak Preview – My Talk @ OSDevCon

The following are things that I am currently working on for the Opensolaris Developer Conference this year, to be held during Oct 28-30 at Dresden. I will update the documentation part of it later when I get time to breathe :)

krish@trantor:~# dtrace -n ‘glib_prov785:::gslice-alloc { @[execname] = quantize(arg0); }’
dtrace: description ‘glib_prov785:::gslice-alloc ‘ matched 1 probe
^C

nautilus
value  ————- Distribution ————- count
2 |                                         0
4 |                                         10
8 |@@@@@@@@@@@@@@@@@@@@@@@                  69999
16 |@@@@@@@@@@@@                             37287
32 |@@@@                                     11007
64 |@                                        2793
128 |                                         540
256 |                                         666
512 |                                         0
1024 |                                         12
2048 |                                         0

krish@trantor:~# pgrep gnome-panel
784
krish@trantor:~# dtrace -n ‘glib_prov784:::gslice-alloc { @[execname] = quantize(arg0); }’
dtrace: description ‘glib_prov784:::gslice-alloc ‘ matched 1 probe
^C

gnome-panel
value  ————- Distribution ————- count
4 |                                         0
8 |@@@@@@@@@@@@@@@@@@@                      1743
16 |@@@@@@@@@@@@                             1091
32 |@@@@@@                                   603
64 |@@@                                      280
128 |                                         21
256 |                                         0

krish@trantor:~# dtrace -l | grep glib
65027 glib_prov785 libglib-2.0.so.0.2105.0                            g_free g-free
65028 glib_prov785 libglib-2.0.so.0.2105.0                          g_malloc g-malloc
65029 glib_prov785 libglib-2.0.so.0.2105.0                     g_slice_alloc gslice-alloc
65030 glib_prov785 libglib-2.0.so.0.2105.0                     g_slice_free1 gslice-free
65109 glib_prov784 libglib-2.0.so.0.2105.0                            g_free g-free
65110 glib_prov784 libglib-2.0.so.0.2105.0                          g_malloc g-malloc
65111 glib_prov784 libglib-2.0.so.0.2105.0                     g_slice_alloc gslice-alloc
65112 glib_prov784 libglib-2.0.so.0.2105.0                     g_slice_free1 gslice-free

krish@trantor:~# dtrace -n ‘gio_prov785::: {  }’
dtrace: description ‘gio_prov785::: ‘ matched 1 probe
CPU     ID                    FUNCTION:NAME
0  65026 g_file_get_uri_scheme:gio-get-uri
0  65026 g_file_get_uri_scheme:gio-get-uri
0  65026 g_file_get_uri_scheme:gio-get-uri
1  65026 g_file_get_uri_scheme:gio-get-uri
1  65026 g_file_get_uri_scheme:gio-get-uri
^C
0  65026 g_file_get_uri_scheme:gio-get-uri
0  65026 g_file_get_uri_scheme:gio-get-uri

September 16, 2009 Posted by blogjamun | dtrace, open source | , , , | No Comments Yet

Bowled By BSNL.

I could not take it anymore. This is the limit. I had not particularly planned a speech, but I was sure about the decibel levels I was going to target. I mentally did a pulling-the-cuffs-of-a-full-arm-shirt thing to get a feel for the situation. All set to attack, I cleared my throat to seek attention of the BSNL employee. I was pretty impressed with my beginning. Lke Sehwag, like Hayden and the guy who said, “Well begun is half done”, I too believed in the adage. The lady, after getting the gist of my problem, started to look busy. Not sure if she was trying to solve my problem. Suddenly, like in a discontinuous cartoon strip, a very responsible, tax paying citizen of my beloved land appeared. I was appalled, and quite understandably so. He was almost like a Twitterfox popup when you are chatting with a girl who is remotely interested in your conversation. I think this is what is called the sore thumb in the medical jargon. He broke the queue and made me feel invisible and went onto question the lady behind the glass. I was now puzzled by the turn of events and managed to make a croak when I was given a chance to tell why I was there. Quickly I recovered, just like all my people have known me would have guessed. Went on to explain the situation, not in the elegant and concise way the people around me then, would have preferred. Now, the lady looked like a Russian GM in chess, very thoughtfully collecting in her head, all what I had verbosely put across, and replied almost instantly saying “The Server was down all these days, your issue will be sorted out soon.”. I don’t think I was quite ready for any reply at the point of time. I was always in a opinion that, BSNL chaps are going to apologise for the delay. But wait, what has the server got to do with installation of my broadband connection? I was stumped by the reply and yet to recover…

May 16, 2009 Posted by blogjamun | Uncategorized | , | 1 Comment

Jhbuild Issue in Intrepid Ibex

Update: The error in jhbuild discussed below is a consequence of me trying to merge the jhbuild checkout folder and the gnome components’ checkout folder. It may not apply for those building with default directory structures as prescribed in the jhbuild gnome live wiki.

I recently downloaded the jhbuild sources from the git repository. I was able to compile and install it without many hiccups, thanks to the elaborate distro-specific Jhbuild Issues wiki in gnome.org.
To my shock, ‘jhbuild’ command returned the following error,

Traceback (most recent call last):
File “/home/pk/bin/jhbuild”, line 5, in
import jhbuild.main
ImportError: No module named jhbuild.main

I am not sure if this is consistently reproducible by others. But the solution here is pretty straight forward. Open the ~/bin/jhbuild file. Don’t pay heed to your graphical editors conservative warnings. It is just a python script. Check if the second argument of the sys.path.insert points to the directory which contains the jhbuild sources. Change it suitably and the problem is fixed. In my case the second argument was pointing to “~/svn/gnome2/jhbuild”. I had to modify it to “~/checkout/gnome2″.
Happy building ;)

May 2, 2009 Posted by blogjamun | Uncategorized | , , , | 3 Comments

Dtrace for timepass

I was trying to copy large amount of files from removable media onto my hard disk. It was taking forever to finish copying. I was curious whether both the processor cores were used equally. I ran the following dtrace one-liner to verify,

pk@opensolaris:~/progs$ pfexec dtrace -n ’syscall::write:entry /execname == “cp”/ {trace(fds[arg0].fi_pathname); @writes[execname, cpu] = count()}’

<snip>

^C

cp                                                        1             3324
cp                                                        0             3385

</snip>

I must also warn those who are itching to interpret the above result, I ran dtrace after a considerable elapse of time after starting the copy command. I am planning to come up with more such dtrace one-liners. They are really addictive ;)

March 8, 2009 Posted by blogjamun | dtrace | , , | 1 Comment

I am free to do anything, but….

I have been hitting contradictions to my subconscious belief that I am free to do anything I want. I have managed to convince myself with this belief, right from days at college. Thats were all the philosophical enquiries  about life and self begin. I convinced myself with the ‘I am free’ belief by doing stuff which people around me dint do, because they were asked not to. This gave me a sort of illusion I should say, that I am unrestrained in my actions. All this are at the surface. To add to this, there have been some day-to-day encounters that have found themselves highlighted in my mind. These highlighted moments bring new perceptions to what I used to believe freedom was. To quote some, One evening, when I was returning from my office, I was caught amidst a religious procession. I managed to evade it, but my luck disappears there. I find that the religious procession got the better of me. They stole power from our area to light up the Almighty! At this point I decided to go to a nearby mall to hang around, satiate my visual desires and return once I got tired. I had forgotten my plan and went to a bookstore in the mall. Very unlike me. Moment of truth, if I ever filmed my life. I went to the philosophy section. I must say that was to be expected. It was almost like a depiction of my inner mind. I think about philosophy, whenever I am lost, without a clue of what I should do next. At that very moment, when I was aimless, if you can say that, went to the philosophy section of all the places. Without any clue on famous titles or authors of works of philosophy, I picked a book on Freedom by Osho. After reading the digest at the back of the book, I could not help letting out a low chuckle in agreement to the author’s ideas. From the digest I infer that Osho believes that Freedom is three types. One is Freedom from, other being Freedom for and the third being Ultimate Freedom. Freedom from is to free yourself from all conditionings we have been through. Freedom for is freedom to express yourself as is. And ultimate freedom or just freedom is an unexplainable state of bliss. That is the best I can do about Osho. Nevertheless, this snippet on Freedom is etched in my mind.

This apart, I bumped into this movie called Vicky Christina Barcelona. The whole movie is about two friends of contrasting personalities. Christina, is (best)described as a person who does not know what she wants, but only knows what she does’nt want. However queer or irrational it may sound, it is possible watch the movie. For a better understanding, watch yourself! The other character, Vicky is  a totally practical person. In reality, she is as romantic as her friend Christina, but only she lacks the courage to be herself. I think to read ahead, watching the movie becomes a must. Anyway, the two characters are portrayed in a compelling manner that you would want to associate yourself to one of them. I personally believe, we are both Vicky and Christina. Most of us are not sure what we want. We may come up with a long list of excuses for not trying to figure it out. We kind of know what we don’t want. Mind you mathematicians, the English is tricking you. The statements before may give an impression we are talking about some mutually exclusive and exhaustive stuff, Sorry this is not a place for you. Coming back, the Vicky in us is also very obviously seen. Most of us, lack the courage to do what we want to do, we fear courage, opinions that may float around if  we did, people we know etc. This movie kept reminding me how freedom is only felt when exercised and not when talked about. It is ironical that we don’t utilise or experience the freedom of choice that we know we have. It reminds me of our constitutional freedom. It is well-documented, seldom practised in true spirit.

All this and some more subtle encounters have only left me thinking, am I willing to be free…

February 3, 2009 Posted by blogjamun | Uncategorized | | 10 Comments

Thiruvannamalai – A Perarasu film

To do some justice to this blog, I have to give some historical background. Boring as the following paragraph may seem,  that was how things were in my life.

From the time I became a software engineer,  I have been facing this serious social behaviour related disorder. I am yet to coin a name for this. I am not even sure if this is unique to me. In short, I have nothing to do in weekends and to vent this out on somebody, I ping every “green” soul on gmail chat and bore him/her to death. That is only till the disorder has controllable effects on me. Once it goes beyond me, I go to the level of catching some hidden “invisible” people on the chat. I sometimes can  even hear them telling to themselves “What the heck, how the <you-know-what> caught me man!? When I was almost sucked into this disorder, I drew all my mental strength and came up with the idea of going to a movie. I was so hell-bent on getting over this disease, this cursed disorder, I chose to watch Thiruvannamalai.

Thiruvannamalai, is not any other Tamil movie. It is an action thriller with guaranteed quantities of sister and mother sentiment. Yes, it is full of punch dialogues and comedy with great scope for improvement. Ok, no points for this sitter, Perarasu has delivered yet another stomach upsetting block-buster with actors who are eye-sores. The story still has its own elements of unpredictability. Perarasu, has once again proved a point. Gautham, you can’t make original movies like Perarasu! Originality has always been Perarasu’s unique point. He goes to extreme lengths that even Srikanth Deva has scored ORIGINAL music. Please you must give this to the music composer. I don’t think anyone in his right minds will claim ownership for the tracks (read as drags).

Ok, Ok. I know there is no point in me rambling about this without telling the story. Here goes the story, with screen details only where you may not be able to picture the torture I went through.

Action King Arjun, as he is belovedly known by his fans, is a well-built village boy (of age 20- anybody’s guess). His name is Eshwar, the main deity in Thiruvannamalai temple. He is a social activist who runs a non-profit cable TV channel. He can’t have no enemies. The MLA for the area in which Eshwar is, (not- at-all) surprisingly is corrupt to say the least and an untried convict to sum it all. Eshwar, cannot stand corruption. Kudos, to upbringing! He screens some videos he shoots of the MLA’s usual loud-mouthing of his own criminal record in public. Taken aback by such a screening just before the elections, the MLA sends a parade of Tata SUMOs. Rumour has it that Ratan Tata has promised to present Perarasu a golden Tata SUMO model in acknowledgement to his extensive use of SUMO’s in his movie. Of course Tata has refused to comment on this. Coming back to the parade of SUMO’s, imagine how many goondas can be packed into it. Eshwar just goes DAMAAL, DOMEEL, DISHUM on all the goondas. The powerful hits of Eshwar are undoubted, but the last remaining goonda could not stop pissing in his pants. Now that is a temporary renal failure for you. NO surprises there, Eshwar comes out unhurt. Meanwhile his mom is terribly upset. She is deeply worried that her son may get hurt and decides to flee to her brother’s house in Banglore. Now gimme a break! Does she get to see the script, or atleast does she know she is the hero’s mom! This is just one thread of the plot.

Eshwar who has this compulsive disorder of getting into troubles, which without fail results in a lot of SUMO’s, unbearable noise, and flying men and objects. Yes, he gets involved in marrying two lovers. COINCIDENTALLY, the girl who gets married is the daughter of a convicted murderer, more commonly known as Area DADA. Now, he gives all blood shot glares to Eshwar and threatens that he would kill him for sure.

Eshwar’s mom has had enough. She decides to take him to a Swamiji’s ashram in Thiruvannamalai. TITLE JUSTIFIED. Audience whistle to glory! Now, think of the most arbit thing that can happen in the next shot of the movie. You would not have guessed it! Now don’t give me I already knew that shit! The Swamiji is none other than Arjun himself. THats it! I quit continuing with the story! I have conscience..  Don’t watch this in theatre, and please don’t ever do this at home! I am against watching movies in CD,

a) It is waste of a CD. CD is made out of some kind of plastic. Plastic is a non-bio-degradable material. You are doing to the environment what Perarasu is doing to us!!

b) Come on man, wasn’t a) enough for you.

Now I feel really happy about this blog. Though I don’t believe in self-praise, I must say this. This blog will affect every readers’ life in one way or the other. Some have themselves to blame if they watch Thiruvannamalai despite my blog. The others, I am sure are going to keep praising me for such an early warning and the sacrifice I have done. With a heavy heart and upset stomach I leave you here!

December 22, 2008 Posted by blogjamun | Humour, Kollywood, movie | , , | 18 Comments

My maiden foss.in

foss.in is a annual (un)conference where people who believe in free and open source philosophy and mostly write code for a living, gather.
The event has a broad agenda to ensure that some tangible contributions is made. This time the organisers went a step ahead and gave the message more code less talk to put it more subtley.

I was manning the SUN microsystems stall and gave demonstrations on Virtual Box, the latest realease of OpenSolaris, ZFS and Dtrace. Virtualization being the buzz word in recent days, people wanted to see what Virtual Box could do. Most of them were excited to see that multiboot is going to become less painful with desktop virtualization products.

OpenSolaris with its new and shining look did catch some attention. The glassy nimbus theme and compiz just mesmerised people who were looking at it. It even caught a KDE fan gaping at it! To experience this and other cool features of OpenSolaris, see here.

Though ZFS and Dtrace are no longer the new kids on the block, they still fascinate, surprise, bother, disturb the software fraternity like they have always done.
It is never easy to convince people that Dtrace is different from other tracing utilities that are around and that it has zero probe effect. Its even harder to convince those who think it is a marketing gimmick. But all this only meant that people simply could not take the fact that Dtrace can get any data you may need as a part of tracing and with no effect. In my opinion, Dtrace is only as powerful as the user!

ZFS has had a make-over only to become more noticable. Some times great things are taken for granted. With the new time slider integrated with nautilus, zfs snapshots have reached ‘Aam Aadmi’. The time slider is a graphical front end to the already existing snapshot feature. It gives a straight forward intuitive interface. Command line enthusiasts may be upset about this, but what is the fun if people can’t use it or for that matter notice it. I personally feel that intuitive GUI saves tons of documentation and man pages. Time slider has options where you can set the period of backing up, for eg. hourly, daily, weekly, monthly and so on. You can also choose what filesystems you want to backup. These are implemented as SMF services. We had a screencast of time slider demo created by Hemantha, my colleague and partner in crime in almost everything. This demo was done using recordmysolaris. This was a port of the recordmylinux. The highlight of the screencast is that it was in ogv format. Lame as it may sound, not many times do we see a video or audio in the open format. This in turn keeps us locked with some of the private formats.

On the 3rd day we had a work-out/hackathon on adding Dtrace probe to GNOME proposed by Partha. The motivation to this being that GNOME has had no foolproof way of measuring its performance. The problem with existing tools that are available is they have a probe effect. This affects the results obtained in a unquantifiable way, that on most occasions no new information is elicited. Now for all Dtrace users and followers, it is quite apparent that why search/design tools when Dtrace exactly fits the bill. Yes, that is exactly what we thought too. Along with people from GNOME community and some people with experience in Dtrace, we began the proceedings. In three hours of the workout, we chose some probe sites that can prove handy. We added one probe on that session. Now that we have found some interesting probe sites and some people interested in this project, we plan to take off from here and continue the good work. I cant wait for the release of GNOME 2.2x with Dtrace probes. KDE cannot lack this feature thought some of the KDE users/enthusiasts. There was a workout on the subsequent day for adding probes into KDE. I am not sure what the progress is, since I was not present on that day. But workouts were meant to be starting point to some great projects. In fact the 3-hour restriction was only for the hall that was alloted. People could continue the workout anywhere they please during foss. This is only a microscopic view of what hapened at this version foss.in. There were so many cool things going around like KDE4 on Solaris, Porting Linux onto embedded devices and so on and so on.
All in all, this was not just another foss!

December 1, 2008 Posted by blogjamun | dtrace, open source | , , , , , | 2 Comments

How to run a Dtrace script inside a Dtrace script?

This blog is an attempt to summarise what is already present as bits and pieces, in various blogs and gotchas. The blog also assumes a reasonable understanding and hands on experience in using Dtrace.

Scenario:

We want to trace a process whose process-id is not known at the time of running the Dtrace script. We have the name of the process. (execname in Dtrace parlance) The scenario may sound different from the title, but it uses ‘calling dtrace scripts from another’ as a technique to solve the problem in hand.

Ofcourse, there are very many ways of approaching this problem. I would like to know more of them.

Example:

In my example, I have two Dtrace scripts by name ‘test.d’ and ‘test_child.d’. I have named the process I have chosen to trace as ‘testa‘. The file names have been harcoded, so for best results, stick to the file names and locations.

P.S: The following scripts are to be used at your own risk! I am writing these in the middle of night to satisfy my enthusiasm.

test.d
#!/usr/sbin/dtrace -s
#pragma D option destructive
proc:::exec-success
/execname == "testa"/
{ self->chpid = curpsinfo->pr_pid;
stop();
system("/usr/sbin/dtrace -s /tmp/test_child.d %d", self->chpid);
printf("Called /tmp/test_child.d and exiting...\n");
exit(0);
}

test_child.d
#!/usr/sbin/dtrace -s
#pragma D option destructive
BEGIN
{
self->run_pid = $1;
system("prun %d", self->run_pid);
}
pid$1:::entry
{
trace(execname); trace(pid); printf("\n");
printf("Terminating %s...\n", execname);
system("pkill %s", execname);
exit(0);
}

testa
#!/bin/bash
echo "testa running\n";
sleep 15;
echo "testa done\n";

The above example is primarily aimed at giving a know-how on calling Dtrace scripts from a Dtrace script. This example is meant to be treated like a “hello-world” code and played around :)


November 13, 2008 Posted by blogjamun | IT, dtrace | , | 2 Comments

Blog Bloopers! – Blogs that dint make it…..

Its been a long time since I blogged…..Its hard to get your blog updated frequently even though you may have absolutely nothing else to do…

I feel like I am in this blogging inertia..I  dont care if you like my blog… I am not bothered about what people think….

Music is a soulful experience… Art is expression of one’s state of mind…Philosophy lies to those who seek truth…

Girls are not all that different from guys. There is surely a good number of them who bathe only on alternate days…

Breadth of knowledge increases the chances of you getting into an argument… Depth of knowledge makes sure you cant come out of the argument…

October 12, 2008 Posted by blogjamun | Daily Life, Music, Uncategorized | | 3 Comments

Before Sunrise – before I can forget!

I am not sure what I am going to write about the movie. I never even felt like I watched one. I think this movie has affected me more than any other I have seen, heard or read about anywhere. I feel like telling to myself,

“You know what, you are being preposterous on praising this movie so much.”

I think this movie has connected so well with me, that I am writing this immediately after watching the movie. I even notice that I have written it entirely in first person. I cant imagine myself writing otherwise. I cant imagine giving an objective review, totally disconnecting from the emotions I experienced as I was watching the movie. I cant go on about how the director has very aptly chosen Europe as the setting for the story, since Europe is the cradle of modern thinking during the Renaissance period.

I want to document some important things I saw in the movie and felt about. I cant afford to forget it. The story starts in a Eurail in the usual ‘romantically stupid’ way, where the hero and the heroine get adjacent seats by pure coincidence. There stops my complaint about the screenplay. From then on, slowly those two characters dissolve into the story. This idea is even being projected in a scene in the movie. In that scene, the lead pair see paintings of an artist displayed in the streets of Vienna, who has the habit of depicting people as figures with indistinct outlines, portraying the idea that all of us are as much part of the surroundings as we are separate. As the movie progresses, the characters transform into their perceptions about life and things around them. Some of the interesting things that we miss daily in our life, were very beautifully mocked by the characters. One thought from the movie that I can not forget is, we all praise technology for reducing the time consumed to do any work, but we never use that to ‘live life’.

Slowly the couple get comfortable with each other and there thoughts get better structure and gets centered around love. Best part is, it dint happen by accident. They both confess to each other that they had developed an infatuation on first sight of the other. This drives their ‘meaningless’ philosophical ramblings into a concrete and purposeful ‘what you think love is?’ and ‘why people behave the way they do?’ conversation. Just like the characters, we also discover what conflicting opinions we have been having about love, sex and people all along. This movie keeps itself out of professing which is the right opinon, it simply teases us with the possibilties we so contemptously turn a blind eye. It provokes the minds which have been hibernating on the existing framework of beliefs and ideologies, never daring to seek those out in the open. It is an allegorical way of emphasising the fact that questioning anything only enriches our understanding of why we do things the way we do and does not disrespect anyone in the process. This movie goes down into my memory as an experience and not as the details of the scenes in it. More like the smell of a blossoming flower than the picture of the flower itself. I am sure anyone who has watched the movie would appreciate what I am going through when I write this.

September 12, 2008 Posted by blogjamun | movie | , , | 7 Comments