SlideShare a Scribd company logo
Dynamically Tracing
     KDE
     Manish Chakravarty
     ThoughtWorks Studios




                            1
Agenda

• Learn about DTrace
• Learn what and where to Trace
• Trace!


                                  2
I. What is DTrace?


 While I go through the slides, please start copying the VM!

                                                               3
DTrace is..

• a comprehensive Dynamic Tracing
  framework created by Sun Microsystems
  for troubleshooting kernel and application
  problems in real time.




                                               4
Excuse me?



             5
• 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
So how does DTrace
      work?


                     7
• 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
• Dtrace probes come from a set of kernel
  modules called providers, each of which
  performs a particular type of
  instrumentation to create probes




                                            9
Provider:Module:Function:Name




                                10
Provider
The name of the DTrace provider that is publishing this
                      probe




                                                          11
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
Function
    If this probe corresponds to a specific program
location, the name of the program function in which the
                    probe is located




                                                          13
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
Thus:
Provider:Module:Function:Name



                                15
DTrace Architecture
                      16
Let’s start Tracing!



                       17
manish@belenix-KDE4:~/WorkOut/
DTraceTutorial$ pfexec dtrace -n BEGIN

dtrace: description 'BEGIN' matched 1 probe

CPU       ID            FUNCTION:NAME

 0    1                    :BEGIN

^C


                                              18
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
• 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
Hello, World!



                21
BEGIN

{

    trace("hello, world");

         exit(0);

}




                             22
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
61,809
DTrace probes on the system!




   pfexec dtrace -l | wc -l


                               24
DTrace Architecture
  Source: http://wikis.sun.com/download/attachments/10390716/architecture.gif
                                                                                25
II. What / Where / How



                         26
• Navigate to the directory having the Qt
  source code

• Find out a good place in QObject to put
  one

• Start writing probes!


                                            27
Hack!



        28

More Related Content

What's hot (20)

PDF
Scale11x lxc talk
dotCloud
 
PDF
Systemd mlug-20140614
Susant Sahani
 
PDF
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
Sam Kim
 
PDF
Ubuntu 16.04 LTS Security Features
Dustin Kirkland
 
PDF
OSMC 2009 | Windows monitoring - Going where no man has gone before... by Mic...
NETWAYS
 
PPTX
Death matchtournament del2014
Nabil Munawar
 
PDF
Linux containers-namespaces(Dec 2014)
Ralf Dannert
 
PDF
Make container without_docker_6-overlay-network_1
Sam Kim
 
PPTX
A brief history of system calls
Sysdig
 
PDF
Containers and Namespaces in the Linux Kernel
OpenVZ
 
PDF
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
Sam Kim
 
PDF
Systemd evolution revolution_regression
Susant Sahani
 
PDF
An Introduce of OPNFV (Open Platform for NFV)
Mario Cho
 
DOCX
Unix1
girdharitrupti
 
PPTX
Linux container, namespaces & CGroup.
Neeraj Shrimali
 
PDF
Namespaces in Linux
Lubomir Rintel
 
DOCX
Using cgroups in docker container
Vinay Jindal
 
PDF
Linux cgroups and namespaces
Locaweb
 
PDF
The Ruby Guide to *nix Plumbing: Hax0R R3dux
Eleanor McHugh
 
PDF
PythonFuse (PyCon4)
Matteo Bertozzi
 
Scale11x lxc talk
dotCloud
 
Systemd mlug-20140614
Susant Sahani
 
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
Sam Kim
 
Ubuntu 16.04 LTS Security Features
Dustin Kirkland
 
OSMC 2009 | Windows monitoring - Going where no man has gone before... by Mic...
NETWAYS
 
Death matchtournament del2014
Nabil Munawar
 
Linux containers-namespaces(Dec 2014)
Ralf Dannert
 
Make container without_docker_6-overlay-network_1
Sam Kim
 
A brief history of system calls
Sysdig
 
Containers and Namespaces in the Linux Kernel
OpenVZ
 
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
Sam Kim
 
Systemd evolution revolution_regression
Susant Sahani
 
An Introduce of OPNFV (Open Platform for NFV)
Mario Cho
 
Linux container, namespaces & CGroup.
Neeraj Shrimali
 
Namespaces in Linux
Lubomir Rintel
 
Using cgroups in docker container
Vinay Jindal
 
Linux cgroups and namespaces
Locaweb
 
The Ruby Guide to *nix Plumbing: Hax0R R3dux
Eleanor McHugh
 
PythonFuse (PyCon4)
Matteo Bertozzi
 

Similar to D trace kde4presentation (20)

PDF
Solaris DTrace, An Introduction
satyajit_t
 
PDF
A22 Introduction to DTrace by Kyle Hailey
Insight Technology, Inc.
 
PPTX
Performance analysis and troubleshooting using DTrace
Graeme Jenkinson
 
PDF
It802 bruning
mrbruning
 
PDF
Вениамин Гвоздиков: Особенности использования DTrace
Yandex
 
PDF
Solaris Kernel Debugging V1.0
Jarod Wang
 
PPTX
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
PROIDEA
 
PDF
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
OpenEBS
 
PDF
DTrace Topics: Introduction
Brendan Gregg
 
PDF
Interruption Timer Périodique
Anne Nicolas
 
PDF
Dtrace Overview
Jérôme Gauthier
 
PDF
Découvrir dtrace en ligne de commande.
CocoaHeads France
 
PDF
Trace kernel code tips
Viller Hsiao
 
PPT
DTrace - Miracle Scotland Database Forum
Doug Burns
 
PDF
20082501 Leeds Pm
AndyA
 
PDF
Linux Instrumentation
DarkStarSword
 
PDF
Learning Dtrace
JeongHun Byeon
 
ODP
Linux kernel tracing superpowers in the cloud
Andrea Righi
 
PDF
Static and Dynamic Analysis at Ning
ZendCon
 
PDF
dtrace_topics_intro.pdf
ssuser785ce21
 
Solaris DTrace, An Introduction
satyajit_t
 
A22 Introduction to DTrace by Kyle Hailey
Insight Technology, Inc.
 
Performance analysis and troubleshooting using DTrace
Graeme Jenkinson
 
It802 bruning
mrbruning
 
Вениамин Гвоздиков: Особенности использования DTrace
Yandex
 
Solaris Kernel Debugging V1.0
Jarod Wang
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
PROIDEA
 
Dynamic Instrumentation- OpenEBS Golang Meetup July 2017
OpenEBS
 
DTrace Topics: Introduction
Brendan Gregg
 
Interruption Timer Périodique
Anne Nicolas
 
Dtrace Overview
Jérôme Gauthier
 
Découvrir dtrace en ligne de commande.
CocoaHeads France
 
Trace kernel code tips
Viller Hsiao
 
DTrace - Miracle Scotland Database Forum
Doug Burns
 
20082501 Leeds Pm
AndyA
 
Linux Instrumentation
DarkStarSword
 
Learning Dtrace
JeongHun Byeon
 
Linux kernel tracing superpowers in the cloud
Andrea Righi
 
Static and Dynamic Analysis at Ning
ZendCon
 
dtrace_topics_intro.pdf
ssuser785ce21
 
Ad

D trace kde4presentation