如何在使用llvm-prof進行性能分析時將命令行參數傳遞給我的程序?使用llvm-prof進行性能分析時傳遞命令行參數
我在哪裏可以找到更全面的llvm-prof文檔? 「llvm-prof -help」輸出過於簡短。它的手冊更短。
如何在使用llvm-prof進行性能分析時將命令行參數傳遞給我的程序?使用llvm-prof進行性能分析時傳遞命令行參數
我在哪裏可以找到更全面的llvm-prof文檔? 「llvm-prof -help」輸出過於簡短。它的手冊更短。
你寫的問題的方式意味着你試圖執行使用llvm-prof
程序。但我不確定這是否是這樣做的。個人資料的方式是先來測試您的代碼與計數器使用:
lli -O0 -fake-argv0 'program.bc < YOUR_ARGS' -load llvm/Debug+Asserts/lib/libprofile_rt.so program.profile.bc
注意的方式向參數傳遞給使用-fake-argv0 'program.bc < YOUR_ARGS'
程序:
opt -disable-opt -insert-edge-profiling -o program.profile.bc program.bc
然後如下執行使用lli
儀器化方案以上。此步驟將生成llvmprof.out
文件,然後可以用llvm-prof
讀取文件以生成執行配置文件,如下所示:
llvm-prof program.profile.bc
我建議在此時遠離llvm-prof
。原因是它實際上是在一個月前從主幹LLVM中刪除的(修訂版191835)。這裏是提交消息應該澄清的動機:
Remove the very substantial, largely unmaintained legacy PGO infrastructure. This was essentially work toward PGO based on a design that had several flaws, partially dating from a time when LLVM had a different architecture, and with an effort to modernize it abandoned without being completed. Since then, it has bitrotted for several years further. The result is nearly unusable, and isn't helping any of the modern PGO efforts. Instead, it is getting in the way, adding confusion about PGO in LLVM and distracting everyone with maintenance on essentially dead code. Removing it paves the way for modern efforts around PGO. Among other effects, this removes the last of the runtime libraries from LLVM. Those are being developed in the separate 'compiler-rt' project now, with somewhat different licensing specifically more approriate for runtimes.