Re: [請益] perl的call graph做法or工具
※ 引述《kotou (Eddie)》之銘言:
: 各位大大好
: 因為小弟研究的關係,所以有很多程式碼要分析
: 小弟先前有問過如何用perl寫C/C++的call graph
: 之後是使用cflow這款工具,配合system函式執行
: 大量輸出每隻程式的function call
: 目前想要分析perl的程式碼
: 我有上網找資料
: 但大多都是要在分析的程式碼內引用特定的模組
: 我希望能夠另外寫一隻程式以讀檔的方式產生perl的call graph
: 想請問各位大大,有沒有寫過或用過可以產生perl的call graph的工具
: 或是有寫過可以給我一些提點
: 非常謝謝各位的幫助
推薦 NYTProf + kcachegrind
執行方法:
# profile code and write database to ./nytprof.out
perl -d:NYTProf some_perl_script.pl
# Convert an NYTProf profile into Callgrind format
nytprofcg --file=nytprof.out --out=nytprof.callgrind
產生 nytprof.callgrind 檔案
之後可以用 kcachegrind 看 GUI 分析
http://kcachegrind.sourceforge.net/html/Home.html
Call Graph 範例:
http://kcachegrind.sourceforge.net/html/CallGraph.html
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.195.8.21
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
Perl 近期熱門文章
PTT數位生活區 即時熱門文章