'callgrind'에 해당되는 글 1건

  1. 2007.11.08 valgrind (callgrind) 3

일반적으로 리눅스에서 작업중 튜닝이 필요할때 프로파일링 작업을 한다.

가장 일반적인 방법이 컴파일 옵션에 -pg를 주고 pgrof로 프로파일링된 내용을 보는것인데

이것과는 조금 다른 프로파일링 기법이 있어서 소개한다.

이미 많은 개발자들이 사용하고 있는 valgrind의 서브 모듈인 callgrind가 바로 그것인데

아래에 간단한 사용법을 정리하였다


 실행 방법

> valgrind --tool=callgrind ./test < input.txt > /dev/null


실행된 내용은 가지고 출력 파일을 생성한다

>callgrind_annotate callgrind.out.7838 > callgrind.out.7838.txt


사용법 보기

> callgrind_annotate --help


함수별 결과보기

> callgrind_annotate --inclusive=yes callgrind.out.7842 > callgrind.out.7842.txt


호출한 함수 목록 보기

>callgrind_annotate --inclusive=yes --tree=caller callgrind.out.7842 > callgrind.out.7842.txt

>많은 정보 보기

>callgrind_annotate --inclusive=yes --tree=both --context=100 --auto=yes --threshold=10 callgrind.out.11328 > callgrind.out.11328.txt


I   <- instruction

D  <- data

r   <- read

w  <- write

l    <- level n cache
m  <- memory

'프로그램밍' 카테고리의 다른 글

구글 엄청 빠르네...크롤러와 동적 색인...  (2) 2008.01.17
gcov - 쓰레기 코드 찾아내기  (0) 2008.01.17
ternary search tree-1  (0) 2007.11.01
ternary search tree  (2) 2007.11.01
비터비 알고리즘(viterbi)  (0) 2007.06.14
Posted by 고요한하늘
,