| | 18 | * [http://kcachegrind.sourceforge.net/ KCachegrind] - Profiling Visualization - 這個工具是搭配 Valgrind 這個 Profiler 可以在 runtime 產生 callgrah |
| | 19 | * [http://code.google.com/p/jrfonseca/wiki/Gprof2Dot Gprof2Dot] - 也是透過 profiler 產生的輸出來作視覺化動作,最初是支援 gprof 現在已經支援更多不同 profiler 了。 |
| | 20 | * [http://www.gson.org/egypt/ egypt] - 用 Perl 寫的 |
| | 21 | * Python |
| | 22 | * [http://pycallgraph.slowchop.com/ pycallgraph] - Python Call Graph |
| | 23 | * Bash |
| | 24 | * 我一直想找的是 Bash 的遞迴式 callgraph 產生器,雖然 Bash 可以加入 -X 參數來做 runtime 除錯,不過還沒有找到可以查出多層該怎麼追。 |
| | 25 | * [http://bashdb.sourceforge.net/ bashdb] - BASH Debugger - 可以用類似 GDB 的指令來 DEBUG Bash |
| | 26 | * shprof - a line profiler for shell scripts |
| | 27 | * [http://dev.gentoo.org/~dberkholz/scripts/shprof 原始碼] |
| | 28 | * 這邊有一招是蠻好玩的,居然只要設定 PS4 環境變數就可以秀出每個呼叫的開始時間。(這算是 bash 的簡易版 profiler 嘛?) [http://www.myunitsconverter.com/thread/885124/time%20profiling%20a%20linux%20command%20or%20script <參考討論> time profiling a linux command or script] |
| | 29 | {{{ |
| | 30 | Least invasive you may want to play with some variant of... |
| | 31 | |
| | 32 | set -x |
| | 33 | PS4='$( date ): ' |
| | 34 | sleep 1 |
| | 35 | sleep 3 |
| | 36 | sleep 2 |
| | 37 | exit 0 |
| | 38 | |
| | 39 | which produces timestamps in front of the commands... |
| | 40 | |
| | 41 | Mon Mar 17 02:39:35 CET 2008: PS4='$( date ): ' |
| | 42 | Mon Mar 17 02:39:35 CET 2008: sleep 1 |
| | 43 | Mon Mar 17 02:39:36 CET 2008: sleep 3 |
| | 44 | Mon Mar 17 02:39:39 CET 2008: sleep 2 |
| | 45 | Mon Mar 17 02:39:41 CET 2008: exit 0 |
| | 46 | }}} |