SlideShare uma empresa Scribd logo
1 de 25
Baixar para ler offline
DTrace and Perl
What is DTrace?
 DTrace is a comprehensive dynamic tracing
   framework for Solaris™ and Mac OS X™.


DTrace provides a powerful infrastructure to
   permit administrators, developers, and
    service personnel to concisely answer
 arbitrary questions about the behaviour of
  the operating system and user programs.
Problem: Debugging a Live System
Possible Approaches
         Userspace:
•        Ad-hoc logging
•           Log4perl
•           Debugger

        Kernel space:
•            strace
•            ltrace
•            truss
Or use DTrace...
#!/usr/sbin/dtrace -Zs
# pl_subcalls.d

#pragma D option quiet

dtrace:::BEGIN
{
   printf(quot;Tracing... Hit Ctrl-C to end.nquot;);
}

perl*:::sub-entry
{
   @subs[basename(copyinstr(arg1)), copyinstr(arg0)] = count();
}

dtrace:::END
{
   printf(quot; %-32s %-32s %8snquot;, quot;FILEquot;, quot;SUBquot;, quot;CALLSquot;);
   printa(quot; %-32s %-32s %@8dnquot;, @subs);
}
#!/usr/bin/perl

use strict;
use warnings;

sub fib {
    my $n = shift;
    return 1 if $n < 2;
    return fib( $n - 1 ) + fib( $n - 2 );
}

print fib( 12 );
FILE          SUB      CALLS
strict.pm     bits         1
strict.pm     import       1
warnings.pm   import       1
fib.pl        BEGIN        2
fib.pl        fib        465
DTrace is...

•Fast
•Unobtrusive
•Safe
Current Tools
DTrace
DTrace in Perl

•         In 5.11.0 now

•   Patch available for 5.10.0

•     Can patch older Perls

•     See also Devel::DTrace
Probes Available


•    Subroutine Entry

•     Subroutine Exit
Probes Possible

•    Regex Compilation

•        eval / die

•   Anything you like...
DTrace in Perl is fast
   ===========================( subs )=
   standard   | dtrace     | ratio
   ====================================
   2.64732909 | 2.55084610 | 0.96355459
   2.59817791 | 2.54752493 | 0.98050442
   2.62265491 | 2.53197598 | 0.96542476
   2.60479188 | 2.54577494 | 0.97734293
   2.58312511 | 2.54531789 | 0.98536377
   ====================================
   dtrace     | standard   | ratio
   ====================================
   2.55562115 | 2.61360312 | 0.97781531
   2.51933718 | 2.59808207 | 0.96969115
   2.51130199 | 2.61182499 | 0.96151235
   2.55779004 | 2.62898207 | 0.97292031
   2.54250908 | 2.60577297 | 0.97572164
   ====================================
DTrace Limitations

•     Perl stack traces

•         Perl data

•     Limited Platforms

•       Probe Effect
Where is DTrace?
          DTrace runs on:
  Solaris (including OpenSolaris)
          Mac OS (10.5 on)

DTrace could, but doesn’t, run on:
               Linux
              FreeBSD
              Windows
It’s OK:

 Linux has
SystemTap!
dtrace for Linux
  or something
     similar

(LIKE SYSTEMTAP?)
       - jdub
(NO, LIKE dtrace)
       - VLAD
 (like systemtap,
   but not crap)
Seen on a whiteboard at OSCON
quot;That's the difference
between a knockoff and
 the genuine article.quot;
  Adam Leventhal, DTrace developer, Sun
Who made DTrace?
Mike      Bryan     Adam
Shapiro   Cantrill Leventhal
Andy Armstrong
  andy@hexten.net
http://hexten.net/

Mais conteúdo relacionado

Destaque

BeingBed Job
BeingBed JobBeingBed Job
BeingBed Jobwebtel
 
Have A Seat Plzzzzzzz
Have A Seat PlzzzzzzzHave A Seat Plzzzzzzz
Have A Seat Plzzzzzzzwebtel
 
Interesting Ads
Interesting AdsInteresting Ads
Interesting Adswebtel
 
amazing photo
amazing photoamazing photo
amazing photowebtel
 
Ce pleaca-se-si-intoarce
Ce pleaca-se-si-intoarceCe pleaca-se-si-intoarce
Ce pleaca-se-si-intoarceVASILE Viorel
 
Becoming Invisible, Cool Camouflage!
Becoming Invisible, Cool Camouflage!Becoming Invisible, Cool Camouflage!
Becoming Invisible, Cool Camouflage!webtel
 
Guess What Place It Is
Guess What Place It IsGuess What Place It Is
Guess What Place It Iswebtel
 
amazing
amazingamazing
amazingwebtel
 
Beautiful Picture
Beautiful PictureBeautiful Picture
Beautiful Picturewebtel
 
Bed Job
Bed JobBed Job
Bed Jobwebtel
 
Lifes Tug Of War
Lifes Tug Of WarLifes Tug Of War
Lifes Tug Of Warwebtel
 
Amazing Picture
Amazing PictureAmazing Picture
Amazing Picturewebtel
 
Beautiful Words Collection
Beautiful Words CollectionBeautiful Words Collection
Beautiful Words Collectionwebtel
 
Only For You
Only For YouOnly For You
Only For Youwebtel
 
Only In Tunisia
Only In TunisiaOnly In Tunisia
Only In Tunisiawebtel
 
Laloo Prasad Yadav
Laloo Prasad YadavLaloo Prasad Yadav
Laloo Prasad Yadavwebtel
 
The Amazing Art Of Dali
The Amazing Art Of DaliThe Amazing Art Of Dali
The Amazing Art Of Daliwebtel
 

Destaque (20)

BeingBed Job
BeingBed JobBeingBed Job
BeingBed Job
 
Have A Seat Plzzzzzzz
Have A Seat PlzzzzzzzHave A Seat Plzzzzzzz
Have A Seat Plzzzzzzz
 
Interesting Ads
Interesting AdsInteresting Ads
Interesting Ads
 
amazing photo
amazing photoamazing photo
amazing photo
 
Ce pleaca-se-si-intoarce
Ce pleaca-se-si-intoarceCe pleaca-se-si-intoarce
Ce pleaca-se-si-intoarce
 
Becoming Invisible, Cool Camouflage!
Becoming Invisible, Cool Camouflage!Becoming Invisible, Cool Camouflage!
Becoming Invisible, Cool Camouflage!
 
Guess What Place It Is
Guess What Place It IsGuess What Place It Is
Guess What Place It Is
 
Los reinos-cristianos1
Los reinos-cristianos1Los reinos-cristianos1
Los reinos-cristianos1
 
Curiosites 11
Curiosites 11Curiosites 11
Curiosites 11
 
amazing
amazingamazing
amazing
 
Beautiful Picture
Beautiful PictureBeautiful Picture
Beautiful Picture
 
Bed Job
Bed JobBed Job
Bed Job
 
Lifes Tug Of War
Lifes Tug Of WarLifes Tug Of War
Lifes Tug Of War
 
Amazing Picture
Amazing PictureAmazing Picture
Amazing Picture
 
Beautiful Words Collection
Beautiful Words CollectionBeautiful Words Collection
Beautiful Words Collection
 
Only For You
Only For YouOnly For You
Only For You
 
Only In Tunisia
Only In TunisiaOnly In Tunisia
Only In Tunisia
 
Amante
AmanteAmante
Amante
 
Laloo Prasad Yadav
Laloo Prasad YadavLaloo Prasad Yadav
Laloo Prasad Yadav
 
The Amazing Art Of Dali
The Amazing Art Of DaliThe Amazing Art Of Dali
The Amazing Art Of Dali
 

Semelhante a 20082501 Leeds Pm

It802 bruning
It802 bruningIt802 bruning
It802 bruningmrbruning
 
DTrace Topics: Introduction
DTrace Topics: IntroductionDTrace Topics: Introduction
DTrace Topics: IntroductionBrendan Gregg
 
Monitoring MySQL with DTrace/SystemTap
Monitoring MySQL with DTrace/SystemTapMonitoring MySQL with DTrace/SystemTap
Monitoring MySQL with DTrace/SystemTapPadraig O'Sullivan
 
Lecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentLecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentMohammed Farrag
 
CodeQL + DTrace = Memory Disclosure Vulnerabilities in XNU
CodeQL + DTrace = Memory Disclosure Vulnerabilities in XNUCodeQL + DTrace = Memory Disclosure Vulnerabilities in XNU
CodeQL + DTrace = Memory Disclosure Vulnerabilities in XNUArsenii Kostromin
 
Filippo, Plain simple reality of entropy
Filippo, Plain simple reality of  entropyFilippo, Plain simple reality of  entropy
Filippo, Plain simple reality of entropyPacSecJP
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak PROIDEA
 
DTrace - Miracle Scotland Database Forum
DTrace - Miracle Scotland Database ForumDTrace - Miracle Scotland Database Forum
DTrace - Miracle Scotland Database ForumDoug Burns
 
Solaris DTrace, An Introduction
Solaris DTrace, An IntroductionSolaris DTrace, An Introduction
Solaris DTrace, An Introductionsatyajit_t
 
Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph Ceph Community
 
Application of Radare2 Illustrated by Shylock and Snakso.A Analysis
Application of Radare2 Illustrated by Shylock and Snakso.A AnalysisApplication of Radare2 Illustrated by Shylock and Snakso.A Analysis
Application of Radare2 Illustrated by Shylock and Snakso.A AnalysisPositive Hack Days
 
MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)Masami Hiramatsu
 
D Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance ProblemsD Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance ProblemsMySQLConference
 
FreeBSD 2014 Flame Graphs
FreeBSD 2014 Flame GraphsFreeBSD 2014 Flame Graphs
FreeBSD 2014 Flame GraphsBrendan Gregg
 
Scaling IO-bound microservices
Scaling IO-bound microservicesScaling IO-bound microservices
Scaling IO-bound microservicesSalo Shp
 

Semelhante a 20082501 Leeds Pm (20)

It802 bruning
It802 bruningIt802 bruning
It802 bruning
 
DTrace Topics: Introduction
DTrace Topics: IntroductionDTrace Topics: Introduction
DTrace Topics: Introduction
 
Monitoring MySQL with DTrace/SystemTap
Monitoring MySQL with DTrace/SystemTapMonitoring MySQL with DTrace/SystemTap
Monitoring MySQL with DTrace/SystemTap
 
Lecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentLecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports Development
 
Debug generic process
Debug generic processDebug generic process
Debug generic process
 
Hotsos Advanced Linux Tools
Hotsos Advanced Linux ToolsHotsos Advanced Linux Tools
Hotsos Advanced Linux Tools
 
CodeQL + DTrace = Memory Disclosure Vulnerabilities in XNU
CodeQL + DTrace = Memory Disclosure Vulnerabilities in XNUCodeQL + DTrace = Memory Disclosure Vulnerabilities in XNU
CodeQL + DTrace = Memory Disclosure Vulnerabilities in XNU
 
Filippo, Plain simple reality of entropy
Filippo, Plain simple reality of  entropyFilippo, Plain simple reality of  entropy
Filippo, Plain simple reality of entropy
 
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak   CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
CONFidence 2015: DTrace + OSX = Fun - Andrzej Dyjak
 
DTrace - Miracle Scotland Database Forum
DTrace - Miracle Scotland Database ForumDTrace - Miracle Scotland Database Forum
DTrace - Miracle Scotland Database Forum
 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
 
Solaris DTrace, An Introduction
Solaris DTrace, An IntroductionSolaris DTrace, An Introduction
Solaris DTrace, An Introduction
 
Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph Ceph Day Melbourne - Troubleshooting Ceph
Ceph Day Melbourne - Troubleshooting Ceph
 
A22 Introduction to DTrace by Kyle Hailey
A22 Introduction to DTrace by Kyle HaileyA22 Introduction to DTrace by Kyle Hailey
A22 Introduction to DTrace by Kyle Hailey
 
Application of Radare2 Illustrated by Shylock and Snakso.A Analysis
Application of Radare2 Illustrated by Shylock and Snakso.A AnalysisApplication of Radare2 Illustrated by Shylock and Snakso.A Analysis
Application of Radare2 Illustrated by Shylock and Snakso.A Analysis
 
MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)
 
D Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance ProblemsD Trace Support In My Sql Guide To Solving Reallife Performance Problems
D Trace Support In My Sql Guide To Solving Reallife Performance Problems
 
FreeBSD 2014 Flame Graphs
FreeBSD 2014 Flame GraphsFreeBSD 2014 Flame Graphs
FreeBSD 2014 Flame Graphs
 
Scaling IO-bound microservices
Scaling IO-bound microservicesScaling IO-bound microservices
Scaling IO-bound microservices
 
Metasploitable
MetasploitableMetasploitable
Metasploitable
 

Último

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 

Último (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 

20082501 Leeds Pm

  • 2. What is DTrace? DTrace is a comprehensive dynamic tracing framework for Solaris™ and Mac OS X™. DTrace provides a powerful infrastructure to permit administrators, developers, and service personnel to concisely answer arbitrary questions about the behaviour of the operating system and user programs.
  • 3. Problem: Debugging a Live System
  • 4. Possible Approaches Userspace: • Ad-hoc logging • Log4perl • Debugger Kernel space: • strace • ltrace • truss
  • 6. #!/usr/sbin/dtrace -Zs # pl_subcalls.d #pragma D option quiet dtrace:::BEGIN { printf(quot;Tracing... Hit Ctrl-C to end.nquot;); } perl*:::sub-entry { @subs[basename(copyinstr(arg1)), copyinstr(arg0)] = count(); } dtrace:::END { printf(quot; %-32s %-32s %8snquot;, quot;FILEquot;, quot;SUBquot;, quot;CALLSquot;); printa(quot; %-32s %-32s %@8dnquot;, @subs); }
  • 7. #!/usr/bin/perl use strict; use warnings; sub fib { my $n = shift; return 1 if $n < 2; return fib( $n - 1 ) + fib( $n - 2 ); } print fib( 12 );
  • 8. FILE SUB CALLS strict.pm bits 1 strict.pm import 1 warnings.pm import 1 fib.pl BEGIN 2 fib.pl fib 465
  • 12. DTrace in Perl • In 5.11.0 now • Patch available for 5.10.0 • Can patch older Perls • See also Devel::DTrace
  • 13. Probes Available • Subroutine Entry • Subroutine Exit
  • 14. Probes Possible • Regex Compilation • eval / die • Anything you like...
  • 15. DTrace in Perl is fast ===========================( subs )= standard | dtrace | ratio ==================================== 2.64732909 | 2.55084610 | 0.96355459 2.59817791 | 2.54752493 | 0.98050442 2.62265491 | 2.53197598 | 0.96542476 2.60479188 | 2.54577494 | 0.97734293 2.58312511 | 2.54531789 | 0.98536377 ==================================== dtrace | standard | ratio ==================================== 2.55562115 | 2.61360312 | 0.97781531 2.51933718 | 2.59808207 | 0.96969115 2.51130199 | 2.61182499 | 0.96151235 2.55779004 | 2.62898207 | 0.97292031 2.54250908 | 2.60577297 | 0.97572164 ====================================
  • 16. DTrace Limitations • Perl stack traces • Perl data • Limited Platforms • Probe Effect
  • 17. Where is DTrace? DTrace runs on: Solaris (including OpenSolaris) Mac OS (10.5 on) DTrace could, but doesn’t, run on: Linux FreeBSD Windows
  • 18. It’s OK: Linux has SystemTap!
  • 19. dtrace for Linux or something similar (LIKE SYSTEMTAP?) - jdub (NO, LIKE dtrace) - VLAD (like systemtap, but not crap) Seen on a whiteboard at OSCON
  • 20. quot;That's the difference between a knockoff and the genuine article.quot; Adam Leventhal, DTrace developer, Sun
  • 22.
  • 23.
  • 24. Mike Bryan Adam Shapiro Cantrill Leventhal
  • 25. Andy Armstrong andy@hexten.net http://hexten.net/