DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD

5星(超过95%的资源)
所需积分/C币:9 2011-09-22 10:23:03 11.81MB PDF
29
收藏 收藏
举报

This book is all about DTrace, with the emphasis on using DTrace to understand, observe, and diagnose systems and applications. A deep understanding of the details of how DTrace works is not necessary to using DTrace to diagnose and solve problems; thus, the book covers using DTrace on systems and applications, with command-line examples and a great many D scripts. Depending on your level of experience, we intend the book’s organization to facilitate its use as a reference guide, allowing you to refer to specific chapters when diagnosing a particular area of the system or application.
This page intentionally left blank DTrace Dynamic Tracing in Oracle@ Solaris Mac osx and freebsd Brendan Gregg Jim Mauro 88 PRENTICE HALL Upper Saddle river,NJ· Boston· Indianapolis· San francisco New York· Toronto· Montreal· London· Munich· Paris· Madrid Capetown· Sydney· Tokyo· Singapore· Mexico City Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim the designations have been printed with initial capital letters or in all capitals Oracle and Java are registered trademarks of Oracle and/or its affiliates. other names may be trademarks of their respective owners AMD, Opteron, the AMD logo, and the amd Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation All SPaRC trademarks are used under license and are trademarks or registered trademarks of SParc inter- national, Inc. UNIX is a registered trademark licensed through X/Open Company, ltd The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for inciden- tal or consequential damages in connection with or arising out of the use of the information or programs con tained herein This document is provided for information purposes only and the contents hereof are subject to change with- out notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document and no con tractual obligations are formed either directly or indirectly by this document. This document may not be repro duced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our prior written permission. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business training goals, marketing focus, and branding interests. For more information, please contact U.S. Corporate and government sales (800)382-3419 corpsales@pearsontechgroup.com For sales outside the United States, please contact International sales international@pearsoned com Visit us on the Web: informit. com/ph Library of congress Cataloging-in-Publication data Gregg, Brendan Dynamic tracing in Oracle Solaris, Mac OS X, and FreeBSD /Brendan Gregg, Jim Mauro p. cm. Includes index ISBN-13:978-0-13-209151-0(alk. paper) ISBN-10:0-13-2091518( alk. paper) Debugging in computer science. 2. Solaris(Computer file)3. Mac OS. 4. FreeBSD. I Mauro. Jim.Il. Title QA76.9.D43G742011 005.1′4dc22 2010047609 Copyright o 2011 Oracle and/or its affiliates. All rights reserved 500 Oracle Parkway, Redwood Shores, CA 94065 Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmis sion in any form or by any means, electronic, mechanical, photocopying, recording, or likewise For informa tion regarding permissions, write to Pearson education. Inc Rights and Contracts Department 501 Boylston Street, Suite 900 Boston. Ma02116 Fax:(617)671-3447 ISBN-13:978-0-13-209151-0 ISBN-10 0-13-209151-8 Text printed in the United States on recycled paper at edwards Brothers in Ann Arbor, Michigan First printing, March 2011 Contents Foreword Preface Acknowledgments About the authors Part I Introduction Chapter 1 Introduction to dtrace What Is dtrace? Why Do You Need It? Capabilities 1124 Dynamic and Static Probes DTrace Features A First look Overview 689 Consumers Probes PI providers 11 Predicates Contents Actions 13 aggregations 13 DL anguage 14 Architecture 16 Summary 17 Chapter 2 d language 19 D Language Components 20 sage 20 Program Structure 21 Probe format 21 Predicates 22 Actions 23 robes 23 Wildcards 23 begin and end 24 profile and tick 24 syscall Entry and Return 25 Variables 26 ypes 26 Operators 27 Scalar 28 Associative arrays 29 Structs and pointers 29 Thread local 30 Clause local 30 Built-in 31 Macro 32 External 33 Aggregations 33 ypes 34 quantized 34 quantized 35 Contents trunco and clear normalize 36 printao 36 Actions 37 trace printf 38 raceme 39 copyIn stringof( and copyinstrO 39 strlen and strjoino stack(, ustack(, and jstackO sizeof 41 exito 41 Speculations Translators 42 Others 42 Options 43 Example programs 44 Hello world Tracing Who Opened What 44 Tracing fork( and execo Counting system Calls by a Named Process Showing Read Byte Distributions by Process Profiling Process Names Timing a system call 47 Snoop Process Execution 48 Summary Part I Using DTrace Chapter 3 System View Start at the beginning System Methodology 53 System Tools VIll Contents Observing CPUs 56 CPU Strategy 56 CPUs and Interrupts 85 CPU Events 88 CPU Summary 94 Observing Memory 95 Memory Strategy 95 Memory Checklist 96 Memory providers 96 Memory One-liners Memory Analysis 98 User Process Memory activity 101 Kernel Memory 118 Memory summary 124 Observing disk and Network I/O 125 I/O Strategy 125 I/O Checklist 125 I/O Providers 126 I/O One-Liners 127 I/0 Analysis 128 Disk i/o 134 Network io 141 Summary 148 Chapter 4 Disk I/O 15 Capabilities 152 Disk 1O Strategy 154 Checklist 155 Providers 156 10 Provider 157 fbt provider 163 One-Liners 165 One-Liner Examples 166 Contents X 172 io Provider Scripts 173 SCSI Scripts 211 SATA Scripts 236 IDE Scripts 250 SAS Scripts 259 Case Studies 269 Shouting in the Data Center: A Personal Case Study (Brendan) 269 DTracing an Unfamiliar l/o Driver(Sata) 273 Conclusion 290 Summary 290 Chapter 5 File Systems 291 Capabilitie 292 Logical vs Physical I/O 295 Strategy 295 Checklist 296 P providers 297 fsinfo provider 298 10 Provider 300 One-Liners 300 One-Liners: syscall Provider Examples 304 One-Liners: vminfo Provider Examples One-Liners: fsinfo Provider Examples 308 One-Liners: sdt Provider examples 312 crip 313 Syscall Provider 315 fsinfo Scripts 327 VFS Scripts 335 UFS Scripts 351 ZFS Scripts 357 HFS+ Scripts 370

...展开详情
试读 127P DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD
立即下载
限时抽奖 低至0.43元/次
身份认证后 购VIP低至7折
一个资源只可评论一次,评论内容不能少于5个字
z998998 DTrace非常好的工具
2017-05-10
回复
leeming0503 DTrace非常好的工具,要好好学习学习
2015-08-21
回复
zhjh256 DTrace非常好的工具
2014-06-30
回复
cjohnkk DTrace非常好的工具
2014-06-18
回复
Coursera 真希望有更多的内核Trace的书籍问世,想讲讲dmesg
2013-05-28
回复
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
上传资源赚钱or赚积分
最新推荐
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD 9积分/C币 立即下载
1/127
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第1页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第2页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第3页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第4页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第5页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第6页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第7页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第8页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第9页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第10页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第11页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第12页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第13页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第14页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第15页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第16页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第17页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第18页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第19页
DTrace - Dynamic Tracing in Oracle® Solaris, Mac OS X, and FreeBSD第20页

试读结束, 可继续阅读

9积分/C币 立即下载