Saturday, February 12, 2011
dtrace
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
Monday, October 19, 2009
Domain Driven Design
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
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
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