wiki:jazz/DEBUG

DEBUG / profiler

callgraph : 了解程式流程

  • (2011-03-31)
  • C/C++
  • Python
  • Bash
    • 我一直想找的是 Bash 的遞迴式 callgraph 產生器,雖然 Bash 可以加入 -X 參數來做 runtime 除錯,不過還沒有找到可以查出多層該怎麼追。
    • bashdb - BASH Debugger - 可以用類似 GDB 的指令來 DEBUG Bash
    • shprof - a line profiler for shell scripts
    • 這邊有一招是蠻好玩的,居然只要設定 PS4 環境變數就可以秀出每個呼叫的開始時間。(這算是 bash 的簡易版 profiler 嘛?) <參考討論> time profiling a linux command or script
      Least invasive you may want to play with some variant of...
      
      set -x
      PS4='$( date ): '
      sleep 1
      sleep 3
      sleep 2
      exit 0
      
      which produces timestamps in front of the commands...
      
      Mon Mar 17 02:39:35 CET 2008: PS4='$( date ): '
      Mon Mar 17 02:39:35 CET 2008: sleep 1
      Mon Mar 17 02:39:36 CET 2008: sleep 3
      Mon Mar 17 02:39:39 CET 2008: sleep 2
      Mon Mar 17 02:39:41 CET 2008: exit 0
      

Profiling / Profiler : 了解程式特性(CPU、記憶體、I/O)

  • Bash
    • 看樣子,bash 編譯時如果加入 --enable-profiling 就可以透過 gprof 進行 profiling。至於怎麼用,暫且還沒找到範例。
  • MPI
    • Debian 套件 tau - Tuning and Analysis Utilities - base profiling toolkit
      • TAU is a profiling toolkit specially made for parallel computing (multi-thread, multi-process, MPI, PVM). - 針對平行程式的 Profiler 不過套件裡面包的只有 pthread 的支援,因此無法做 MPI, PVM 分析。
      • Debian 套件 tau-examples - Tuning and Analysis Utilities - examples - 一些 TAU 的範例
      • Debian 套件 python-tau - Tuning and Analysis Utilities - support for python bindings

Systemtap / DTrace / ftrace

Code Peer Review

Perl Debugger

  • EPIC - Perl Editor and IDE for Eclipse
Last modified 10 years ago Last modified on Mar 29, 2014, 1:01:42 AM