Hi all, Here is how I would like to introduce DTrace to an audience which is not aware of anything remotely related to observability of a system. Please feel free to provide your suggestions, because that is the only way this will help me in my effort. Thank You. <article> To introduce DTrace, you will have to speak about the importance of run time observability of production systems. Perhaps, that sentence was not very informative, however, please stay with me. I shall explain it. Production systems: We call a production system as such, when it is used to provide any kind of consumable service to consumers. Consider a scenario: the billing system in a departmental store serves all the billing terminals- the ones at which you get your stuffs billed. The billing system is perhaps run off a single powerful computer or a network of many powerful computers housed somewhere in the store or more likely in a central location, not in the store. The billing system is an example of a production system. Its in use and you cannot take it down. If you do or it decides to do so on its own, you will face the wrath of customers and bear losses in your business. Observability: In simple words, observing a system means to learn to see the various ways your program- a 10 line program or a billing system- is behaving at run time. Now, what do we mean by ''behaving'' ? Let''s say, our program is now using 10% of the total CPU and other point of time it is using 90% of the CPU. That''s one behavior of the program. More simply, let''s say, for input X, the program is in function, F and for input Y the program goes to function, G. Observing a system during its run time is hence also called dynamic observation of the system, ''cause it happens in real time. Since we basically ''trace'' the behavior of the system at various instants of time, we can also refer to it as ''Dynamic Tracing''. *Off Radioactive elements and DTrace* Tracing of a system is a lot similar to the way Radioactive elements are used as tracers in human body to identify various abnormal body processes. Our topic of interest here, DTrace works a lot like this. Using the DTrace framework, we can implant probes (or tracing points, like ''radioactive tracers'') in our programs and can subsequently monitor those points for activities of interest. </article> I do know that DTrace is best utilized by folks managing huge systems, but no harm in introducing technology :) Thanks, Amit -- http://amitksaha.blogspot.com http://amitsaha.in.googlepages.com/ *Bangalore Open Java Users Group*:http:www.bojug.in "Recursion is the basic iteration mechanism in Scheme" --- http://c2.com/cgi/wiki?TailRecursion
James Dickens
2009-Mar-20 19:38 UTC
[dtrace-discuss] Introducing DTrace to a newbie audience
I like Bryan Cantrill''s Google video, a bit long for your audience but still he has a way of drawing in the audience, but I am a Sys-Admin who gets into this stuff. James Dickens Uadmin.blogspot.com On Fri, Mar 20, 2009 at 3:23 AM, Amit Saha <amitsaha.in at gmail.com> wrote:> Hi all, > > Here is how I would like to introduce DTrace to an audience which is > not aware of anything remotely related to observability of a system. > Please feel free to provide your suggestions, because that is the only > way this will help me in my effort. Thank You. > > <article> > > To introduce DTrace, you will have to speak about the importance of > run time observability of production systems. Perhaps, that sentence > was not very informative, however, please stay with me. I shall > explain it. > > Production systems: We call a production system as such, when it is > used to provide any kind of consumable service to consumers. Consider > a scenario: the billing system in a departmental store serves all the > billing terminals- the ones at which you get your stuffs billed. The > billing system is perhaps run off a single powerful computer or a > network of many powerful computers housed somewhere in the store or > more likely in a central location, not in the store. The billing > system is an example of a production system. Its in use and you cannot > take it down. If you do or it decides to do so on its own, you will > face the wrath of customers and bear losses in your business. > > Observability: In simple words, observing a system means to learn to > see the various ways your program- a 10 line program or a billing > system- is behaving at run time. Now, what do we mean by ''behaving'' ? > Let''s say, our program is now using 10% of the total CPU and other > point of time it is using 90% of the CPU. That''s one behavior of the > program. More simply, let''s say, for input X, the program is in > function, F and for input Y the program goes to function, G. > > Observing a system during its run time is hence also called dynamic > observation of the system, ''cause it happens in real time. Since we > basically ''trace'' the behavior of the system at various instants of > time, we can also refer to it as ''Dynamic Tracing''. > > *Off Radioactive elements and DTrace* > > Tracing of a system is a lot similar to the way Radioactive elements > are used as tracers in human body to identify various abnormal body > processes. Our topic of interest here, DTrace works a lot like this. > > Using the DTrace framework, we can implant probes (or tracing points, > like ''radioactive tracers'') in our programs and can subsequently > monitor those points for activities of interest. > > > </article> > > > I do know that DTrace is best utilized by folks managing huge systems, > but no harm in introducing technology :) > > Thanks, > Amit > > -- > http://amitksaha.blogspot.com > http://amitsaha.in.googlepages.com/ > *Bangalore Open Java Users Group*:http:www.bojug.in > > "Recursion is the basic iteration mechanism in Scheme" > --- http://c2.com/cgi/wiki?TailRecursion > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20090320/c18b6efe/attachment.html>
Michael Ernest
2009-Mar-20 19:43 UTC
[dtrace-discuss] Introducing DTrace to a newbie audience
One aspect of DTrace I enjoy is that you can show people something surprising without a lot of foundational knowledge. You can ask a question like this: If you wanted to know how many processes were running on your system at any time, how would you do it? Most people even lightly familiar with a flavor of Unix know of ps and prstat or top if they''re coming from a cross-platform mindset. Then you can ask: What if you wanted to report on these processes as they are launched? What if you wanted to know who launched them? Show them: # dtrace -qn ''syscall:::exec-success { trace (execname); }'' And run a few commands in another window to generate activity. Follow it up by running /usr/demo/dtrace/whoexec.d as an answer the second question. Ask your audience if they know how to determine when their applications are reading/writing to disk, and which files are involved. Then run /usr/demo/dtrace/iosnoop.d for them. But for even better effect, show them the DTrace code that does this work. Examples like these will probably seem simple, straightforward, even plain to people who don''t look beyond the surface of the systems they are using. These are the people who will be difficult to wow. That''s really the point, to someone who knows a little (or a lot) more and supports such users, but it might be lost on the users themselves. Let''s say you have database programmers in your midst. You want to ask, how would you normally view an SQL statement as it passes from a client program to your listener? There are several DTrace/MySQL examples out there, such as this one: http://hell.jedicoder.net/?p=115 There are many examples as well that apply DTrace to a JVM, Ruby, Javascript, the Apache HTTP server, etc. Aim for some tool or platform your audience cares about, and show them how quickly and powerfully DTrace can do something to reveal how it works. One thing I do in seminars now is instrument a Java program using OpenJDK 7 (also many examples available). Using annotations in Java, it''s short work to write a provider interface, insert some probe points into a short piece of code, run it, and show an audience how to add an on-demand debug capability to a program. I prefer this over the canonical SwingSet demo; it is more accessible to see the inner workings, I feel, and translates into a DIY exercise pretty quickly. If the task is to sell the power of DTrace to people who haven''t been waiting for a tool like this for a long time, I think you''re best served by finding their ''wow!'' level and addressing it. It''s much harder to tell how impressed they should be by what you just showed them. Good luck making converts! Michael -- This message posted from opensolaris.org
Michael, James, Richard! Thanks a lot for all your suggestions! It helped a lot, I have blogged it here http://blogs.sun.com/amitsaha/entry/introducing_dtrace_to_newbies Thanks! -Amit On Sat, Mar 21, 2009 at 1:13 AM, Michael Ernest <michael.ernest at gmail.com> wrote:> One aspect of DTrace I enjoy is that you can show people something surprising without a lot of foundational knowledge. > > You can ask a question like this: If you wanted to know how many processes were running on your system at any time, how would you do it? Most people even lightly familiar with a flavor of Unix know of ps and prstat or top if they''re coming from a cross-platform mindset. > > Then you can ask: What if you wanted to report on these processes as they are launched? What if you wanted to know who launched them? Show them: > > # dtrace -qn ''syscall:::exec-success { trace (execname); }'' > > And run a few commands in another window to generate activity. Follow it up by running /usr/demo/dtrace/whoexec.d as an answer the second question. > > Ask your audience if they know how to determine when their applications are reading/writing to disk, and which files are involved. Then run /usr/demo/dtrace/iosnoop.d for them. But for even better effect, show them the DTrace code that does this work. > > Examples like these will probably seem simple, straightforward, even plain to people who don''t look beyond the surface of the systems they are using. These are the people who will be difficult to wow. That''s really the point, to someone who knows a little (or a lot) more and supports such users, but it might be lost on the users themselves. > > Let''s say you have database programmers in your midst. You want to ask, how would you normally view an SQL statement as it passes from a client program to your listener? There are several DTrace/MySQL examples out there, such as this one: > > http://hell.jedicoder.net/?p=115 > > There are many examples as well that apply DTrace to a JVM, Ruby, Javascript, the Apache HTTP server, etc. Aim for some tool or platform your audience cares about, and show them how quickly and powerfully DTrace can do something to reveal how it works. > > One thing I do in seminars now is instrument a Java program using OpenJDK 7 (also many examples available). Using annotations in Java, it''s short work to write a provider interface, insert some probe points into a short piece of code, run it, and show an audience how to add an on-demand debug capability to a program. I prefer this over the canonical SwingSet demo; it is more accessible to see the inner workings, I feel, and translates into a DIY exercise pretty quickly. > > If the task is to sell the power of DTrace to people who haven''t been waiting for a tool like this for a long time, I think you''re best served by finding their ''wow!'' level and addressing it. It''s much harder to tell how impressed they should be by what you just showed them. > > Good luck making converts!> > Michael > -- > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >-- http://amitksaha.blogspot.com http://amitsaha.in.googlepages.com/ *Bangalore Open Java Users Group*:http:www.bojug.in "Recursion is the basic iteration mechanism in Scheme" --- http://c2.com/cgi/wiki?TailRecursion
> # dtrace -qn ''syscall:::exec-success { trace (execname); }'' >^^^^^^^^^^^^^^^^^^^^^^^^^ The exec-success probe is managed by the proc provider, not the syscall provider. So the probe designation should be; proc:::exec-success (or just ''exec-success''). (for the newbies). Thanks, /jim