Your SlideShare is downloading. ×
0
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
D trace kde4presentation
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

D trace kde4presentation

830

Published on

1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total Views
830
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
1
Comments
1
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  1. Dynamically Tracing KDE Manish Chakravarty ThoughtWorks Studios 1
  2. Agenda • Learn about DTrace • Learn what and where to Trace • Trace! 2
  3. I. What is DTrace? While I go through the slides, please start copying the VM! 3
  4. DTrace is.. • a comprehensive Dynamic Tracing framework created by Sun Microsystems for troubleshooting kernel and application problems in real time. 4
  5. Excuse me? 5
  6. • Dtrace enables us to “look into” the internals of a running production application and allows us to instrument it • It can do very neat stuff in the kernel as well, but that’s not the point of this session 6
  7. So how does DTrace work? 7
  8. • Dtrace allows you to dynamically modify the operating system kernel and user processes to record additional data that you specify at locations of interest, called probes 8
  9. • Dtrace probes come from a set of kernel modules called providers, each of which performs a particular type of instrumentation to create probes 9
  10. Provider:Module:Function:Name 10
  11. Provider The name of the DTrace provider that is publishing this probe 11
  12. Module If this probe corresponds to a specific program location, the name of the module which the probe is located The name is either the name of a kernel module or a user library 12
  13. Function If this probe corresponds to a specific program location, the name of the program function in which the probe is located 13
  14. Name The final component of the probe name is a name that gives you some idea of the probe’s semantic meaning such as BEGIN or END 14
  15. Thus: Provider:Module:Function:Name 15
  16. DTrace Architecture 16
  17. Let’s start Tracing! 17
  18. manish@belenix-KDE4:~/WorkOut/ DTraceTutorial$ pfexec dtrace -n BEGIN dtrace: description 'BEGIN' matched 1 probe CPU ID FUNCTION:NAME 0 1 :BEGIN ^C 18
  19. manish@belenix-KDE4:~/WorkOut/ DTraceTutorial$ pfexec dtrace -n BEGIN -n END dtrace: description 'BEGIN' matched 1 probe dtrace: description 'END' matched 1 probe CPU ID FUNCTION:NAME 0 1 :BEGIN ^C 0 2 :END 19
  20. • The probe BEGIN fires every time you start a new tracing request • The probe END fires every time you exit DTrace. In this case hitting Ctrl-C triggered it. 20
  21. Hello, World! 21
  22. BEGIN { trace("hello, world"); exit(0); } 22
  23. Output.. manish@belenix-KDE4:~/WorkOut/DTraceTutorial/1- HelloWorld$ pfexec dtrace -s hello.d dtrace: script 'hello.d' matched 1 probe CPU ID FUNCTION:NAME 0 1 :BEGIN hello, world 23
  24. 61,809 DTrace probes on the system! pfexec dtrace -l | wc -l 24
  25. DTrace Architecture Source: http://wikis.sun.com/download/attachments/10390716/architecture.gif 25
  26. II. What / Where / How 26
  27. • Navigate to the directory having the Qt source code • Find out a good place in QObject to put one • Start writing probes! 27
  28. Hack! 28

×