gprof使用說明

gcc使用 -pg 參數編譯程序
gcc -o test test.c -g -pg
編譯成功後運行程序,會在當前目錄下生成gmon.out文件
./test
使用gprof和gmon.out運行程序
gprof test gmon.out
這時將輸出程序的性能信息
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章