Can anybody explain to me the difference between profile-generate and the pg options?
Can anybody explain to me the difference between profile-generate and the pg options?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Both will generate the profile data. But their usage differs.
fprofile-generateis to generate the binary with profiling information which you can re-use to give feedback to the compiler when you compile it again withfprofile-use.For example:
If you execute the binary generated by the about command, it will produce a file called
filename.gcdawith profile data.When you compile it with
fprofile-useagain:This time, gcc will use that data from
filename.gcdato optimize further.When you execute the binary which was compiled with
-pg, it’ll generategmon.outwhich can be later used to analyze the code usinggprofcommand. This is more like static analysis which will give information about code path.