gprof on intel Mac

2010/08/06
~ 阿亮 ~

 

◎ 最近在 Mac OSX 用 gprof 發現 "all time zero" 的問題

都會有類似下面的字眼

granularity: each sample hit covers 4 byte(s) no time propagated

然後,所有的時間都是零。

根據這篇 所言:

gprof only works on the Mac if you are NOT using an Intel mac.  If you are
using an Intel Mac, then STOP WASTING your time trying to fix the  gprof "all
zero seconds" problem.  Apple says that gprof does not work for the Intel Mac.

就是說,intel Mac 下這個問題無解。

 

要改用 Xcode 所附的工具 Saturn. (可用 Spotlight 找)

Saturn 詳細使用方法,參考這裡 。

簡單來說,要帶下列的參數來編繹。

gcc example1.c -pg -finstrument-functions -m32 -lSaturn -o example1

 

◎ memory debug in Mac OSX

另外,若要類似 purify 來找 memory leak, 可以試試 Valgrind .

Gnu 提供一篇不錯 Memory Hunting 的文章 。



站內搜尋



本站其他服務

本站其他軟體



  • 下一班公車(nextBus)

    這個 app 只要開啟後,就根據定位幫你過濾出附近站牌的時刻表,以及提供相關公車預計到站的時間,方便您在很快時間內確定要坐的哪一班公車


  • 台灣匯率快算

    提供全球 150 種以上貨幣即時換算,以及各種匯率歷史變化圖。


  • 標案快訊

    讓你可以輕鬆追蹤含有您想要關注關鍵詞的任何採購標案,只要有最新的資訊,「標案快訊」即會推播通知給你.


  • 油價快訊App (OilPrices)

    依據油價及匯率,估算台灣下週油價,另外提供三週、一年以及三年的歷史變化,以及週末下午推播通知最新油價預估或公告。


  • 照片去背(PhotoEraser)

    一款方便移除背景的工具,產生透明背景圖可以存回原本相簿,也可分享到其他 App 使用.


  • 條碼掃描器(QRCode)

    支援 QRCode and Barcodes、可連續快速掃描、自動對焦、可打開手電筒供掃描時使用