사용 반환 한 :
perf stat ./yourapp
은 자세한 내용은 kernel wiki perf tutorial를 참조하십시오. 이것은 CPU의 하드웨어 성능 카운터를 사용하므로 오버 헤드가 매우 적습니다. 위키에서
예 :
perf stat -B dd if=/dev/zero of=/dev/null count=1000000
Performance counter stats for 'dd if=/dev/zero of=/dev/null count=1000000':
5,099 cache-misses # 0.005 M/sec (scaled from 66.58%)
235,384 cache-references # 0.246 M/sec (scaled from 66.56%)
9,281,660 branch-misses # 3.858 % (scaled from 33.50%)
240,609,766 branches # 251.559 M/sec (scaled from 33.66%)
1,403,561,257 instructions # 0.679 IPC (scaled from 50.23%)
2,066,201,729 cycles # 2160.227 M/sec (scaled from 66.67%)
217 page-faults # 0.000 M/sec
3 CPU-migrations # 0.000 M/sec
83 context-switches # 0.000 M/sec
956.474238 task-clock-msecs # 0.999 CPUs
0.957617512 seconds time elapsed
(리눅스 기반 패키지) 현대 데비안 시스템에서 수동으로 커널 모듈을로드 할 필요가 없습니다 그냥 작동합니다. 'perf record -a'/ 'perf report'콤보를 사용하면 전체 시스템 프로파일 링을 수행 할 수도 있습니다. 디버깅 기호가있는 응용 프로그램이나 라이브러리는 보고서에 세부 정보와 함께 표시됩니다. 시각화를 위해 flame graphs 잘 작동하는 것 같습니다.
이와 비슷한 제품을 찾고 계십니까? http://software.intel.com/en-us/articles/intel-performance-counter-monitor/ – harold