wiki:jazz/11-03-31

2011-03-31

IOWait

callgraph

  • 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
      
Last modified 13 years ago Last modified on Apr 22, 2011, 2:34:00 PM

Attachments (3)

Download all attachments as: .zip