DTrace

DTrace
개발자썬 마이크로시스템즈
발표일2005년 1월(21년 전)(2005-01)
운영 체제솔라리스, 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]), 문서와 각각의 증명 결과도 제공한다.

같이 보기

각주

내용주

  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일에 확인함. 

외부 링크

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.