Saturday, February 12, 2011

dtrace

I had written about Mac dtrace introduced in 10.5. Attended a cool lecture yesterday which covered dtrace introduced in Solaris.

dtrace as the name conveys is dynamic tracing. It allows you to trace the kernel as well as user land processes thus filling in the void by other tools like ktrace and the likes.
dtrace doesn't have any additional overhead. Why? Read on. The dtrace framework is composed of providers - wherein providers are the ones which provide the probes for the various components of the kernel/userland susbsystem. When a dtrace command or a D script (or python/perl/korn script which has dtrace commands) is fired, then the providers which are nothing but loadable kernel modules (LKM) are loaded by the dtrace VM, thus enabling the trace for the particular subsystem. This on demand patching of the kernel ensures that there is no overhead, unless enabled - that too only providers that are demanded for, are loaded.

Now how do you load only the providers that you are interested in?
Well, this does take a little practise/playing with the dtrace command, I guess.. Dtracce has a set of providers, each one tackles a particular subsystem. Predicates allow you to drill down to the level that you want for e.g. to a particular app's particular module's tracing - and that too to the particular module's condition of occurence. (the example that i was introduced to by the speaker was app:firefox, method/module:poll, ts>n seconds and so on.)

All and all, sounds like a cool thing to be armed with. (Been there, done that without dtrace - with ktrace, kdb and weeks of debugging.)

To read more on this:
http://www.sun.com/bigadmin/content/dtrace/dtrace_usenix.pdf
http://developers.sun.com/solaris/articles/power_of_dtrace.pdf

Saturday, January 9, 2010

Sense of Usability

I've been fortunate to interact and work with some really good professionals. And one thing common with most of them (if not all) has been that they have excellent sense of usability. Don't know what's the link, but they can recognize and in turn use a good feature to the best effect. They can tell a clean interface from a bad one. They can tell a well designed site from the clutter. What's more, they themselves can be trusted to give ideas for good usability.

From my experiences, I've seen that usability is a very important aspect - be it an API interface or user interface. And some folks manage both with equal brilliance!

Lately, Sharan just reinstated this belief of mine.

Usability is the key. Everywhere.  And not just a term to be dismissed off as UE related. It is there in every aspect of programming/programs developed/used et al.

Monday, October 19, 2009

Domain Driven Design

Recently read a few sections of the book Domain Driven Design. The importance of understanding the domain is not to be undermined. 

It is not that you can't design/develop without knowing the domain. And not that you could know the domain overnight and design.

Knowing a domain and designing/refactoring is an ongoing process. And the more you know, the more you improvise. 

I, for one, had never given so much of  a thought to domain knowledge, but the examples in the book were really enlightening. I could relate to many of them and also realised that in reality knowing the domain had helped me get many things right in the last 6 yrs!

All and all, the design tips and methodologies in the book are uber cool and helpful too.

Updated: The book: http://www.amazon.com/gp/product/0321125215 

Saturday, August 22, 2009


Enabling options based on filetype in vim. Picked from here 


:au BufRead *.c so ~/.vim/c.vim
:au BufNewFile *.c so ~/.vim/c.vim
:au BufRead *.py so ~/.vim/py.vim
:au BufNewFile *.py so ~/.vim/py.vim

Then put this in ~/.vim/c.vim:

set shiftwidth=8 

And this in ~/.vim/py.vim:

set shiftwidth=8 

That'll cause vim to source the specified file when the corresponding file type is read (or when a new file of the corresponding type is created).

Sunday, July 26, 2009

Recording some good links

http://www.ddj.com/go-parallel/

http://www.linux-mag.com/cache/7407/1.html

Friday, July 24, 2009

Cilk++


With the advent of 16, 24 (and also 32?) cored machines, multi-core machines are foraying in a big way. Most applications programmed aren't multi-core aware and hence though multi-core hardware prices aren't daunting, the applications can't really scale to it. Redesigning the legacy apps for multi-core aware is not a small task. However suites like Cilk++ do make it so.

Cilk++ comes with a complete suite of compiler, run time system et al, which enables legacy applications that have been designed with no scaling in sight to be multi-core aware with minimal changes. Believe it or not, your code requires as less change as using three keywords effectively to indicate parallelism and synchronization – cilk_for, clik_spawn (for areas which have recursive calls or the types to make use of the multi-cores), cilk_sync (gather results from all the calls). Cilk provides race detector and reducers (race free global variables) as well.

 

To know more, read this:

http://www.cilk.com/multicore-products/cilk-solution-overview/

On using the three keywords to indicate parallelism, the Cilk++ compiler compiles the serial code into multi-core enabled parallel application.

 

N-Queens Problem

A good starting point to understand how this can be used is the N-Queens problem: 

http://www.cilk.com/multicore-blog/bid/6381/Multicore-enabling-the-N-Queens-Problem-Using-Cilk

There are other problems discussed as well. You could track the cilk blog to know more.

 

And to know more about the Cilk language itself: 

http://supertech.csail.mit.edu/papers/cilk5.pdf

Tuesday, October 28, 2008

Python & Scalability

Was checking on Python scalability.

Found some good links
http://highscalability.com/youtube-architecture
http://highscalability.com/tags/python
http://www.python.org/about/success/strakt/ (This one uses Twisted as well)

Generally you can check here: http://www.python.org/about/success/

Couldn't resist this one: http://www.python.org/about/success/rackspace/

And yes, python is not only a scripting language, it is an object oriented programming language too!

A pat for Twisted is here as well:
http://news.zdnet.co.uk/software/0,1000000121,39246546,00.htm