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

Sett 280 ganger
Hopp til første uleste melding

Lanzhiguan Huang via llvm-dev

ulest,
5. mars 2021, 02:32:1005.03.2021
til 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

ulest,
5. mars 2021, 16:47:1105.03.2021
til 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

Svar alle
Svar til forfatter
Videresend
0 nye meldinger