DTrace

DTrace
개발자썬 마이크로시스템즈
발표일2005년 1월
운영 체제솔라리스, macOS, FreeBSD, NetBSD, 리눅스[1]
종류Tracing
라이선스CDDL
상태개발 중
웹사이트dtrace.org

DTrace는 운영 시스템의 커널과 응용 프로그램 문제를 실시간으로 해결하기 위해 썬 마이크로시스템즈가 개발한 동적 트레이싱 프레임워크이다. 원래 솔라리스용으로 개발되었다가, 그 이후로 자유 공동 개발 및 배포 허가서(CDDL)로 출시되면서 다른 여러 유닉스 계열 운영 체제로 이식되었다.

DTrace는 메모리의 양, CPU 시간, 또 실행 중인 프로세스들이 사용하는 파일 시스템 및 네트워크 자원 등, 실행 중인 시스템의 전반적인 개요를 가져오는데 사용할 수 있다. 특정 함수가 호출된 인수의 로그라든지 특정 파일에 접근하는 프로세스의 목록과 같은 훨씬 더 자세한 정보를 제공할 수 있다.

2011년 10월 기준으로, 오라클은 DTrace를 리눅스로 이식하는 것을 발표하였으나 2014년 10월 13일 기준으로 공식적으로 이용이 불가능한 상황이다.[2] DTrace의 비공식 리눅스 포트는 이용할 수 있으나, 라이선스 조항에 대한 변경사항은 없다.[3]

명령 줄 예

하나 이상의 프로브(probe)와 액션(action)을 인수로 지정하여 DTrace 스크립트를 명령 줄에서 직접 호출할 수 있다. 일부 예는 다음과 같다:

# New processes with arguments
dtrace -n 'proc:::exec-success { trace(curpsinfo->pr_psargs); }'

# Files opened by process
dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }'

# Syscall count by program
dtrace -n 'syscall:::entry { @num[execname] = count(); }'

# Syscall count by syscall
dtrace -n 'syscall:::entry { @num[probefunc] = count(); }'

# Syscall count by process
dtrace -n 'syscall:::entry { @num[pid,execname] = count(); }'

# Disk size by process
dtrace -n 'io:::start { printf("%d %s %d",pid,execname,args[0]->b_bcount); }'

# Pages paged in by process
dtrace -n 'vminfo:::pgpgin { @pg[execname] = sum(arg0); }'

수백 줄의 길이로 스크립트의 작성이 가능하지만 일반적으로 고급 문제 해결 및 분석에는 수십 줄이 필요하다. 200개 이상의 오픈 소스 DTrace 스크립트의 예제를 DTraceToolkit에서 볼 수 있으며,[4] 이는 DTrace 책의 저자 Brendan Gregg가 만든 것으로[5]), 문서와 각각의 증명 결과도 제공한다.

같이 보기

  • ftrace
  • ktrace
  • Ltrace
  • Strace
  • SystemTap
  • Sysdig
  • LTTng
  • IBM ProbeVue

각주

  • Bryan Cantrill (February 2006). “Hidden in Plain Sight”. 《en:ACM Queue》 4 (1): 26–36. doi:10.1145/1117389.1117401. 2006년 10월 2일에 원본 문서에서 보존된 문서. 2006년 9월 8일에 확인함. 
  • Bryan M. Cantrill, Michael W. Shapiro and Adam H. Leventhal (June 2004). 《Dynamic Instrumentation of Production Systems》. Proceedings of the 2004 en:USENIX Annual Technical Conference. 2006년 9월 8일에 확인함. 

내용주

  1. “Trying out dtrace”. 《oracle.com》. 
  2. http://www.slideshare.net/brendangregg/from-dtrace-to-linux Published on Oct 13, 2014 (slide 28)
  3. https://github.com/dtrace4linux/linux
  4. “DTraceToolkit”. en:Brendan Gregg. 2014년 6월 8일에 확인함. 
  5. “DTrace: Dynamic Tracing in Oracle Solaris, Mac OS X and FreeBSD”. Safari Books. 2011년 4월 6일에 원본 문서에서 보존된 문서. 2011년 1월 3일에 확인함. 

외부 링크

  • DTrace Tools – Brendan Gregg's DTrace examples (2004)
  • FreeBSD DTrace page – FreeBSD DTrace homepage, includes a tutorial and one-liners
  • DTrace book 보관됨 2013-11-07 - archive.today – includes hundreds of example scripts
  • Dynamic Tracing with DTrace & SystemTap – free book with examples and exercises
  • DTrace book scripts – DTrace book scripts on GitHub
  • DTraceToolkit – a collection of DTrace scripts
  • DTrace Hands On Lab – a step-by-step course to learn DTrace
  • DLight Tutorial – an interactive GUI utility for C/C++ developers based on DTrace technology from the Oracle Solaris Studio
  • Exploring Leopard with DTrace – DTrace for debugging and exploration
  • Tech Talk on DTrace given by Bryan Cantrill
  • Hidden in Plain Sight, Sun Microsystems, by Bryan Cantrill
  • v
  • t
  • e
솔라리스
기술
  • 다이렉트 바인딩
  • Doors
  • DTrace
  • IPMP
  • 점프스타트
  • mdb
  • MPxIO
  • SMF
  • snoop
  • Containers
  • Crossbow
  • 클러스터
  • Trusted Extensions
  • ZFS
일루모스/오픈솔라리스