[llvm-dev] How to generate the perfscript file for llvm-profgen

Wenlei He via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 5 13:47:01 PST 2021


Thanks for trying it out!

To get context-sensitive profile, you will need to collect perf data with both LBR and stack sample enabled. We use something like this:

perf record -g --call-graph fp -e br_inst_retired.near_taken:uppp -c 16009 -b -o <perf_data_output> <command_to_profile>

Here’s the perf script command to extract both LBR and stack sample:

perf script -F ip,brstack -i <perf_data_output>  --show-mmap-event &> <perf_script_output>

Let us know how it works.

Thanks,
Wenlei

From: llvm-dev <llvm-dev-bounces at lists.llvm.org> on behalf of Lanzhiguan Huang via llvm-dev <llvm-dev at lists.llvm.org>
Date: Thursday, March 4, 2021 at 11:32 PM
To: LLVM Developers Mailing List <llvm-dev at lists.llvm.org>
Subject: [llvm-dev] How to generate the perfscript file for llvm-profgen
Hi,
  I'm really interested in the new CSSPGO tool, can anyone give me some more detailed instructions about how to generate the perfscript file it needs, I tried to first use "perf record -e xxx -b ..." to generate a perf.data file and then use "perf script" to dump all the text into a perfscript file, but it seems to be different from the perfscript under the llvm/test/tools/llvm-profgen/Inputs directory.

Lanzhiguan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210305/ba5fd71c/attachment.html>


More information about the llvm-dev mailing list