- ホーム
- > 洋書
- > 英文書
- > Computer / General
Full Description
The Oracle Solaris DTrace feature revolutionizes the way you debug operating systems and applications. Using DTrace, you can dynamically instrument software and quickly answer virtually any question about its behavior. Now, for the first time, there's a comprehensive, authoritative guide to making the most of DTrace in any supported UNIX environment--from Oracle Solaris to OpenSolaris, Mac OS X, and FreeBSD.Written by key contributors to the DTrace community, DTrace teaches by example, presenting scores of commands and easy-to-adapt, downloadable D scripts. These concise examples generate answers to real and useful questions, and serve as a starting point for building more complex scripts. Using them, you can start making practical use of DTrace immediately, whether you're an administrator, developer, analyst, architect, or support professional.The authors fully explain the goals, techniques, and output associated with each script or command. Drawing on their extensive experience, they provide strategy suggestions, checklists, and functional diagrams, as well as a chapter of advanced tips and tricks. You'll learn how toWrite effective scripts using DTrace's D language Use DTrace to thoroughly understand system performance Expose functional areas of the operating system, including I/O, filesystems, and protocols Use DTrace in the application and database development process Identify and fix security problems with DTrace Analyze the operating system kernel Integrate DTrace into source code Extend DTrace with other tools This book will help you make the most of DTrace to solve problems more quickly and efficiently, and build systems that work faster and more reliably.
Contents
Foreword xxiPreface xxvAcknowledgments xxxiAbout the Authors xxxvPart I: IntroductionChapter 1: Introduction to DTrace 1What Is DTrace? 1Why Do You Need It? 1Capabilities 2Dynamic and Static Probes 4DTrace Features 4A First Look 6Overview 8Architecture 16Summary 17Chapter 2: D Language 19D Language Components 20Probes 23Variables 26Aggregations 33Actions 37Options 43Example Programs 44Summary 49Part II: Using DTraceChapter 3: System View 51Start at the Beginning 52Observing CPUs 56Observing Memory 95Observing Disk and Network I/O 125Summary 148Chapter 4: Disk I/O 151Capabilities 152Disk I/O Strategy 154Checklist 155Providers 156Scripts 172Case Studies 269Summary 290Chapter 5: File Systems 291Capabilities 292Strategy 295Checklist 296Providers 297Scripts 313Case Study 387Summary 397Chapter 6: Network Lower-Level Protocols 399Capabilities 400Strategy 402Checklist 403Providers 404Scripts 445Common Mistakes 548Summary 555Chapter 7: Application-Level Protocols 557Capabilities 558Strategy 558Checklist 559Providers 560Scripts 574Summary 668Chapter 8: Languages 669Capabilities 671Strategy 672Checklist 674Providers 675C 679C++ 689Java 691JavaScript 705Perl 719PHP 731Python 740Ruby 751Shell 764Tcl 774Summary 782Chapter 9: Applications 783Capabilities 784Strategy 784Checklist 786Providers 787Scripts 804Case Studies 817Summary 832Chapter 10: Databases 833Capabilities 834Strategy 835Providers 836MySQL 837PostgreSQL 851Oracle 858Summary 865Part III: Additional User TopicsChapter 11: Security 867Privileges, Detection, and Debugging 867Scripts 875Summary 892Chapter 12: Kernel 893Capabilities 894Strategy 896Checklist 897Providers 897Scripts 932Summary 945Chapter 13: Tools 947The DTraceToolkit 948Chime 962DTrace GUI Plug-in for NetBeans and Sun Studio 966DLight, Oracle Solaris Studio 12.2 966Mac OS X Instruments 971Analytics 973Summary 985Chapter 14: Tips and Tricks 987Tip 1: Known Workloads 987Tip 2: Write Target Software 989Tip 3: Use grep to Search for Probes 991Tip 4: Frequency Count 991Tip 5: Time Stamp Column, Postsort 992Tip 6: Use Perl to Postprocess 993Tip 7: Learn Syscalls 994Tip 8: timestamp vs. vtimestamp 995Tip 9: profile:::profile-997 and Profiling 996Tip 10: Variable Scope and Use 997Tip 11: strlen() and strcmp() 999Tip 12: Check Assumptions 1000Tip 13: Keep It Simple 1001Tip 14: Consider Performance Impact 1001Tip 15: drops and dynvardrops 1003Tip 16: Tail-Call Optimization 1003Further Reading 1003Appendix A: DTrace Tunable Variables 1005Appendix B: D Language Reference 1011Appendix C: Provider Arguments Reference 1025Providers 1025Arguments 1038Appendix D: DTrace on FreeBSD 1045Enabling DTrace on FreeBSD 7.1 and 8.0 1045DTrace for FreeBSD: John Birrell 1047Appendix E: USDT Example 1051USDT Bourne Shell Provider 1052Case Study: Implementing a Bourne Shell Provider 1057Appendix F: DTrace Error Messages 1063Privileges 1063Drops 1064Aggregation Drops 1065Dynamic Variable Drops 1066Invalid Address 1066Maximum Program Size 1067Not Enough Space 1068Appendix G: DTrace Cheat Sheet 1069Synopsis 1069Finding Probes 1069Finding Probe Arguments 1070Probes 1070Vars 1070Actions 1071Switches 1071Pragmas 1071One-Liners 1072Bibliography 1073Suggested Reading 1073Vendor Manuals 1075Index 1089