2012-04-25 69 views
6

當我想用法律約束的統計和法律約束報告從Linux的工具套件perf生成業績報告,我跑:可以從perf.data文件生成perf-stat結果嗎?

$ perf record -o my.perf.data myCmd 
$ perf report -i my.perf.data 

和:

$ perf stat myCmd 

但是,這意味着我跑「myCmd '第二次,這需要幾分鐘。相反,我希望的:

$ perf stat -i my.perf.data 

但是,與大多數在PERF套件的工具,我沒有看到穿孔 - Stat公司-i選項。是否有另一個工具,或者一種獲得perf-report的方法來生成類似的perf-stat輸出?

+3

嗨沒有u得到了問題的解決方案? – 2012-08-12 12:17:38

回答

3

我挖成上kernel.org源,它看起來像有沒有辦法讓PERF的統計解析perf.data

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=tools/perf/builtin-stat.c;h=c70d72003557f17f29345b0f219dc5ca9f572d75;hb=refs/heads/linux-2.6.33.y

如果你看看行245你會看到的功能「run_perf_stat」和308-320左右的行似乎是實際記錄和整理的內容。

我沒有深入研究這個足夠難以確定是否有可能啓用您所需的功能。

它看起來不像perf報告有很多額外的格式化功能。您可以進一步檢查,如果你想在這裏:

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=tools/perf/builtin-report.c;h=860f1eeeea7dbf8e43779308eaaffb1dbcf79d10;hb=refs/heads/linux-2.6.33.y

相關問題