DTrace(Dynamic Tracing):Solaris 10 的新特性


作者:Fenng
出处:http://www.dbanotes.net
日期:December 24, 2004

« Yong Huang 的站点和这个人 | Blog首页 | Zeitgeist, Google 2004 Year-End Zeitgeist »


Solaris 10 的新特性中和 DBA 关系最大的恐怕就是这个 Dtrace 了。Dtrace(Dynamic Tracing)是“Solaris 操作系统的一种复杂动态跟踪框架”。与其他商用 Unix 提供的性能工具有本质区别,据称“Dtrace 在 Solaris OS 内部构建,其在内核中采用了 25,000 个探测器”(SPARCX86 平台都可用),在应用层和核心层都可发挥作用。这对于 DBA 来说是个绝佳的好工具,便于更快诊断并定位操作系统性能瓶颈。比如主开发者 Bryan Cantrill 提到的利用 Dtrace 的 plockstat provider 来诊断锁(Lock)竞争的问题。

粗略信息可以参考一下这则精彩回放。目前主要的开发者是这三个家伙 Bryan Cantrill,Adam Leventhal,Mike Shapiro,这几个家伙的 BLOG 上有很多有趣的内容。

BigAdmin: DTrace 的页面可以找到很多 DTrace 的文档。DTrace也不是没有弱点:目前对 Java 虚拟机还不能够处理

如果有相应的环境和足够兴趣的话,可以去参加这个 Solaris 10 Challenge Competition ,里面有两项是关于 Dtrace 的,另外两项涉及 Solaris 的另一个非常重要的新特性: Solaris Containers(Solaris Zones ?)。

备忘(入门的参考信息:Demo'ing DTrace):

# dtrace
Usage: dtrace [-32|-64] [-aACeEFGHlqSvVwZ] [-b bufsz] [-c cmd] [-D name[=def]]
        [-I path] [-o output] [-p pid] [-s script] [-U name]
        [-x opt[=val]] [-X a|c|s|t]

        [-P provider [[ predicate ] action ]]
        [-m [ provider: ] module [[ predicate ] action ]]
        [-f [[ provider: ] module: ] func [[ predicate ] action ]]
        [-n [[[ provider: ] module: ] func: ] name [[ predicate ] action ]]
        [-i probe-id [[ predicate ] action ]] [ args ... ]

        predicate -> '/' D-expression '/'
           action -> '{' D-statements '}'

        -32 generate 32-bit D programs and ELF files
        -64 generate 64-bit D programs and ELF files

        -a  claim anonymous tracing state
        -A  generate driver.conf(4) directives for anonymous tracing
        -b  set trace buffer size
        -c  run specified command and exit upon its completion
        -C  run cpp(1) preprocessor on script files
        -D  define symbol when invoking preprocessor
        -e  exit after compiling request but prior to enabling probes
        -E  exit after enabling probes but prior to tracing data
        -f  enable or list probes matching the specified function name
        -F  coalesce trace output by function
        -G  generate an ELF file containing embedded dtrace program
        -H  print included files when invoking preprocessor
        -i  enable or list probes matching the specified probe id
        -I  add include directory to preprocessor search path
        -l  list probes matching specified criteria
        -m  enable or list probes matching the specified module name
        -n  enable or list probes matching the specified probe name
        -o  set output file
        -p  grab specified process-ID and cache its symbol tables
        -P  enable or list probes matching the specified provider name
        -q  set quiet mode (only output explicitly traced data)
        -s  enable or list probes according to the specified D script
        -S  print D compiler intermediate code
        -U  undefine symbol when invoking preprocessor
        -v  set verbose mode (report program stability attributes)
        -V  report DTrace API version
        -w  permit destructive actions
        -x  enable or modify compiler and tracing options
        -X  specify ISO C conformance settings for preprocessor
        -Z  permit probe descriptions that match zero probes

同类产品 AIXTrace,HP-UX glance 等看来都要对 Dtrace 甘拜下风了。

Sun 的 Blog站点上内容真是比较丰富,虽然 BLOG 工具比较烂,惨被 SPAM 注释攻击。


Posted by Fenng at December 24, 2004 05:25 PM
Last updated at 06:20 PM on August 20, 2005


相关文章

Trackback Pings

TrackBack URL for this entry:
http://www.dbanotes.net/mt/mt-tb.cgi/34

Listed below are links to weblogs that reference DTrace(Dynamic Tracing):Solaris 10 的新特性:

» Solaris 10's Dtrace Open Source !? from DBA's Notes
Sun 日前宣布Solaris 10 的Dynamic Tracing (DTrace)将开源 [Read More]

Tracked on November 25, 2005 07:32 PM

» enclosure5 from enclosure5
enclosure5 [Read More]

Tracked on April 9, 2006 04:19 AM

» caribbean travel and tourism from caribbean travel and tourism
[Read More]

Tracked on April 14, 2007 11:10 AM

» parallel line from parallel line
shit-happens 2793109 Aggregator of parallel line sites [Read More]

Tracked on June 17, 2007 02:42 AM

» mathematical optimization from mathematical optimization
shit-happens 2793109 Latest mathematical optimization news [Read More]

Tracked on June 20, 2007 07:00 PM

» helicopter crash kauai from helicopter crash kauai
shit-happens 2793109 Popular authors of helicopter crash kauai articles [Read More]

Tracked on June 24, 2007 01:50 PM

Comments


Post a comment



Hint: 为避免您收到垃圾邮件,请尽量不用使用真实的邮件地址.


Remember Me?