Dynamic Tracing using DTrace tm By Sameer Niphadkar.

Slides:



Advertisements
Similar presentations
Android Application Development A Tutorial Driven Course.
Advertisements

.NET Technology. Introduction Overview of.NET What.NET means for Developers, Users and Businesses Two.NET Research Projects:.NET Generics AsmL.
Chapt.2 Machine Architecture Impact of languages –Support – faster, more secure Primitive Operations –e.g. nested subroutine calls »Subroutines implemented.
Introducing JavaScript
Profiler In software engineering, profiling ("program profiling", "software profiling") is a form of dynamic program analysis that measures, for example,
Software & Services Group PinPlay: A Framework for Deterministic Replay and Reproducible Analysis of Parallel Programs Harish Patil, Cristiano Pereira,
INTRODUCTION Chapter 1 1. Java CPSC 1100 University of Tennessee at Chattanooga 2  Difference between Visual Logic & Java  Lots  Visual Logic Flowcharts.
University of Maryland Locality Optimizations in cc-NUMA Architectures Using Hardware Counters and Dyninst Mustafa M. Tikir Jeffrey K. Hollingsworth.
SYSTEM PROGRAMMING & SYSTEM ADMINISTRATION
Huimei Lu Chapter1 Solaris Overview —— Feature and architecture.
Assembly Code Verification Using Model Checking Hao XIAO Singapore University of Technology and Design.
CIM2564 Introduction to Development Frameworks 1 Overview of a Development Framework Topic 1.
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 2: Operating-System Structures.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
Activity 1 - WBs 5 mins Go online and spend a moment trying to find out the difference between: HIGH LEVEL programming languages and LOW LEVEL programming.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
A Portable Virtual Machine for Program Debugging and Directing Camil Demetrescu University of Rome “La Sapienza” Irene Finocchi University of Rome “Tor.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training course describes how to configure the the C/C++ compiler options.
Higher Grade Computing Studies 2. Languages and Environments Higher Computing Software Development S. McCrossan 1 Classification of Languages 1. Procedural.
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
Analyzing parallel programs with Pin Moshe Bach, Mark Charney, Robert Cohn, Elena Demikhovsky, Tevi Devor, Kim Hazelwood, Aamer Jaleel, Chi- Keung Luk,
Business Unit or Product Name © 2007 IBM Corporation Introduction of Autotest Qing Lin.
Eric Keller, Evan Green Princeton University PRESTO /22/08 Virtualizing the Data Plane Through Source Code Merging.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Android for Java Developers Denver Java Users Group Jan 11, Mike
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Programming With C.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Windows 2000 Course Summary Computing Department, Lancaster University, UK.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
March 12, 2001 Kperfmon-MP Multiprocessor Kernel Performance Profiling Alex Mirgorodskii Computer Sciences Department University of Wisconsin.
Developing software and hardware in parallel Vladimir Rubanov ISP RAS.
Topic 2d High-Level languages and Systems Software
CE Operating Systems Lecture 14 Memory management.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
Issues Autonomic operation (fault tolerance) Minimize interference to applications Hardware support for new operating systems Resource management (global.
® IBM Software Group © 2006 IBM Corporation PurifyPlus on Linux / Unix Vinay Kumar H S.
02/09/2010 Industrial Project Course (234313) Virtualization-aware database engine Final Presentation Industrial Project Course (234313) Virtualization-aware.
Copyright © Mohamed Nuzrath Java Programming :: Syllabus & Chapters :: Prepared & Presented By :: Mohamed Nuzrath [ Major In Programming ] NCC Programme.
CSCI Rational Purify 1 Rational Purify Overview Michel Izygon - Jim Helm.
Worldspan and RTF Pam Clark, Worldspan Thiru Thirupuvanam, TPF Software TPF Users Group Arlington, VA Date: October 9, 2007.
Overview of dtrace Adam Leko UPC Group HCS Research Laboratory University of Florida Color encoding key: Blue: Information Red: Negative note Green: Positive.
TAKE – A Derivation Rule Compiler for Java Jens Dietrich, Massey University Jochen Hiller, TopLogic Bastian Schenke, BTU Cottbus/REWERSE.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Full and Para Virtualization
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Chapter – 8 Software Tools.
What is a Process ? A program in execution.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Beyond Application Profiling to System Aware Analysis Elena Laskavaia, QNX Bill Graham, QNX.
Lecture 1 Page 1 CS 111 Summer 2013 Important OS Properties For real operating systems built and used by real people Differs depending on who you are talking.
1© Copyright 2015 EMC Corporation. All rights reserved. NUMA(YEY) BY JACOB KUGLER.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
Sun Tech Talk 3 Solaris 10 and OpenSolaris Pierre de Filippis Sun Campus Evangelist
Introduction to threads
Introduction to Operating Systems
CMPE419 Mobile Application Development
TRANSLATORS AND IDEs Key Revision Points.
Introduction to Operating Systems
Operating Systems Lecture 4.
PHP an introduction.
CMPE419 Mobile Application Development
Dynamic Binary Translators and Instrumenters
Presentation transcript:

Dynamic Tracing using DTrace tm By Sameer Niphadkar

Overview Introduction to Tracing Current Alternatives What is DTrace ? Instrumentation Significance D Programming language DTrace Basic Architecture Case Studies Further Information References

Introduction to Tracing Trace = find by careful investigation How's software tracing useful ? Tracks performance problems across many layers of software for further debugging by tracing system_calls( ) for one or more processes. Determines actions to be taken by investigation of bottlenecks. Quick iterative analysis saves precious time on production systems.

Introduction to Tracing (cont) Highlights and tunes software systems for better performance and management No recompilation (Dtrace) No performance hit (Dtrace) Useful for I/O, CPU, VM stats, user functions and other personalized views (DTrace)

Current Alternatives Process statistics using – truss, trace (s, p, l), apptrace, debuggers – mdb, adb etc Limitations Non-evasive methods : proc file systems Concentrate only on processes system calls and no system wide introspection : threads, functions, user applications No dynamic instrumentation of various code paths and data records into buffers.

Current Alternatives (cont) Other tracing tools Linux Trace Toolkit – Limited no. of instrumentation points, No arbitrary action, Lacks inclusion of higher level language to describe actions DProbes – For OS/2 ported to Linux. Similar to Dtrace but lossy technique for various CPUs. Lacks data aggression and predicate support. Invalid safety support K42 – Research kernel having its own static instrumentation. Limitations similar to LTT Kerninst – Dynamic instrumentation framework. Zero probe effect like Dtrace. Highly aggressive instrumentation can introduce fatal errors. No support for arbitrary actions.

What is Dtrace ? Dtrace is a comprehensive dynamic tracing facility that is built into the Sun Solaris 10 and the Open Solaris kernel Features of Dtrace Normal custom tracing mechanisms + your own personal programs and provides answers to all your queries : D Programming language Binds a request to a probe after firing for specific actions like recording a stack trace, time stamp or arguments to a function : programming sensor Dtrace + probe = Information of desired location. All instrumentation is dynamic : probes enabled discretely while you are using them i.e. system does not experience any performance degradation. Zero probe effect.

What is Dtrace ? (cont) Dynamic instrumentation both in the user and kernel level : data & control flow across boundary Data Integrity : Reports only non-corrupt and true data values Predicates : Actions to be taken only when user specified conditions are met. Pruning at source. Speculative tracing : Deferring decision to commit/discard at a later time. Less post-processing for aberrant behaviour. Scalable Architecture : Thousands of instrumentation points. Probes subsets to be enabled Virtualized Consumer : Multiple consumers can enable the same probe in different ways. Single consumer – single probe in different ways.

Instrumentation Significance Systemic Scope : Entire system to be instrumentable. Performance Analysis on production systems. Types of instrumentation tracings - Static : Operate by instrumenting binary offline and running it in lieu of the original binary. Limitations – No systemic insights, No integration from disjoint applications, No OS instrumentation For e.g. – ATOM, Purify, Pin

Instrumentation Significance Steps for statically defined tracings for user applications (Dtrace) Name your provider Make probe points by adding macro calls to the code Create yourprovider.d file containing descriptors and arguments of the probe Modify build process to run dtrace all over your object (.o) file Add yourprovider.o to the link library

D Programming language Main features High level language based on C : 90% of syntax from ANSI C Programming structure suitable for tracing + Set of primitives for more advanced data Dtrace compiler in userland converts requests from high-level D Programming language to simple virtual machine. Every probe in DTrace has two names: a unique integer ID and a human-readable string name Easy to understand for any new user as well.

D Programming language (cont) Sample Dtrace operation - # 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 # Sample D Code - BEGIN { trace("hello, world"); exit(0); } O/P - # dtrace -s hello.d dtrace: script 'hello.d' matched 1 probe CPU ID FUNCTION:NAME 0 1 :BEGIN hello, world #

D Programming language (cont) Providers & Probes : DTrace probes come from set of layered kernel modules called providers. Each of which performs a kind of instrumentation. Tracing action is then bound to these probes. # dtrace -l | wc -l => More than 30,000 probes on 1 system + you can create newer ones if need. Id: provider: module: function: name Compilation & Instrumentation : D language compiler => OS kernel execution => No instrumented code for in-active probes. Therefore no system pause, no trace switch. Intermediate form of D program valid for safety. Can handle runtime errors

Dtrace Architecture

Dtrace Architecture (cont) ECB : Enabling Control Block – Probe is enabled ECB is created. Actions & Predicates : ECB has an optional predicate associated with it. ECB has a list of actions if predicate is satisfied. Buffers : Each Dtrace consumer has a set of in-kernel per-CPU buffers. When ECB action indicated data to be recorded, then its done in consumer's per CPU buffer. If no space in buffer then drop count is incremented and the next ECB is tackled. EPID : Enabled Probe Identifier : Data record layout in per CPU buffer. 1 to many mappings with ECBs.

Dtrace Architecture (cont) DIF : Action-Predicates described in VM instruction set emulated in the kernel during probe fire. RISC instruction set for emulation and on the fly code generation. Execution Mechanism : Command run Probe fire Record in buffer Buffer processed User Level Kernel Level

Case Studies Dtrace Scripts (recepies) : iosnoop, execsnoop, opensnoop, prustat, dtruss...endless Production Systems : SunRay server 10 CPUs, 32 GB memory, 170 SunRay users. Dtrace's sysinfo provider helped in resolving cross-call per CPU problem. Other useful ones :

Further Information References Dtrace BigAdmin – System Admin Portal Dtrace source for download Dtrace manual/ documentation Bryan Cantrill's blog Dtrace tools users.tpg.com.au/adsln4yb/DTrace/smc.html

Summary Conclusion : Dtrace can be considered as one of the best comprehensive tool of instrumentation on a production system.

Thank You !