DTrace, also known as Dynamic Tracing, was developed by Sun™ as a tool for locating performance bottlenecks in production and pre-production systems. In addition to diagnosing performance problems, DTrace can be used to help investigate and debug unexpected behavior in both the FreeBSD kernel and in userland programs.
DTrace is a remarkable profiling tool, with an impressive array of features for diagnosing system issues. It may also be used to run pre-written scripts to take advantage of its capabilities. Users can author their own utilities using the DTrace D Language, allowing them to customize their profiling based on specific needs.
The FreeBSD implementation provides full support for kernel
DTrace and experimental support for userland DTrace.
Userland DTrace allows users to perform function boundary
tracing for userland programs using the pid
provider, and to insert static probes into userland programs for
later tracing. Some ports, such as
databases/postgres-server and
lang/php56 have a DTrace option to enable
static probes. FreeBSD 10.0-RELEASE has reasonably good userland
DTrace support, but it is not considered production ready. In
particular, it is possible to crash traced programs.
The official guide to DTrace is maintained by the Illumos
project at DTrace
Guide
.
讀完這章,您將了解:
What DTrace is and what features it provides.
Differences between the Solaris™ DTrace implementation and the one provided by FreeBSD.
How to enable and use DTrace on FreeBSD.
在開始閱讀這章之前,您需要:
了解 UNIX® 及 FreeBSD 基礎 (章 3, FreeBSD 基礎)。
Have some familiarity with security and how it pertains to FreeBSD (章 13, 安全性).
本文及其他文件,可由此下載: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/。
若有 FreeBSD 方面疑問,請先閱讀
FreeBSD 相關文件,如不能解決的話,再洽詢
<questions@FreeBSD.org>。
關於本文件的問題,請洽詢
<doc@FreeBSD.org>。