Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Appendix E. USDT Example

E. USDT Example

This appendix was contributed by Alan Hargreaves.

Throughout this book, the suggested strategies for tracing user-land applications typically end with using the pid provider to trace application internals, should easier, stable providers not be available. Using the unstable pid provider can be extremely complex, can be extremely time-consuming, and can make for some brittle and difficult-to-maintain scripts. It can take days to figure out how to extract the desired information from the running internals of an application. Another option exists for using DTrace to observe and analyze application software; if the source code is available, you can insert your own User Statically Defined Tracing (USDT) provider into the source code to provide the custom probes and arguments that you desire. For them to be available in the production environment, the modified source code must be recompiled and the new binaries deployed. USDT gives us a way to build an application-specific provider with probe names and arguments that make semantic sense in the context of the application. For example, a USDT provider for a database could provide probes named query-start and query-end, with arguments containing the query string and client and database name, for queries to be examined and their time measured.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial