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

420 views
Skip to first unread message

Lanzhiguan Huang via llvm-dev

unread,
Mar 5, 2021, 2:32:10 AM3/5/21
to LLVM Developers Mailing List
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

Wenlei He via llvm-dev

unread,
Mar 5, 2021, 4:47:11 PM3/5/21
to Lanzhiguan Huang, LLVM Developers Mailing List, Lei Wang, Hongtao Yu

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

Reply all
Reply to author
Forward
0 new messages