September 20, 2005

sysprof - System-wide Linux Profiler

昨天閱讀 FootNotes,發現令人讚嘆的消息 [Sysprof 1.0 Released],[sysprof] 是個 profiler,這類的工具已經相當多了,但是 [sysprof] 獨特之處在於以下特性:
  • Full support for threads and shared libraries
  • No recompilation or other instrumentation of applications is necessary.
  • Profiles can be loaded and saved.
  • Supports both x86 and x86-64 architectures
在我這台 Debian 上,安裝好之後,有一個 kernel module ( /lib/modules/2.6.12-1-686/extra/sysprof-module.ko ) 以及 GTK+ 的 sysprof 程式。新聞的評論相當有趣,引述如下:
    multi process tasks
    Submitted by Anonymous George on Mon, 2005-09-19 01:46.
    Suppose for example that you want to understand while window resizing is slow under gnome. You suspect that the answer is one of:
    - X11 sucks
    - gnome sucks
    - metacity sucks

    With a system profiler, you can prove that they all suck at the same time :-)

    Seriouly, a system profiler could be used to profile tasks that require communications between multiple applications. In my example above, you could figure out that metacity is eating most of the CPU to redraw its windows borders hundreds of times per seconds so the application is never given a chance to draw its content.
sysprof 不需要對程式重新編譯的的特性相當吸引我,gprof 很好用,而我的工作 (有 $$ 跟 free 的) 在某種程度來說,頗依賴 gprof 來產生 report。咱們牛刀小試,用來分析 Kaffe cvs head 執行 Qt4-based AWT 的情況,運作情境如 [Screen Shots - Kaffe's Qt AWT backend] 的這張圖:

透過 sysprof 的輸出如下: (按一下放大)

我們可以很清楚的看到 Kaffe JIT3 compiler 與 VM internals 中,對於 Java method 分析和執行的時間成本,也可查看 CFG (Call-Flow Graph),雖然沒有 KDE 的 [KCachegrind] 來得強大,但是這樣不需要 debugging info / profiling symbols 的特性,對我來說,已經非常好用了,而且,說不定 KDevelop 或 [KCachegrind] 會直接整合這個設計也說不定 :-) 由 jserv 發表於 September 20, 2005 04:11 PM
迴響

oprofile 也不错哦, 不过没有 GUI.

sunmoon1997 發表於 September 23, 2005 01:32 AM
發表迴響









記住我的資訊?